Comprehensive Mcp Integration
Production-ready skill that handles skill, should, used, user. Includes structured workflows, validation checks, and reusable patterns for development.
MCP Integration for Plugins Skill
A Claude Code skill for integrating MCP (Model Context Protocol) servers into Claude Code plugins — covering server discovery, tool registration, resource access, and multi-server orchestration.
When to Use This Skill
Choose this skill when:
- Connecting Claude Code to external MCP servers
- Configuring multiple MCP tool providers
- Building plugins that consume MCP resources
- Setting up MCP server discovery and connection
- Orchestrating tools across multiple MCP servers
- Debugging MCP connection and communication issues
Consider alternatives when:
- You need to build an MCP server (use the MCP builder skill)
- You need a REST API integration (use HTTP directly)
- You need to modify Claude Code internals (not possible)
Quick Start
// .claude/settings.json - Configure MCP servers { "mcpServers": { "database": { "command": "node", "args": ["./mcp-servers/database-server.js"], "env": { "DATABASE_URL": "postgresql://localhost:5432/mydb" } }, "github": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-github"], "env": { "GITHUB_TOKEN": "ghp_..." } }, "filesystem": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/allowed/dir"] } } }
# Add an MCP server to Claude Code claude mcp add database -- node ./mcp-servers/database-server.js # List configured servers claude mcp list # Test a server connection claude mcp test database
Core Concepts
MCP Architecture
| Component | Role | Location |
|---|---|---|
| MCP Client | Claude Code's built-in connector | Inside Claude Code |
| MCP Server | Provides tools, resources, prompts | External process |
| Transport | Communication channel | stdio, SSE, HTTP |
| Tool | Callable function with schema | Defined in server |
| Resource | Read-only data endpoint | Defined in server |
Server Configuration Patterns
// Local server (stdio transport) { "my-server": { "command": "node", "args": ["./server.js"], "env": { "API_KEY": "..." } } } // Remote server (SSE transport) { "remote-server": { "url": "https://mcp.example.com/sse", "headers": { "Authorization": "Bearer token" } } } // Python server { "python-server": { "command": "python", "args": ["-m", "my_mcp_server"], "env": { "CONFIG_PATH": "./config.json" } } }
Multi-Server Orchestration
// Configure multiple specialized servers { "mcpServers": { "database": { "command": "node", "args": ["./servers/db-server.js"], "env": { "DB_URL": "..." } }, "monitoring": { "command": "node", "args": ["./servers/monitoring-server.js"], "env": { "DATADOG_API_KEY": "..." } }, "docs": { "command": "npx", "args": ["-y", "@modelcontextprotocol/server-filesystem", "./docs"] } } }
Configuration
| Parameter | Type | Default | Description |
|---|---|---|---|
command | string | — | Command to start the MCP server |
args | array | [] | Arguments passed to the command |
env | object | {} | Environment variables for the server process |
url | string | — | URL for remote SSE/HTTP servers |
headers | object | {} | HTTP headers for remote servers |
timeout | number | 30000 | Connection timeout in milliseconds |
restart_on_failure | boolean | true | Auto-restart crashed servers |
Best Practices
-
Use environment variables for secrets, not inline config — store API keys and tokens in environment variables referenced by the MCP config; never commit secrets in
.claude/settings.json. -
Keep servers focused on a single domain — a database server provides database tools, a monitoring server provides monitoring tools; don't bundle unrelated tools in one server.
-
Test servers independently before integrating — run
claude mcp test <server>to verify each server works before relying on it in complex workflows. -
Use stdio transport for local servers — stdio is the simplest and most reliable transport for servers running on the same machine; use SSE or HTTP only for remote servers.
-
Configure restart-on-failure for critical servers — MCP servers can crash due to bugs or resource exhaustion; auto-restart ensures tools remain available during long sessions.
Common Issues
Server fails to start — Check that the command is installed and accessible in your PATH. Run the command manually to see error output. Verify environment variables are set correctly.
Tools from different servers have name conflicts — Each MCP server should use unique tool names. Prefix tools with the server's domain: db_query, monitor_metrics, docs_search.
Remote server connection drops — SSE connections can timeout due to proxies or firewalls. Implement heartbeat/keepalive in your server and configure proxy timeouts appropriately.
Reviews
No reviews yet. Be the first to review this template!
Similar Templates
Full-Stack Code Reviewer
Comprehensive code review skill that checks for security vulnerabilities, performance issues, accessibility, and best practices across frontend and backend code.
Test Suite Generator
Generates comprehensive test suites with unit tests, integration tests, and edge cases. Supports Jest, Vitest, Pytest, and Go testing.
Pro Architecture Workspace
Battle-tested skill for architectural, decision, making, framework. Includes structured workflows, validation checks, and reusable patterns for development.