Expand description
§Rs Fast MCP
High-performance, async-first Rust implementation of the Model Context Protocol (MCP).
Rs Fast MCP provides a complete framework for building MCP servers and clients
using modern Rust practices. Built on tokio and actix-web, it offers non-blocking
I/O, type-safe interfaces, and a rich middleware pipeline out of the box.
§Key Features
- Flexible transports — Stdio (pipe) and HTTP/SSE with session management.
- Authentication — Pluggable
server::auth::AuthProvidertrait with built-in providers for Google, GitHub, Azure, AWS Cognito, Auth0, and more. - Middleware — Composable request pipeline with rate-limiting, caching, and logging.
- Component managers — First-class registration, validation, and execution for
tools,resources, andprompts. - Client SDK — Async client with transport auto-detection, sampling, and roots support.
§Quick Start
use rs_fast_mcp::server::app::Server;
use rs_fast_mcp::tools::tool::{Tool, ToolResult};
use rs_fast_mcp::mcp::types::ContentBlock;
#[tokio::main]
async fn main() {
// Build the server (creates an internal FastMCPServer engine)
let server = Server::builder("my-server", "0.1.0")
.stdio()
.build();
// Register a tool on the running engine
let tool = Tool::new("greet", "Say hello to a name")
.add_parameter("name", "string", "The name to greet");
server.core.add_tool(tool).unwrap();
// Run until EOF or SIGINT
server.run().await.unwrap();
}§Module Overview
| Module | Purpose |
|---|---|
mcp | Protocol types, JSON-RPC messages, and configuration |
server | Server core, transports, auth, and middleware |
client | Async MCP client SDK |
tools | Tool registration, validation, and execution |
resources | Resource management and URI templates |
prompts | Prompt templates and execution |
cli | Command-line interface (serve, client, inspect) |
settings | Environment-driven configuration |
error | Error types used across the crate |
util | JSON Schema helpers and shared utilities |
Modules§
- cli
- Command-line interface for rs-fast-mcp.
- client
- error
- Crate-wide error types.
- mcp
- Model Context Protocol (MCP) type definitions and wire-format utilities.
- prompts
- Prompt template registration and execution.
- resources
- Resource management, URI templates, and subscriptions.
- server
- MCP server implementation.
- settings
- Environment-driven application settings.
- shared
- tools
- Tool registration, validation, and execution.
- util
- Shared utility modules.