mmcp

Crates.iommcp
lib.rsmmcp
version0.1.0
created_at2025-04-12 09:11:11.061453+00
updated_at2025-04-12 09:11:11.061453+00
descriptionA modular, minimalistic and macro-powered MCP (Model Context Protocol) framework for Rust.
homepagehttps://github.com/ryo33/mmcp
repositoryhttps://github.com/ryo33/mmcp
max_upload_size
id1630759
size37,649
Ryo Hirayama (ryo33)

documentation

README

MMCP

GitHub MIT/Apache 2.0 Crates.io docs.rs GitHub Repo stars

A modular, minimalistic and macro-powered MCP (Model Context Protocol) framework for Rust.

This is the main crate for the MMCP framework, providing core functionality and interfaces.

Implementation Status

  • STDIO server implementation
  • Protocol definitions
  • Tool macros
  • RPC implementation
  • HTTP transport with Axum
  • Client implementation
  • Authentication
  • Logging
  • Schemars 0.8 support

Example

use mmcp::{
    server::{MCPServer, primitives::tool::Text, stdio_server_rpc},
    tool,
};
use uuid::Uuid;

/// Generate a UUID
#[tool]
fn generate_uuid() -> Text<Uuid> {
    Text(Uuid::new_v4())
}

/// Generate multiple UUIDs
#[tool]
fn generate_uuid_many(count: usize) -> Vec<Text<Uuid>> {
    (0..count).map(|_| generate_uuid()).collect()
}

#[tokio::main]
async fn main() {
    let server = MCPServer::new("mmcp-uuid", env!("CARGO_PKG_VERSION")).with_tools_from_inventory();

    let adapter = stdio_server_rpc();
    server.start(adapter).await.unwrap();
}

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.

Commit count: 19

cargo fmt