连接 · 13 款客户端
MCP 客户端配置参考
每款 MCP 客户端都会从自己的位置读取服务器配置,使用各自的键,有时还采用不同的格式。此表列出了每款客户端读取配置的位置、所需的配置结构,以及是否支持远程服务器的 OAuth。
| 客户端 | 配置文件 | 顶层键 | 格式 | 远程 OAuth | 通过 CLI 添加 |
|---|---|---|---|---|---|
| Claude Desktop | ~/Library/Application Support/Claude/claude_desktop_config.json | mcpServers | json | 是 | 否 |
| Claude Code | .mcp.json | mcpServers | json | 是 | 是 |
| Cursor | .cursor/mcp.json | mcpServers | json | 是 | 否 |
| VS Code (GitHub Copilot) | .vscode/mcp.json (key 'servers') or portable .mcp.json (key 'mcpServers') | servers | json | 是 | 是 |
| Windsurf / Devin Desktop | .devin/mcp_config.json (Devin CLI / Devin Local project scope) | mcpServers | json | 是 | 是 |
| Zed | ~/.config/zed/settings.json | context_servers | json | 是 | 否 |
| OpenAI Codex CLI | .codex/config.toml (trusted projects only) | mcp_servers | toml | 是 | 是 |
| Gemini CLI | .gemini/settings.json | mcpServers | json | 是 | 是 |
| ChatGPT | 仅限设置界面 | — | — | 是 | 否 |
| OpenClaw | ~/.openclaw/openclaw.json | mcp.servers | json5 | 是 | 是 |
| Cline | ~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json | mcpServers | json | 未提供文档 | 是 |
| Continue | .continue/mcpServers/<name>.yaml (or drop a Claude/Cursor/Cline-style mcp.json into .continue/mcpServers/) | mcpServers | yaml | 未提供文档 | 否 |
| JetBrains AI Assistant | 仅限设置界面 | mcpServers | json (pasted in UI) | 未提供文档 | 否 |
容易导致配置失败的差异
VS Code 使用 servers
.vscode/mcp.json 使用 servers 而非 mcpServers 列出配置项,因此直接粘贴 Cursor 或 Claude 的配置无法加载。较新的通用配置文件 .mcp.json 和 ~/.copilot/mcp-config.json 则使用 mcpServers。
Gemini CLI 使用 httpUrl,而非 url
Gemini CLI 根据字段名选择传输方式。httpUrl 表示 Streamable HTTP,url 表示旧版 SSE 传输方式,command 表示 stdio。现代远程服务器需要使用 httpUrl。
OpenClaw 和 Cline 默认使用 SSE
远程配置项如果未指定传输方式,两者都会回退到旧版 SSE。在 OpenClaw 中将 transport 设为 streamable-http,在 Cline 中将 type 设为 streamableHttp。
Claude Code 需要设置 type
在 .mcp.json 中,远程条目如果有 url 却没有 type,就会报错。在 url 旁添加 type http;stdio 条目则使用 type stdio。
Codex 使用 TOML,每个服务器对应一个表
Codex 不使用 JSON 文件。每个服务器在 config.toml 中都有自己的 [mcp_servers.<name>] 表,args 是 TOML 数组,而 env_vars 会按名称从你的 shell 转发密钥。
Continue 要求使用 YAML 列表
在 Continue 中,mcpServers 是一个条目列表,每个条目都包含 name,而不是以名称为键的映射。每个 block 文件顶部还必须包含 name、version 和 schema: v1。