Help us improve
Share bugs, ideas, or general feedback.
Expert at integrating MCP servers into Claude Code plugins. Auto-invokes when configuring MCP servers (stdio/SSE/HTTP/WebSocket), writing .mcp.json files, or adding external tool integrations.
npx claudepluginhub c0ntr0lledcha0s/claude-code-plugin-automations --plugin claude-component-builderHow this skill is triggered — by the user, by Claude, or both
Slash command
/claude-component-builder:building-mcp-serversThis skill is limited to the following tools:
The summary Claude sees in its skill listing — used to decide when to auto-load this skill
You are an expert at integrating Model Context Protocol (MCP) servers into Claude Code plugins. MCP enables plugins to access external services, APIs, and tools through a standardized protocol.
Configures MCP servers in Claude Code plugins via .mcp.json or plugin.json, supports stdio/SSE/HTTP/WebSocket, env vars, tool naming, OAuth/token auth, security, and testing.
Guides integration of Model Context Protocol (MCP) servers into Claude Code plugins via .mcp.json or plugin.json. Covers stdio, SSE, and HTTP server types.
Guides integration of Model Context Protocol (MCP) servers into Claude Code plugins using .mcp.json or inline plugin.json configs, covering stdio, SSE, HTTP, WebSocket types for external services.
Share bugs, ideas, or general feedback.
You are an expert at integrating Model Context Protocol (MCP) servers into Claude Code plugins. MCP enables plugins to access external services, APIs, and tools through a standardized protocol.
Use MCP servers when:
Use other components instead when:
Best for: Local processes, custom servers, CLI tools
{
"mcpServers": {
"my-local-server": {
"type": "stdio",
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/servers/my-server.js"],
"env": {
"API_KEY": "${MY_API_KEY}"
}
}
}
}
Use cases:
Best for: Cloud services with OAuth, hosted MCP endpoints
{
"mcpServers": {
"cloud-service": {
"type": "sse",
"url": "https://api.example.com/mcp/sse",
"headers": {
"Authorization": "Bearer ${CLOUD_API_TOKEN}"
}
}
}
}
Use cases:
Best for: REST APIs, stateless services
{
"mcpServers": {
"rest-api": {
"type": "http",
"url": "https://api.example.com/mcp",
"headers": {
"X-API-Key": "${REST_API_KEY}"
}
}
}
}
Use cases:
Best for: Real-time bidirectional communication
{
"mcpServers": {
"realtime-service": {
"type": "websocket",
"url": "wss://api.example.com/mcp/ws",
"headers": {
"Authorization": "Bearer ${WS_TOKEN}"
}
}
}
}
Use cases:
For plugins with multiple MCP servers:
plugin-name/
├── .mcp.json # MCP server configurations
├── .claude-plugin/
│ └── plugin.json
└── ...
.mcp.json format:
{
"mcpServers": {
"server-one": { ... },
"server-two": { ... }
}
}
For single-server simplicity:
{
"name": "my-plugin",
"version": "1.0.0",
"mcpServers": {
"my-server": {
"type": "stdio",
"command": "python",
"args": ["${CLAUDE_PLUGIN_ROOT}/server.py"]
}
}
}
MCP tools are automatically prefixed with the server name:
mcp__<plugin-name>_<server-name>__<tool-name>
Example:
database-toolspostgresquerymcp__database-tools_postgres__query// ❌ BAD - hardcoded secret
{
"headers": {
"Authorization": "Bearer sk-12345..."
}
}
// ✅ GOOD - environment variable
{
"headers": {
"Authorization": "Bearer ${MY_API_KEY}"
}
}
// ❌ BAD - insecure
{ "url": "http://api.example.com/mcp" }
// ✅ GOOD - secure
{ "url": "https://api.example.com/mcp" }
In your plugin's README:
## Required Environment Variables
| Variable | Description |
|----------|-------------|
| `MY_API_KEY` | API key for the service |
| `DATABASE_URL` | Connection string |
In plugin.json, specify which MCP tools should be auto-allowed:
{
"mcpServers": {
"my-server": {
"type": "stdio",
"command": "...",
"allowedTools": ["query", "list"] // Only these tools auto-allowed
}
}
}
Always use the portable path variable:
{
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/servers/main.js"]
}
Ask:
Choose the appropriate configuration method (.mcp.json or inline).
List all required secrets and how to obtain them.
Update plugin.json to reference the MCP configuration:
{
"name": "my-plugin",
"mcp": "./.mcp.json"
}
# Debug MCP connections
claude --debug
# Verify server starts
claude mcp list
This skill includes a validation script:
Usage:
python3 {baseDir}/scripts/validate-mcp.py <mcp-config-file>
What It Checks:
{
"mcpServers": {
"database": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-postgres"],
"env": {
"DATABASE_URL": "${DATABASE_URL}"
}
}
}
}
{
"mcpServers": {
"cloud-api": {
"type": "http",
"url": "https://api.service.com/v1/mcp",
"headers": {
"Authorization": "Bearer ${SERVICE_API_KEY}",
"Content-Type": "application/json"
}
}
}
}
{
"mcpServers": {
"dev-server": {
"type": "stdio",
"command": "python",
"args": ["${CLAUDE_PLUGIN_ROOT}/servers/dev_server.py"],
"env": {
"DEBUG": "true"
}
}
}
}
# Enable debug mode
claude --debug
# Check MCP server status
claude mcp status
# View server logs
claude mcp logs <server-name>
| Issue | Cause | Solution |
|---|---|---|
| Server not starting | Missing dependencies | Check command/args paths |
| Auth failures | Wrong env variable | Verify ${VAR} is set |
| Connection timeout | Network/firewall | Check URL accessibility |
| Tool not found | Wrong naming | Check tool name matches |
{baseDir}/templates/mcp-stdio-template.json - Stdio server template{baseDir}/templates/mcp-http-template.json - HTTP server template{baseDir}/templates/mcp-config-template.json - Full .mcp.json template{baseDir}/references/mcp-security-guide.md - Security best practices{baseDir}/references/mcp-server-types.md - Detailed server type documentationWhen the user asks to add MCP integration:
Be proactive in: