Skip to main content

Crate traitclaw_mcp

Crate traitclaw_mcp 

Source
Expand description

MCP (Model Context Protocol) client for the TraitClaw AI agent framework.

Connects to MCP servers over stdio or SSE transport, discovers tools via tools/list, and routes tool calls via tools/call. MCP tools implement ErasedTool so they work seamlessly alongside native tools.

§Quick Start

use traitclaw_mcp::McpServer;

let server = McpServer::stdio("npx", &["@modelcontextprotocol/server-filesystem"]).await?;
let tools = server.tools(); // Vec<Arc<dyn ErasedTool>>

Modules§

prelude
Prelude re-exports for convenient use.

Structs§

McpServer
A connection to an MCP server process.
McpTool
A tool discovered from an MCP server.
McpToolRegistry
A ToolRegistry backed by an MCP server connection.
MultiServerMcpRegistry
A ToolRegistry that aggregates tools from multiple MCP servers.
MultiServerMcpRegistryBuilder
Builder for MultiServerMcpRegistry.