Overview
MeepaGateway supports the Model Context Protocol (MCP), letting agents call tools hosted by external MCP servers. MCP tools appear alongside built-in tools — the LLM cannot tell the difference. MCP servers are configured per-agent in.mcp.json inside the agent’s home directory (~/.meepagateway/agents/{agent_id}/.mcp.json). This is the same format used by Claude Desktop and Cursor.
MeepaGateway uses the rmcp crate for MCP communication.
Transports
Stdio
The gateway spawns the MCP server as a child process and communicates over stdin/stdout using JSON-RPC 2.0.Streamable HTTP
The gateway connects to an already-running HTTP MCP server.command and url are mutually exclusive — use one or the other per server.
.mcp.json Format
The file follows the standard MCP JSON format:
Fields
Executable to launch for stdio transport. Mutually exclusive with
url.Arguments passed to the spawned command.
HTTP endpoint for streamable HTTP transport. Mutually exclusive with
command.Extra environment variables injected into the spawned process (stdio only).
Set to
true to disable this server without removing it from the file.Examples
Memory server (stdio)
GitHub (stdio)
Multiple servers
Managing MCP Servers
Via CLI
Via Captain Dashboard
Navigate to Agents → → MCP to add, edit, disable, and remove MCP servers through the web UI.Via API
How Tool Bridging Works
At agent startup:McpManagerreads.mcp.jsonand connects to each enabled server- For each server,
list_tools()is called to discover available tools - Each discovered tool is wrapped in
McpToolBridge— an adapter that implements the internalTooltrait - Bridged tools are registered in the agent’s
ToolRegistryalongside built-in tools
- The gateway looks up the tool by name in the registry
McpToolBridge.execute()callscall_tool()on theMcpClient- The result is returned to the LLM as a tool result message
Architecture
| Component | Role |
|---|---|
McpClient | Connects to one MCP server; handles handshake, list_tools, call_tool |
McpManager | Manages multiple McpClient instances per agent |
McpToolBridge | Adapts an MCP tool into the internal Tool trait |
