MCP — Model Context Protocol
Connect external tools and data sources via the Model Context Protocol. Clew Code supports stdio, SSE, and DirectConnect transports.
Overview
MCP (Model Context Protocol) is an open standard for connecting AI agents with external tools and data sources. Clew Code implements the full MCP specification as both a client and server.
Transport Types
| Transport | Description |
|---|---|
| stdio | Local subprocess — spawns an MCP server as a child process and communicates via stdin/stdout |
| SSE | Remote servers with optional OAuth authentication via Server-Sent Events |
| DirectConnect | In-process plugin servers — runs MCP servers as plugins within the same process |
Configuration
MCP servers are configured in .mcp.json at the project root:
{
"mcpServers": {
"filesystem": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-filesystem", "."]
},
"github": {
"command": "npx",
"args": ["-y", "@modelcontextprotocol/server-github"],
"env": {
"GITHUB_TOKEN": "ghp_..."
}
},
"remote-api": {
"url": "https://my-mcp-server.example.com/sse",
"auth": {
"type": "oauth2"
}
}
}
}
MCP Commands
❯ /mcp list # list connected MCP servers and their tools
❯ /mcp add # add a new MCP server configuration
❯ /mcp remove <id> # remove an MCP server
CLI MCP Tools
The built-in MCP tools allow the AI to interact with connected servers:
| Tool | Description |
|---|---|
| ListMcpResourcesTool | List available resources from connected MCP servers |
| ReadMcpResourceTool | Read a specific resource from an MCP server |
Example MCP Servers
- Filesystem — safe file access with path restrictions
- GitHub — repository management, PRs, issues
- Playwright — browser automation
- Slack — workspace integration
- PostgreSQL — database schema exploration and queries
- Sentry — error tracking and issue management
Browse the official MCP server repository for more.