Setting up MCP in a Plugin
MCP servers are configured via a .mcp.json file (dotfile) at the plugin root — not inside .claude-plugin/, and not mcp.json without the dot.
File location
plugins/<name>/
├── .claude-plugin/
│ └── plugin.json
├── .mcp.json ← here
├── commands/
└── ...Schema
{
"<server-name>": {
"type": "http",
"url": "https://<endpoint>/mcp/",
"headers": {
"Authorization": "Bearer ${ENV_VAR}"
}
}
}- Top-level keys are the server names (used as identifiers in Claude Code)
type: transport type — use"http"for HTTP/SSE endpointsurl: the MCP server endpoint URLheaders: optional; use${VAR}syntax for environment variable interpolation (e.g.,${GITHUB_TOKEN})
Example (github plugin)
{
"github": {
"type": "http",
"url": "https://githubcopilot-api.gsmlg.dev/mcp/",
"headers": {
"Authorization": "Bearer ${GITHUB_TOKEN}"
}
}
}Notes
- Multiple servers can be registered in the same
.mcp.jsonby adding more top-level keys headersis only needed for authenticated endpointsplugin.jsondoes not carry MCP config — keep them separatelspServersinplugin.jsonis for LSP (code intelligence), not MCP