Model Context Protocol (MCP) enables Arawn to bridge external tool servers.
MCP allows Arawn to:
- Connect to external tool servers
- Expose their tools to the agent
- Handle tool execution transparently
┌─────────────────────────────────────────────────────────────────┐
│ arawn-mcp │
│ │
│ ┌───────────────────────┐ ┌───────────────────────────────┐ │
│ │ McpManager │ │ McpClient │ │
│ │ │ │ │ │
│ │ servers: HashMap< │ │ transport: StdioTransport │ │
│ │ String, McpClient> │───▶│ capabilities: ServerCaps │ │
│ │ │ │ │ │
│ │ list_tools() ────────▶│ │ list_tools() → Vec<Tool> │ │
│ │ call_tool() ────────▶│ │ call_tool(name, params) │ │
│ └───────────────────────┘ └───────────────────────────────┘ │
│ │
│ ┌───────────────────────────────────────────────────────────┐ │
│ │ McpToolAdapter │ │
│ │ │ │
│ │ Wraps MCP tools as Arawn Tool trait: │ │
│ │ • name() → "mcp__{server}__{tool}" │ │
│ │ • parameters() → JSON Schema from MCP │ │
│ │ • execute() → McpClient.call_tool() │ │
│ └───────────────────────────────────────────────────────────┘ │
└─────────────────────────────────────────────────────────────────┘
[mcp]
enabled = true
[mcp.servers.sqlite]
command = "sqlite-mcp"
args = ["--db", "memory.db"]| Transport | Config | Use Case |
|---|---|---|
| stdio | command, args |
Local CLI tools |
| sse | url |
HTTP Server-Sent Events |
[mcp.servers.sqlite]
command = "sqlite-mcp"
args = ["--db", "/path/to/database.db"]
env = { "DEBUG" = "true" }[mcp.servers.remote]
url = "http://localhost:3000/mcp"
headers = { "Authorization" = "Bearer $env:MCP_TOKEN" }MCP tools are namespaced to avoid collisions:
- Pattern:
mcp__{server_name}__{tool_name} - Example:
mcp__sqlite__queryfor thequerytool fromsqliteserver
When the LLM calls mcp__sqlite__query, Arawn:
- Extracts server name:
sqlite - Extracts tool name:
query - Routes to the correct MCP client
- Executes and returns result
SQLite database access:
[mcp.servers.sqlite]
command = "sqlite-mcp"
args = ["--db", "data.db"]Tools provided:
query— Execute SQL queriesschema— Get table schemasinsert— Insert rows
Enhanced file operations:
[mcp.servers.filesystem]
command = "filesystem-mcp"
args = ["--root", "/allowed/path"]Any MCP-compatible server can be added:
[mcp.servers.my-server]
command = "/path/to/my-mcp-server"
args = ["--config", "config.json"]- Startup — MCP servers started with Arawn
- Discovery — Server capabilities and tools listed
- Registration — Tools added to agent's registry
- Execution — Tools called via MCP protocol
- Shutdown — Servers stopped when Arawn exits
| Error | Behavior |
|---|---|
| Server crash | Reconnect attempt, then disable |
| Tool timeout | Return timeout error to LLM |
| Invalid response | Parse error returned to LLM |
| Connection lost | Attempt reconnection |
Enable MCP debug logging:
RUST_LOG=arawn_mcp=debug arawn startList connected MCP servers:
arawn mcp listTest a specific tool:
arawn mcp call sqlite query '{"sql": "SELECT 1"}'