| title | VS Code MCP Server Configuration | ||||
|---|---|---|---|---|---|
| description | Configuration guide for GitHub MCP server integration with VS Code Copilot | ||||
| author | Microsoft | ||||
| ms.date | 2026-07-08 | ||||
| ms.topic | reference | ||||
| keywords |
|
||||
| estimated_reading_time | 3 |
Note: MCP servers are not enabled by default. The available server configurations are stored in
mcp.json.sample. To enable them, either renamemcp.json.sampletomcp.json, or create a newmcp.jsonand copy across only the servers you need.
This workspace uses the GitHub MCP server for enhanced Copilot capabilities.
The MCP server configuration is provided in .vscode/mcp.json.sample.
Note: If you want to use the recommended GitHub MCP server setup, run
npx @modelcontextprotocol/server-githuband update your.vscode/mcp.jsonaccordingly. See the GitHub MCP Server Documentation for details.
- Uses VS Code's built-in GitHub authentication
- No manual token management required
- Managed via: VS Code → Accounts menu → Manage Trusted MCP Servers
- Required for GitHub Enterprise Server
- Set environment variable:
GITHUB_PERSONAL_ACCESS_TOKEN - Generate at: https://github.com/settings/personal-access-tokens/new
For GitHub Enterprise Server:
-
Update
.vscode/mcp.jsonwith your enterprise URL:{ "servers": { "github": { "url": "https://your-github-enterprise.com/mcp" } } } -
Set your PAT as an environment variable:
# PowerShell $env:GITHUB_PERSONAL_ACCESS_TOKEN = "your_token_here"
# Bash/Linux/macOS export GITHUB_PERSONAL_ACCESS_TOKEN="your_token_here"
If using PAT authentication, your token needs:
repo- Full control of private repositoriesread:org- Read org and team membershipuser- Read user profile data
Once configured, the MCP server provides:
- Repository operations (file management, search)
- Branch management
- Issue management
- Pull request workflows
- Code search capabilities
- Never commit tokens to version control
- Use OAuth when possible for automatic credential management
- Rotate PATs regularly
- Use fine-grained tokens with minimal required permissions
Server not connecting:
- Check VS Code version (1.101+ recommended for OAuth)
- Verify GitHub authentication via Accounts menu
- For PAT: Verify
GITHUB_PERSONAL_ACCESS_TOKENis set
Permission errors:
- Ensure token has required scopes
- Check token hasn't expired
- Verify repository access permissions
🤖 Crafted with precision by ✨Copilot following brilliant human instruction, then carefully refined by our team of discerning human reviewers.