traitclaw-mcp
MCP (Model Context Protocol) client for TraitClaw — discover and call tools from MCP servers.
Connect to any MCP-compatible tool server over stdio or SSE transport. Discovered tools implement ErasedTool and work seamlessly alongside native TraitClaw tools.
What is MCP?
The Model Context Protocol is an open standard for connecting AI agents to external tools and data sources. MCP servers expose tools (filesystem, databases, APIs, etc.) that AI agents can discover and invoke.
Usage
use *;
use McpServer;
// Connect to an MCP server via stdio
let server = stdio.await?;
// Discover available tools
let tools = server.tools; // &[Arc<McpTool>]
// Register with an agent — MCP tools work like native tools
let mut builder = builder
.provider
.system;
for tool in tools
let agent = builder.build?;
Supported MCP Servers
Any server implementing the MCP specification works. Popular examples:
| Server | Transport | Tools |
|---|---|---|
@modelcontextprotocol/server-filesystem |
stdio | read/write/list files |
@modelcontextprotocol/server-github |
stdio | GitHub API operations |
@modelcontextprotocol/server-postgres |
stdio | PostgreSQL queries |
| Custom servers | stdio/SSE | Any tools you define |
License
Licensed under either of Apache License, Version 2.0 or MIT License at your option.