Kaynak: Claude Code resmi dokümantasyonu — https://code.claude.com/docs/en/mcp
.mcp.json — proje köküne koy, commit et
{
"mcpServers": {
"github": {
"type": "http",
"url": "https://api.githubcopilot.com/mcp/",
"headers": { "Authorization": "Bearer ${GITHUB_PAT}" }
},
"database": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@bytebase/dbhub"],
"env": { "DB_CONNECTION": "${DB_URL:-postgresql://user:pass@localhost/db}" }
},
"filesystem": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "/izin/verilen/dizin"]
},
"slack": {
"type": "http",
"url": "https://mcp.slack.com/mcp",
"oauth": { "scopes": "channels:read chat:write search:read" }
},
"events": {
"type": "ws",
"url": "wss://mcp.example.com/socket",
"headers": { "Authorization": "Bearer ${WS_TOKEN}" }
}
}
}
Ortam değişkeni sözdizimi
${VAR} zorunlu
${VAR:-varsayilan} yoksa varsayılan
${CLAUDE_PLUGIN_ROOT} eklenti kökü
Dinamik başlık (Kerberos, SSO, kısa ömürlü token)
{
"internal-api": {
"type": "http",
"url": "https://mcp.internal.example.com",
"headersHelper": "/opt/bin/get-mcp-auth-headers.sh"
}
}