Repository navigation
How do I add an MCP server to GitHub Copilot (VS Code and Copilot CLI)? #4
Unanswered
nemesisLLC
asked this question in
Q&A
Replies: 1 comment
|
In VS Code (GitHub Copilot), MCP servers are configured in:
In {
"servers": {
"my-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/path"]
}
}
} |
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Short answer: VS Code's Copilot chat and Copilot CLI now share one file,
~/.copilot/mcp-config.json(or the folder inCOPILOT_HOMEif you set it). The CLI can write it for you:Inside a Copilot CLI session,
/mcp addopens a form instead.The file by hand
{ "mcpServers": { "playwright": { "type": "stdio", "command": "npx", "args": ["-y", "@playwright/mcp@latest"], "tools": ["*"] }, "context7": { "type": "http", "url": "https://mcp.context7.com/mcp", "headers": { "CONTEXT7_API_KEY": "${CONTEXT7_API_KEY}" }, "tools": ["*"] } } }toolslimits which of a server's tools Copilot may call;["*"]means all.Project servers
The project file is
.mcp.jsonat the repo root, the same file Claude Code uses, so one file serves both agents. Copilot CLI also reads.github/mcp.json. Copilot only loads a project's file after you've trusted the folder.The old
.vscode/mcp.jsonThat format (a
serverskey plus aninputslist) is deprecated in VS Code's docs and Copilot CLI doesn't read it. New setups should use the files above.Full guide: https://calyban.com/blog/mcp-servers-cursor-copilot-gemini-claude-desktop
All reactions