hanzo-mcp
Unified Model Context Protocol (MCP) for Hanzo - the canonical Rust MCP implementation for all Hanzo projects.
Overview
hanzo-mcp provides a complete MCP implementation for:
- hanzo-node - AI infrastructure node
- hanzo-dev - Developer CLI tool
- hanzo-engine - LLM inference engine
- Any Rust project needing MCP support
Features
- Client: Connect to MCP servers (HTTP, SSE, Process)
- Server: Build MCP servers with tools (optional feature)
- Multi-Server: Manage multiple servers simultaneously
- Resource Management: List and read server resources
- Tool Discovery: Automatic tool registration
- Concurrency Control: Rate limiting and timeouts
Quick Start
[]
= "0.1" # Client only (default)
= { = "0.1", = ["server"] } # Include server
= { = "0.1", = ["full"] } # Everything
Using McpClient (Recommended)
use ;
let config = McpClientConfig ;
let mut client = new;
client.initialize.await?;
// List tools
let tools = client.list_tools.await;
// Call a tool
let result = client.call_tool.await?;
// List resources
let resources = client.list_resources.await?;
// Read a resource
let content = client.read_resource.await?;
Using Low-Level Methods
use mcp_methods;
let tools = list_tools_via_http.await?;
let result = run_tool_via_http.await?;
Building a Server
use ;
let server = new?;
server.run.await?;
Migration Guide
From hanzo-node's hanzo_mcp
// Before
use mcp_methods;
// After
use mcp_methods; // Same API!
From mistralrs-mcp
// Before
use ;
// After
use ;
Crate Structure
hanzo-mcp (unified)
├── hanzo-mcp-core (types, traits)
├── hanzo-mcp-client (connect to servers)
└── hanzo-mcp-server (be a server) [optional]
License
MIT OR Apache-2.0