hanzo-mcp-types

Crates.iohanzo-mcp-types
lib.rshanzo-mcp-types
version0.6.0
created_at2026-01-25 20:32:39.422736+00
updated_at2026-01-25 20:32:39.422736+00
descriptionMCP (Model Context Protocol) type definitions for Hanzo AI agents
homepagehttps://github.com/hanzoai/dev/tree/main/mcp-types
repositoryhttps://github.com/hanzoai/dev
max_upload_size
id2069485
size240,581
z (zeekay)

documentation

https://docs.rs/hanzo-mcp-types

README

hanzo-mcp-types

Crates.io Documentation License: MIT

Rust type definitions for the Model Context Protocol (MCP).

Overview

This crate provides strongly-typed Rust definitions for all MCP protocol messages, enabling type-safe communication between AI agents and tool servers.

Installation

[dependencies]
hanzo-mcp-types = "0.6"

Usage

use mcp_types::{
    CallToolRequest, CallToolResult, ListToolsRequest, ListToolsResult,
    Tool, ToolInfo, Content, TextContent,
};

// Define a tool
let tool = Tool {
    name: "read_file".to_string(),
    description: Some("Read contents of a file".to_string()),
    input_schema: serde_json::json!({
        "type": "object",
        "properties": {
            "path": {"type": "string"}
        },
        "required": ["path"]
    }),
};

// Create a tool call request
let request = CallToolRequest {
    name: "read_file".to_string(),
    arguments: Some(serde_json::json!({"path": "src/main.rs"})),
};

Key Types

Type Description
Tool Tool definition with name, description, and JSON schema
CallToolRequest Request to execute a tool
CallToolResult Result from tool execution
ListToolsRequest Request to list available tools
ListToolsResult List of available tools
Content Tool output content (text, image, resource)
Resource External resource reference
Prompt Prompt template definition

Protocol Version

This crate implements MCP specification version 2025-06-18.

Related Crates

License

MIT License - Copyright 2025 Hanzo AI Inc.

Commit count: 7139

cargo fmt