Configuration
MCP servers are configured per-agent. Addmcp_servers to any agent definition:
If one MCP server fails to start, other servers continue normally. Built-in skills are always available regardless of MCP server status.
How It Works
- Agent container reads
MCP_SERVERSfrom environment (set by the runtime). MCPClientlaunches each server subprocess via stdio transport.- MCP protocol handshake discovers available tools and their schemas.
- Tools are registered in
SkillRegistrywith OpenAI function-calling format. - LLM tool calls route through
MCPClient.call_tool()to the correct server. - If an MCP tool’s name collides with a built-in skill or another MCP server’s tool, the colliding tool is registered as
mcp_{server_name}_{tool_name}at agent boot. Built-in skills always keep the original name.
Known limitations
- stdio only — HTTP and SSE transports not wired.
- Image and binary content silently dropped. Only text blocks from
CallToolResultare forwarded to the agent (concatenated under the"result"key). MCP servers that return images won’t surface those to the LLM. - 60s per-call timeout.
- Python-only default image — see warning above.
Server Config Options
Example: SQLite (Python)
Example: filesystem (requires custom image)
The@modelcontextprotocol/server-filesystem reference server is npm-based. To use it, build a custom agent image that installs Node.js on top of the default openlegion-agent:latest:
file_tool.