C

Comprehensive Mcp Integration

Production-ready skill that handles skill, should, used, user. Includes structured workflows, validation checks, and reusable patterns for development.

SkillClipticsdevelopmentv1.0.0MIT
0 views0 copies

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

ComponentRoleLocation
MCP ClientClaude Code's built-in connectorInside Claude Code
MCP ServerProvides tools, resources, promptsExternal process
TransportCommunication channelstdio, SSE, HTTP
ToolCallable function with schemaDefined in server
ResourceRead-only data endpointDefined 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

ParameterTypeDefaultDescription
commandstringCommand to start the MCP server
argsarray[]Arguments passed to the command
envobject{}Environment variables for the server process
urlstringURL for remote SSE/HTTP servers
headersobject{}HTTP headers for remote servers
timeoutnumber30000Connection timeout in milliseconds
restart_on_failurebooleantrueAuto-restart crashed servers

Best Practices

  1. 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.

  2. 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.

  3. Test servers independently before integrating — run claude mcp test <server> to verify each server works before relying on it in complex workflows.

  4. 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.

  5. 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.

Community

Reviews

Write a review

No reviews yet. Be the first to review this template!

Similar Templates