1 unstable release
Uses new Rust 2024
new 0.1.0 | Apr 12, 2025 |
---|
#976 in Database interfaces
125KB
1.5K
SLoC
MMCP
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.
Dependencies
~3–10MB
~104K SLoC