#communication #mcp #registry #protocols #api-bindings

tiny_mcp_registry

Registry for the Machine Communication Protocol (MCP) tools

6 releases

new 0.1.5 Mar 13, 2025
0.1.4 Mar 13, 2025

#23 in #mcp

Download history

100 downloads per month
Used in 2 crates

MIT/Apache

5KB

Tiny MCP Server

Crates.io Documentation License: MIT OR Apache-2.0

A Rust implementation of the Machine Communication Protocol (MCP) server, designed for efficient and reliable communication between machines and tools.

Features

  • Multiple Transport Layers: Supports both stdio and Server-Sent Events (SSE) transports
  • Extensible Tool System: Easily register custom tools with the server
  • Type-Safe API: Leverages Rust's type system for safe and reliable communication
  • Asynchronous Design: Built on tokio for high-performance async I/O
  • Simple Integration: Just add a single dependency to your project
  • Convenient Imports: Use the prelude module to import all necessary types and traits

Installation

Add this to your Cargo.toml:

[dependencies]
tiny_mcp_server = "0.1.0"
tokio = { version = "1.0", features = ["full"] }
serde_json = "1.0"

Quick Start

For convenience, you can use the prelude module to import all necessary types and traits:

use serde_json::{Value, json};
use std::error::Error;
use tiny_mcp_server::prelude::*;

#[mcp_tool(
    description = "A simple greeting tool",
    version = "1.0.0",
    category = "examples"
)]
pub async fn say_hello(name: String) -> MCPResult<Value> {
    Ok(json!({
        "greeting": format!("Hello {name}")
    }))
}

#[tokio::main]
async fn main() -> Result<(), Box<dyn Error>> {
    // Start with stdio transport
    server::start_stdio().await
}

Documentation

For more detailed documentation, see the API documentation.

Examples

Check out the examples directory for more usage examples:

  • stdio.rs: Example using stdio transport
  • sse.rs: Example using SSE transport

License

This project is licensed under either of:

at your option.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Dependencies

~3–9.5MB
~91K SLoC