A modular, minimalistic and macro-powered MCP (Model Context Protocol) framework for Rust.
mmcp = { version = "0.1", features = ["server-stdio"] }
uuid = { version = "1", features = ["v4"] }
tokio = { version = "1", features = ["full"] }
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() {
MCPServer::new("mmcp-uuid", env!("CARGO_PKG_VERSION"))
.with_tools_from_inventory()
.start(stdio_server_rpc())
.await
.unwrap();
}
- STDIO server implementation
- Protocol definitions
- Tool macros
- RPC implementation
- HTTP transport with Axum
- Client implementation
- Authentication
- Logging
- Schemars 0.8 support
- Support more MCP functionalities
{
"mcpServers": {
"mmcp-uuid": {
"command": "cargo",
"args": [
"run",
"--manifest-path",
"/path/to/mmcp/Cargo.toml",
"-p",
"mmcp-uuid"
]
}
}
}