MCP Integration
ARES integrates with Model Context Protocol servers, allowing agents to use external tools as first-class capabilities.
Feature Flag
[dependencies]
ares-server = { version = "0.7", features = ["mcp"] }
MCP is included in the default feature set.
Configuration
MCP servers are configured via .toon files in your config directory. Each server gets its own TOON configuration.
How It Works
- ARES discovers MCP server configs from the config directory
McpRegistry::from_dir()loads and connects to configured servers- Each server provides an
McpClientfor tool invocation - Agents access MCP tools through the registry
Architecture
Agent Request → McpRegistry → get_client("eruka") → McpClient → MCP Server
↓
Agent Response ← Tool Result ←────────────────────────────────────────┘
Library Usage
#![allow(unused)] fn main() { use ares::mcp::McpRegistry; // Load MCP servers from config directory let registry = McpRegistry::from_dir("config/mcp")?; // List connected servers let names = registry.client_names(); // Get a specific client if let Some(client) = registry.get_client("eruka") { // Use the client to call MCP tools } // Convenience method for Eruka specifically if let Some(eruka) = registry.eruka() { // Direct access to Eruka MCP client } }
Per-Agent MCP Access
Agents can be configured with specific MCP server access via TOON configuration:
[agent.researcher]
mcp_servers = ["eruka", "search"]