What it is
The mcp-integration skill is part of the plugin-dev plugin. It activates when a user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context Protocol" or "connect external service". It also activates when the user mentions "${CLAUDE_PLUGIN_ROOT} with MCP" or discusses MCP server types (SSE, stdio, HTTP, WebSocket). Its purpose is to guide you in integrating MCP servers into Claude Code plugins, exposing external service capabilities as structured tools. A single service can provide 10+ related tools. Servers can handle OAuth and complex authentication, and they can be bundled with a plugin for automatic setup.
The skill describes two ways to bundle MCP servers. The first is a dedicated .mcp.json at the plugin root, which is recommended for clear separation and for multiple servers. The second is an inline mcpServers field in plugin.json, which suits simple single-server plugins. It covers four server types:
- stdio: a local child process communicating via stdin/stdout. Best for local tools, custom servers and NPM-packaged servers.
- SSE: hosted servers with automatic OAuth, where the user is prompted on first use and tokens are managed by Claude Code.
- HTTP: REST-based servers with token headers.
- WebSocket (ws): real-time, bidirectional, low-latency communication.
All configurations support environment variable expansion. This includes ${CLAUDE_PLUGIN_ROOT} for portable paths and variables taken from the user's shell. Tools are automatically prefixed using the format mcp__plugin_<plugin-name>_<server-name>__<tool-name>, and they can be pre-allowed in command frontmatter via allowed-tools. Specific tools are preferred over wildcards for security. On the lifecycle side:
- Servers start when the plugin enables.
- Tools are discovered and registered automatically.
- Configuration changes require a restart.
- The /mcp command lists all servers, including plugin-provided ones.
The skill also presents three integration patterns: a simple tool wrapper in commands, autonomous agents, and multi-server plugins. Its security guidance is to:
- use HTTPS/WSS;
- keep tokens in environment variables;
- never hardcode or commit tokens;
- scope permissions narrowly.
Further sections cover error handling for connection, tool-call and configuration errors, and performance (lazy loading and batching). It also includes a local testing procedure, a validation checklist, debugging with claude --debug, and a nine-step implementation workflow. Reference files are included on server types, authentication and tool usage, along with example configurations for stdio, SSE and HTTP servers.
Who it's for
- Claude Code plugin developers who want to connect external services, databases, APIs or file systems via MCP
- Developers bundling MCP servers with plugins for automatic setup
- Plugin authors deciding between stdio, SSE, HTTP and WebSocket MCP server types
- Developers handling OAuth or token-based authentication for MCP servers in plugins
Requirements
Requirements
- Claude Code with a plugin to add MCP configuration to
- An MCP server: a local command/process (stdio) or a reachable URL (SSE/HTTP/ws)
- Any environment variables referenced by the configuration, set in the user's shell (e.g. API tokens, database URLs)
هاد السكيل بيساعدك تربط سيرفرات MCP بإضافات Claude Code، مشان الخدمات والـAPIs الخارجية تصير متاحة كأدوات. بيشرحلك كيف تعمل الإعدادات، وشو أنواع السيرفرات، وكيف تتعامل مع المصادقة والأمان، وكيف تختبر وتعمل ديبَغ.
Examples
Dedicated .mcp.json at plugin root
json{
"database-tools": {
"command": "${CLAUDE_PLUGIN_ROOT}/servers/db-server",
"args": ["--config", "${CLAUDE_PLUGIN_ROOT}/config.json"],
"env": {
"DB_URL": "${DB_URL}"
}
}
}What it does: This is the recommended method: a separate .mcp.json defining a stdio server. It uses ${CLAUDE_PLUGIN_ROOT} for portable paths and passes a user environment variable to the server.
Pre-allowing specific MCP tools in command frontmatter
markdown---
allowed-tools: [
"mcp__plugin_asana_asana__asana_create_task",
"mcp__plugin_asana_asana__asana_search_tasks"
]
---What it does: This lists specific prefixed MCP tool names a command may use. Naming individual tools is preferred over wildcards for security.
Multi-server plugin configuration
json{
"github": {
"type": "sse",
"url": "https://mcp.github.com/sse"
},
"jira": {
"type": "sse",
"url": "https://mcp.jira.com/sse"
}
}What it does: This integrates multiple hosted SSE servers in one plugin, for workflows that span multiple services.
Enable debug logging
bashclaude --debugWhat it does: Run this to see MCP server connection attempts, tool discovery logs, authentication flows and tool call errors.