MCP Integration Guide
Advanced Guide ยท 18 min read
โBased on source code analysis
What is MCP?
Model Context Protocol (MCP) is a standardized protocol for connecting Claude Code to external services, tools, and data sources.
7 Transport Types
| Transport | Description | Use Case |
|---|---|---|
stdio | Standard input/output | Local MCP servers |
SSE | Server-Sent Events | HTTP long connection |
HTTP | HTTP request/response | Stateless APIs |
WebSocket | Bidirectional WebSocket | Real-time communication |
SDK | Built-in SDK | Anthropic native integration |
claudeai-proxy | Claude.ai proxy | Cloud MCP bridging |
IDE | IDE integration | VS Code / JetBrains |
7 Configuration Scopes
- local - Project level (
.claude/mcp.json) - project - Repository level (via CLAUDE.md)
- user - User level (
~/.claude/mcp.json) - plugin - Plugin-carried
- builtin - Built-in
- remote - Remote pushed
- managed - Enterprise managed (highest priority)
Configuration Example
{
"mcpServers": {
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "your-token"
}
},
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem"],
"env": {
"ALLOWED_PATHS": "/Users/you/projects"
}
}
}
}
MCP Client Management
Claude Code's MCP client handles:
- Auto-connect and reconnection
- Health checks
- Resource indexing
- Tool discovery and registration
- Permission bridging
Channel Notification
MCP servers can send channel notifications to KAIROS mode:
{
"method": "notifications/claude/channel",
"params": {
"content": "PR #123 needs review",
"meta": { "source": "github" }
}
}
SleepTool detects new messages within 1 second and wakes the agent.
LSP Integration
Claude Code also supports Language Server Protocol:
- File extension-based routing
- Multi-server management
- Diagnostic integration
- Type checking, completions, references
๐ก Pro Tip: MCP tools appear with prefix
mcp__serverName__toolName in the tool list.