其他 IDE 的 MCP 配置
在 Visual Studio、JetBrains、Xcode 和 Eclipse 添加远程或本地服务器。
This page has not been translated into English yet. The original Chinese version is shown below.
四种编辑器都支持本地进程与远程 MCP,但配置界面和部分字段不同。先确认组织 MCP 策略允许使用,再按实际客户端操作。
配置入口
| IDE | 手动配置入口 |
|---|---|
| Visual Studio | View → GitHub Copilot Chat → Agent → 工具按钮 → 加号,填写 Server ID、Type 等字段并 Save |
| JetBrains | Copilot → Open Chat → Agent → Configure your MCP server → Add MCP Tools,编辑 mcp.json |
| Xcode | Copilot 应用 Settings → MCP → Edit Config;也可从 Editor 菜单进入 Copilot 设置 |
| Eclipse | Copilot → Edit preferences → GitHub Copilot → MCP,在 Server Configurations 中填写;也可从 Chat 的 Configure Tools... 进入 |
Visual Studio 需要 17.14+;Eclipse 的该专题要求 2024-09+。JetBrains、Xcode、Eclipse 也提供 Registry 浏览安装入口,见注册表。
远程 GitHub OAuth 示例
JetBrains、Xcode、Eclipse 的官方示例使用:
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
}
}
}保存后接受 MCP 服务器发起的 GitHub 认证提示,并在浏览器完成账号授权。Eclipse 还需点击 Apply。
Visual Studio 的配置对话框选择 HTTP/SSE,填写相同 URL;保存后在配置上方点击 Auth 完成 OAuth。不要仅靠已有 IDE 登录判断 MCP 已得到所需 scope。
PAT 请求头格式
GitHub 的这四种 IDE 安装专题均给出 requestInit.headers 形式:
{
"servers": {
"github": {
"url": "https://api.githubcopilot.com/mcp/",
"requestInit": {
"headers": {
"Authorization": "Bearer YOUR_GITHUB_PAT"
}
}
}
}
}YOUR_GITHUB_PAT 是占位符。实际令牌受 scope 和企业策略限制,不应提交到共享仓库。VS Code 的示例使用另一种 headers 位置,不能跨客户端直接照搬。
本地进程
JetBrains、Xcode、Eclipse 教程以 memory server 展示命令型配置:
{
"servers": {
"memory": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-memory"]
}
}
}这需要环境能运行示例中的 npx 和服务器依赖。Visual Studio 的本地入口选择 stdio,填命令、参数与必要环境变量;不要把远程 URL 填进启动命令字段。
保存配置后进入 Agent 的工具选择器,确认服务器工具可见,再发起测试任务。服务不能启动时检查客户端输出日志和本地运行环境。