MCP Client
RadarOS includes a built-in MCP client that lets your agents connect to any Model Context Protocol server and use its tools natively — no glue code required.MCP is an open protocol that standardizes how LLM applications integrate with external tools, resources, and prompts. RadarOS acts as an MCP client, consuming tools from external MCP servers.
Installation
The MCP SDK is an optional peer dependency:Quick Start
Transports
stdio
Spawns the MCP server as a child process and communicates via stdin/stdout. Best for local MCP servers.The command to spawn (e.g.
"npx", "node", "python").Arguments for the command.
Environment variables passed to the spawned process.
HTTP (Streamable HTTP)
Connects to a remote MCP server over HTTP. Falls back to SSE transport if Streamable HTTP is not available.The MCP server URL.
Custom HTTP headers (e.g. for authentication).
SSE (Server-Sent Events)
For MCP servers that use separate/sse and /messages endpoints. The client opens a persistent SSE stream for receiving responses and sends JSON-RPC requests via POST. Use this when your server implements the async SSE pattern.
The SSE endpoint URL. The client reads this stream and discovers the POST endpoint for messages automatically.
Custom HTTP headers sent on both the SSE connection and POST requests.
Mixing MCP and Local Tools
MCP tools are returned as standardToolDef[] and can be combined with local tools:
Multiple MCP Servers
Connect to multiple servers simultaneously. Tool names are namespaced as{serverName}__{toolName} to avoid collisions:
Handling Large Tool Results
MCP servers often return bulk data (e.g. all outstanding invoices, full record sets). A single tool result can be 200KB+, which translates to 50K+ prompt tokens on the next LLM roundtrip. UsetoolResultLimit to automatically truncate or summarize oversized results before they reach the main model:
toolResultLimit with toolRouter — the router selects which tools to call, and the result limit controls how much data comes back. Together they can reduce prompt tokens by 95%+.
See Tool Result Limits for full configuration details.
Dynamic Tools with setTools()
When MCP servers are connected or disconnected at runtime, use agent.setTools() to hot-swap the tool set without recreating the agent:
MCPManager (Multi-Server Lifecycle)
For managing multiple MCP servers at runtime — adding, connecting, disconnecting, and collecting tools — useMCPManager from @radaros/transport:
| Method | Description |
|---|---|
add(config, id?) | Register a server. Returns summary. |
connect(id) | Connect and discover tools. |
disconnect(id) | Disconnect a server. |
remove(id) | Remove a server entirely. |
getAllTools() | Merged ToolDef[] from all connected servers. |
getTools(id) | Tools from a single server. |
list() | All server summaries (id, status, toolCount). |
has(id) | Check if a server is registered. |
closeAll() | Disconnect all servers. |
API Reference
MCPToolProvider
A unique name for this MCP server connection. Used to namespace tool names.
The transport protocol to use.
| Method | Description |
|---|---|
connect() | Connect to the MCP server and discover tools. |
getTools() | Returns ToolDef[] — all discovered tools. |
refresh() | Re-discover tools from the server. |
close() | Disconnect from the server and clean up. |
Popular MCP Servers
| Server | Install |
|---|---|
| GitHub | npx -y @modelcontextprotocol/server-github |
| Filesystem | npx -y @modelcontextprotocol/server-filesystem |
| PostgreSQL | npx -y @modelcontextprotocol/server-postgres |
| Brave Search | npx -y @modelcontextprotocol/server-brave-search |
| Slack | npx -y @modelcontextprotocol/server-slack |