hanzo-mcp-types 0.6.74

MCP (Model Context Protocol) type definitions for Hanzo AI agents
Documentation
  • Coverage
  • 100%
    1 out of 1 items documented0 out of 0 items with examples
  • Size
  • Source code size: 240.58 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 9.25 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 32s Average build duration of successful builds.
  • all releases: 39s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • zeekay

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.