Microsoft
Tambahkan server MCP ke VS Code (GitHub Copilot)
VS Code membaca .vscode/mcp.json di workspace, mcp.json di profil pengguna, atau file .mcp.json portabel yang lebih baru.
- macOS
User profile mcp.json (open via 'MCP: Open User Configuration'); portable: ~/.copilot/mcp-config.json- Windows
User profile mcp.json (open via 'MCP: Open User Configuration'); portable: ~/.copilot/mcp-config.json- Linux
User profile mcp.json (open via 'MCP: Open User Configuration'); portable: ~/.copilot/mcp-config.json- File proyek
.vscode/mcp.json (key 'servers') or portable .mcp.json (key 'mcpServers')- Kunci tingkat atas
servers- Format
- json
- OAuth untuk server jarak jauh
- Ya
Contoh config
Contoh ini menambahkan server hosted GitHub dan Playwright sebagai server lokal, sesuai format yang diharapkan klien ini.
{
"servers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/"
},
"playwright": {
"type": "stdio",
"command": "npx",
"args": [
"@playwright/mcp@latest"
]
}
}
}
code --add-mcp '{"name":"github","type":"http","url":"https://api.githubcopilot.com/mcp/"}'
code --add-mcp '{"name":"playwright","command":"npx","args":["@playwright/mcp@latest"]}'
Catatan dan keunikan
- .vscode/mcp.json menggunakan key servers; file .mcp.json portabel dan ~/.copilot/mcp-config.json menggunakan mcpServers.
- Array inputs di tingkat teratas akan meminta Anda memasukkan rahasia, sehingga kunci tidak perlu disimpan di file.
- Alur Add server terpandu kini menandai .vscode/mcp.json dan file profil pengguna sebagai usang, dan menyarankan penggunaan file portabel. Keduanya masih berfungsi.
- VS Code juga menemukan server yang sudah disiapkan untuk Claude Desktop, Copilot CLI, Cursor, dan Windsurf.
- code --add-mcp menambahkan server dari string JSON.
Buat config VS Code (GitHub Copilot) →
Klien lain
Claude DesktopClaude CodeCursorWindsurf / Devin DesktopZedOpenAI Codex CLIGemini CLIChatGPTOpenClawClineContinueJetBrains AI Assistant