mcp-integration
此技能指导将MCP服务器连接到Claude Code插件以进行外部服务集成。在配置MCP服务器、设置身份验证或集成外部工具时使用。
📖 中文导读:此技能指导将MCP服务器连接到Claude Code插件以进行外部服务集成。在配置MCP服务器、设置身份验证或集成外部工具时使用。 以下正文为该技能的原始 SKILL.md 内容(英文),上方安装命令可直接使用。
name: mcp-integration description: This skill guides connecting MCP servers to Claude Code plugins for external service integration. Use when configuring MCP servers, setting up authentication, or integrating external tools.
MCP Integration
Overview
Connect Model Context Protocol servers to Claude Code plugins to expose external service capabilities as tools.
Configuration Methods
Dedicated .mcp.json (Recommended)
{
"mcpServers": {
"my-server": {
"type": "stdio",
"command": "node",
"args": ["server.js"],
"env": {
"API_KEY": "${MY_API_KEY}"
}
}
}
}
Inline in plugin.json
{
"name": "my-plugin",
"mcpServers": {
"my-server": { ... }
}
}
Server Types
stdio (Local Process)
{
"type": "stdio",
"command": "npx",
"args": ["-y", "@anthropic/mcp-server"]
}
HTTP (REST API)
{
"type": "http",
"url": "https://api.example.com/mcp",
"headers": {
"Authorization": "Bearer ${API_TOKEN}"
}
}
SSE (Server-Sent Events)
{
"type": "sse",
"url": "https://mcp.example.com/sse",
"headers": {
"X-API-Key": "${API_KEY}"
}
}
WebSocket
{
"type": "websocket",
"url": "wss://mcp.example.com/ws"
}
Environment Variables
Use ${VAR_NAME} for dynamic values:
{
"env": {
"DATABASE_URL": "${DATABASE_URL}",
"API_KEY": "${API_KEY}"
}
}
Plugin Portability
Use ${CLAUDE_PLUGIN_ROOT} for relative paths:
{
"command": "node",
"args": ["${CLAUDE_PLUGIN_ROOT}/server/index.js"]
}
Security Best Practices
- Use HTTPS/WSS - Never use HTTP for remote servers
- Never hardcode tokens - Use environment variables
- Pre-allow specific tools - Avoid wildcards in permissions
- Document required variables - List in README
Testing
# Verify MCP configuration
/mcp
# Check server status
/mcp status
Workflow
- Select server type based on deployment
- Create
.mcp.jsonconfiguration - Use
${CLAUDE_PLUGIN_ROOT}for portability - Document environment variables
- Test locally via
/mcpcommand - Configure tool permissions
- Handle authentication and errors