MCP ExplorerExplorer

Mcp Types

@iqlusionincon a year ago
1 MIT
FreeCommunity
AI Systems
Rust type bindings for the Model Context Protocol (MCP) specification.

Overview

What is Mcp Types

mcp-types is a Rust crate that provides type bindings for the Model Context Protocol (MCP) specification, generated from the protocol’s JSON schema using the typify crate.

Use cases

Use cases for mcp-types include developing LLM applications, creating RPC-based services, and implementing type-safe message handling in Rust.

How to use

To use mcp-types, add mcp-types = "0.1.0" to your Cargo.toml file or run cargo add mcp-types in your crate directory.

Key features

Key features include complete type definitions for the MCP protocol, Serde serialization/deserialization support, automatic generation from the latest MCP schema, type-safe interaction with MCP messages, and schema validation test coverage.

Where to use

mcp-types can be used in applications that require communication between LLM clients and servers using the Model Context Protocol.

Content

mcp-types

Rust type bindings for the Model Context Protocol (MCP) specification, automatically generated from the protocol’s JSON schema using the typify crate.

Overview

This crate provides strongly-typed Rust structs and enums that represent the Model Context Protocol, a JSON-RPC based protocol for communication between LLM clients and servers. The types are automatically generated at build time from the official MCP JSON schema specification.

Motivation

To provide auto-generated and correct bindings for the MCP spec in a crate separate from any client/server implementation code.

Features

  • Complete type definitions for the MCP protocol
  • Serde serialization/deserialization support
  • Generated from the latest MCP schema specification
  • Type-safe interaction with MCP messages
  • Schema validation test coverage

Usage

Add this to your Cargo.toml:

mcp-types = "0.1.0"

or run this from inside your crate directory tree:

cargo add mcp-types

Contributing

Contributions are welcome! Please note that this crate’s types are automatically generated from the MCP schema, so most changes will have to do with how the bindings are generated, how types are re-exported, documentation, and other things of that nature. Please do not manually edit generated code.

To contribute, please fork the mcp repo, make a new branch off of main, and make a PR from your fork to main again.

Tools

No tools

Comments

Recommend MCP Servers

View All MCP Servers