news 2026/7/2 3:46:51

Qoder 支持通过 DeepLink 添加 MCP Server

作者头像

张小明

前端开发工程师

1.2k 24
文章封面图
Qoder 支持通过 DeepLink 添加 MCP Server

Deeplinks 允许用户通过简单的 URL 与他人分享 AI Chat 提示词、Quest 任务、规则和 MCP 服务器配置。当您点击深链时,IDE 会打开并显示确认对话框,展示即将添加的内容。在您审核并确认前,深链不会自动执行任何操作。

URL 格式

{scheme}://{host}/{path}?{parameters}

可用的深链类型

创建智能会话

/chat分享可直接用于聊天的提示词。点击聊天深链后,IDE 会打开并在聊天输入框中预填充指定内容。

URL 格式

qoder://aicoding.aicoding-deeplink/chat?text={prompt}&mode={mode}

参数说明

示例

qoder://aicoding.aicoding-deeplink/chat?text=%E5%B8%AE%E6%88%91%E9%87%8D%E6%9E%84%E8%BF%99%E6%AE%B5%E4%BB%A3%E7%A0%81&mode=agent

生成链接代码

  • TypeScript
function generateChatDeeplink(text: string, mode?: 'agent' | 'ask'): string { if (!text) { throw new Error('缺少必需参数: text'); } const url = new URL('qoder://aicoding.aicoding-deeplink/chat'); url.searchParams.set('text', text); if (mode) { url.searchParams.set('mode', mode); } return url.toString(); } // 示例 const deeplink = generateChatDeeplink('帮我重构这段代码以提升性能', 'agent'); console.log(deeplink); // qoder://aicoding.aicoding-deeplink/chat?text=%E5%B8%AE%E6%88%91...&mode=agent
  • Python
from urllib.parse import urlencode def generate_chat_deeplink(text: str, mode: str = None) -> str: if not text: raise ValueError('缺少必需参数: text') params = {'text': text} if mode: params['mode'] = mode return f"qoder://aicoding.aicoding-deeplink/chat?{urlencode(params)}" # 示例 deeplink = generate_chat_deeplink('帮我重构这段代码以提升性能', 'agent') print(deeplink)

创建 Quest 任务

/quest分享 Quest 任务,让 AI 自主完成复杂的开发任务。Quest 模式允许 AI 规划、执行并迭代任务,最大限度减少人工干预。

URL 格式

qoder://aicoding.aicoding-deeplink/quest?text={description}&agentClass={agentClass}

参数说明

执行模式

示例

qoder://aicoding.aicoding-deeplink/quest?text=%E5%AE%9E%E7%8E%B0JWT%E7%94%A8%E6%88%B7%E8%AE%A4%E8%AF%81&agentClass=LocalWorktree

生成链接代码

  • TypeScript
type AgentClass = 'LocalAgent' | 'LocalWorktree' | 'RemoteAgent'; function generateQuestDeeplink(text: string, agentClass?: AgentClass): string { if (!text) { throw new Error('缺少必需参数: text'); } const url = new URL('qoder://aicoding.aicoding-deeplink/quest'); url.searchParams.set('text', text); if (agentClass) { url.searchParams.set('agentClass', agentClass); } return url.toString(); } // 示例 const deeplink = generateQuestDeeplink('实现基于 JWT 的用户认证系统', 'LocalWorktree'); console.log(deeplink);
  • Python
from urllib.parse import urlencode def generate_quest_deeplink(text: str, agent_class: str = None) -> str: if not text: raise ValueError('缺少必需参数: text') params = {'text': text} if agent_class: params['agentClass'] = agent_class return f"qoder://aicoding.aicoding-deeplink/quest?{urlencode(params)}" # 示例 deeplink = generate_quest_deeplink('实现基于 JWT 的用户认证系统', 'LocalWorktree') print(deeplink

示例

deeplink = generate_quest_deeplink('实现基于 JWT 的用户认证系统', 'LocalWorktree')print(deeplink)

创建规则

/rule分享规则来指导 AI 行为。规则可以定义代码规范、项目约定或 AI 响应的特定指令。

URL 格式

qoder://aicoding.aicoding-deeplink/rule?name={ruleName}&text={ruleContent}

参数说明

示例

qoder://aicoding.aicoding-deeplink/rule?name=typescript-conventions&text=%E5%A7%8B%E7%BB%88%E4%BD%BF%E7%94%A8%E4%B8%A5%E6%A0%BC%E7%9A%84TypeScript%E7%B1%BB%E5%9E%8B

生成链接代码

  • TypeScript
function generateRuleDeeplink(name: string, text: string): string { if (!name || !text) { throw new Error('缺少必需参数: name 和 text'); } const url = new URL('qoder://aicoding.aicoding-deeplink/rule'); url.searchParams.set('name', name); url.searchParams.set('text', text); return url.toString(); } // 示例 const deeplink = generateRuleDeeplink( 'typescript-conventions', `始终使用严格的 TypeScript 类型。 避免使用 'any' 类型。 对象类型优先使用 interface 而非 type。` ); console.log(deeplink);
  • Python
from urllib.parse import urlencode def generate_rule_deeplink(name: str, text: str) -> str: if not name or not text: raise ValueError('缺少必需参数: name 和 text') params = {'name': name, 'text': text} return f"qoder://aicoding.aicoding-deeplink/rule?{urlencode(params)}" # 示例 deeplink = generate_rule_deeplink( 'typescript-conventions', """始终使用严格的 TypeScript 类型。 避免使用 'any' 类型。 对象类型优先使用 interface 而非 type。""" ) print(deeplink)

添加 MCP 服务器

/mcp/add分享 MCP (Model Context Protocol) 服务器配置。MCP 服务器通过提供额外的工具和上下文来源来扩展 AI 能力。

URL 格式

qoder://aicoding.aicoding-deeplink/mcp/add?name={serverName}&cnotallow={base64EncodedConfig}

参数说明

注意:配置必须包含 command 或 url 其中之一。

示例

qoder://aicoding.aicoding-deeplink/mcp/add?name=postgres&cnotallow=JTdCJTIyY29tbWFuZCUyMiUzQSUyMm5weCUyMiUyQyUyMmFyZ3MlMjIlM0ElNUIlMjIteSUyMiUyQyUyMiU0MG1vZGVsY29udGV4dHByb3RvY29sJTJGc2VydmVyLXBvc3RncmVzJTIyJTJDJTIycG9zdGdyZXNxbCUzQSUyRiUyRmxvY2FsaG9zdCUyRm15ZGIlMjIlNUQlN0Q%3D

生成链接代码MCP server JSON 配置编码流程:

  1. 创建配置 JSON 对象
  2. 使用 JSON.stringify() 序列化
  3. 使用 encodeURIComponent() 进行 URL 编码
  4. 使用 btoa() 进行 Base64 编码
  5. 使用 encodeURIComponent() 对结果进行 URL 编码
  • TypeScript
interface McpServerConfig { command?: string; args?: string[]; url?: string; env?: Record<string, string>; } function generateMcpAddDeeplink(name: string, config: McpServerConfig): string { if (!name) { throw new Error('缺少必需参数: name'); } if (!config) { throw new Error('缺少必需参数: config'); } if (!config.command && !config.url) { throw new Error('配置必须包含 "command" 或 "url"'); } const configJson = JSON.stringify(config); const base64Config = btoa(encodeURIComponent(configJson)); const encodedName = encodeURIComponent(name); const encodedConfig = encodeURIComponent(base64Config); return `qoder://aicoding.aicoding-deeplink/mcp/add?name=${encodedName}&cnotallow=${encodedConfig}`; } // 示例 1: PostgreSQL MCP 服务器 const postgresDeeplink = generateMcpAddDeeplink('postgres', { command: 'npx', args: ['-y', '@modelcontextprotocol/server-postgres', 'postgresql://localhost/mydb'] }); console.log(postgresDeeplink); // 示例 2: 带环境变量的 GitHub MCP 服务器 const githubDeeplink = generateMcpAddDeeplink('github', { command: 'npx', args: ['-y', '@modelcontextprotocol/server-github'], env: { GITHUB_PERSONAL_ACCESS_TOKEN: '<YOUR_TOKEN>' } }); console.log(githubDeeplink); // 示例 3: 基于 HTTP 的 MCP 服务器 const httpDeeplink = generateMcpAddDeeplink('custom-server', { url: 'https://mcp.example.com/sse' }); console.log(httpDeeplink);
  • Python
import json import base64 from urllib.parse import quote def generate_mcp_add_deeplink(name: str, config: dict) -> str: if not name: raise ValueError('缺少必需参数: name') if not config: raise ValueError('缺少必需参数: config') if 'command' not in config and 'url' not in config: raise ValueError('配置必须包含 "command" 或 "url"') config_json = json.dumps(config) config_encoded = quote(config_json) config_base64 = base64.b64encode(config_encoded.encode()).decode() encoded_name = quote(name) encoded_config = quote(config_base64) return f"qoder://aicoding.aicoding-deeplink/mcp/add?name={encoded_name}&cnotallow={encoded_config}" # 示例 1: PostgreSQL MCP 服务器 postgres_deeplink = generate_mcp_add_deeplink('postgres', { 'command': 'npx', 'args': ['-y', '@modelcontextprotocol/server-postgres', 'postgresql://localhost/mydb'] }) print(postgres_deeplink) # 示例 2: 带环境变量的 GitHub MCP 服务器 github_deeplink = generate_mcp_add_deeplink('github', { 'command': 'npx', 'args': ['-y', '@modelcontextprotocol/server-github'], 'env': { 'GITHUB_PERSONAL_ACCESS_TOKEN': '<YOUR_TOKEN>' } }) print(github_deeplink)

安全注意事项

重要提示:在分享或点击深链前,请务必审核内容。

  • 不要包含敏感数据:不要在深链中嵌入 API 密钥、密码或专有代码
  • 验证来源:只点击来自可信来源的深链
  • 确认前仔细审核:IDE 始终会显示确认对话框,请在继续前仔细审核内容
  • 不会自动执行:深链永远不会自动执行,始终需要用户确认

常见问题排查

URL 长度限制深链 URL 不应超过 8,000 个字符。对于较长的内容,可以考虑:

  • 精简提示词或规则内容
  • 使用外部引用替代内联内容
  • 拆分为多个深链

详细内容,可以关注产品文档介绍:​​https://docs.qoder.com/zh/user-guide/deeplink​​

关注我,掌握Qoder最新动态

版权声明: 本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若内容造成侵权/违法违规/事实不符,请联系邮箱:809451989@qq.com进行投诉反馈,一经查实,立即删除!
网站建设 2026/6/28 23:09:28

J-Runner-with-Extras完整使用指南:从零开始掌握Xbox 360改装技术

J-Runner-with-Extras完整使用指南&#xff1a;从零开始掌握Xbox 360改装技术 【免费下载链接】J-Runner-with-Extras Source code to the J-Runner with Extras executable. Requires the proper support files, package can be found in README 项目地址: https://gitcode.…

作者头像 李华
网站建设 2026/6/29 7:05:39

十分钟搞定Llama Factory微调:无需配置的云端GPU解决方案

十分钟搞定Llama Factory微调&#xff1a;无需配置的云端GPU解决方案 想尝试用Llama模型生成特定风格的对话&#xff0c;却被CUDA配置和依赖问题劝退&#xff1f;本文将介绍如何通过预置镜像快速完成Llama Factory微调&#xff0c;完全跳过环境搭建的繁琐步骤。这类任务通常需要…

作者头像 李华
网站建设 2026/6/28 23:03:14

1小时验证创意:健康证小程序原型设计实战

快速体验 打开 InsCode(快马)平台 https://www.inscode.net输入框内输入如下内容&#xff1a; 创建一个可交互的健康证原型demo&#xff0c;重点展示&#xff1a;1.三种不同样式的健康证模板切换&#xff1b;2.表单填写实时预览效果&#xff1b;3.用户调研反馈收集组件。使用…

作者头像 李华
网站建设 2026/6/28 23:37:16

5大创新代码保护技术:如何构建坚不可摧的软件防护体系?

5大创新代码保护技术&#xff1a;如何构建坚不可摧的软件防护体系&#xff1f; 【免费下载链接】tsunami-security-scanner Tsunami is a general purpose network security scanner with an extensible plugin system for detecting high severity vulnerabilities with high …

作者头像 李华
网站建设 2026/6/29 22:47:34

如何用Claude Code MCP彻底解决AI编程权限难题?

如何用Claude Code MCP彻底解决AI编程权限难题&#xff1f; 【免费下载链接】claude-code-mcp Claude Code as one-shot MCP server 项目地址: https://gitcode.com/gh_mirrors/claud/claude-code-mcp 你是否曾经遇到过这样的场景&#xff1a;当你想要让AI助手帮你完成一…

作者头像 李华
网站建设 2026/6/26 9:32:34

新手友好!Llama Factory可视化微调入门

新手友好&#xff01;Llama Factory可视化微调入门 作为一名编程培训班的老师&#xff0c;我经常遇到一个难题&#xff1a;如何让学员们快速理解AI模型微调的基本概念&#xff0c;尤其是当大家的电脑配置参差不齐时。最近我发现了一个非常实用的解决方案——Llama Factory可视化…

作者头像 李华