Rust MCP SDK
A high-performance, asynchronous toolkit for building MCP servers and clients in Rust.
What is Rust MCP SDK?
Rust MCP SDK is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to high-performance, asynchronous toolkit for building mcp servers and clients in rust.
A high-performance, asynchronous toolkit for building MCP servers and clients in Rust.
This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.
Features
- A high-performance, asynchronous toolkit for building MCP se
Use Cases
Maintainer
Works with
Installation
Manual Installation
npx rust-mcp-sdkConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
How to Set Up and Use Rust MCP SDK
The Rust MCP SDK (`rust-mcp-sdk`) is a high-performance, asynchronous toolkit for building both MCP servers and MCP clients in Rust. It provides type-safe schema objects via `rust-mcp-schema`, procedural macros via `rust-mcp-macros` for defining tools with minimal boilerplate, and multiple transport implementations including stdio, Streamable HTTP, and SSE. The SDK supports OAuth authentication with remote providers, MCP Tasks, message streaming, and built-in observability via the `McpObserver` trait, making it a production-ready foundation for developers who want to build or integrate MCP tooling using Rust's performance and safety guarantees.
Prerequisites
- Rust toolchain (stable, 1.75 or later recommended) installed via rustup
- Cargo package manager (included with the Rust toolchain)
- Familiarity with async Rust and Tokio runtime concepts
- An MCP-compatible client for testing (Claude Desktop, MCP Inspector, or a custom client)
Create a new Rust project
Initialize a new Rust binary project that will become your MCP server or client.
cargo new my-mcp-server
cd my-mcp-serverAdd rust-mcp-sdk to your Cargo.toml
Add the SDK as a dependency. Use feature flags to include only the components you need — server, client, macros, and/or specific transports.
[dependencies]
rust-mcp-sdk = { version = "0.9.0", default-features = false, features = ["server", "macros", "stdio"] }
tokio = { version = "1", features = ["full"] }
async-trait = "0.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1"Define a tool using the mcp_tool macro
Use the `#[mcp_tool]` procedural macro to define a typed tool struct. The macro automatically generates the JSON Schema and tool registration boilerplate.
use rust_mcp_sdk::macros;
use serde::{Deserialize, Serialize};
#[macros::mcp_tool(name = "say_hello", description = "Returns a greeting message")]
#[derive(Debug, Deserialize, Serialize, macros::JsonSchema)]
pub struct SayHelloTool {
pub name: String,
}Implement the ServerHandler trait
Implement the `ServerHandler` or `ServerHandlerCore` trait to handle incoming MCP requests such as listing tools and executing tool calls.
use rust_mcp_sdk::{ServerHandler, schema::*};
use async_trait::async_trait;
struct HelloHandler;
#[async_trait]
impl ServerHandler for HelloHandler {
async fn handle_list_tools_request(
&self,
_request: ListToolsRequest,
_runtime: &dyn McpServerRuntime,
) -> Result<ListToolsResult, RpcError> {
Ok(ListToolsResult {
tools: vec![SayHelloTool::tool()],
meta: None,
next_cursor: None,
})
}
}Launch the MCP server with stdio transport
Wire up the handler to the stdio transport and start the async runtime. This is the standard setup for use with Claude Desktop.
use rust_mcp_sdk::{McpServer, StdioTransport};
#[tokio::main]
async fn main() {
let transport = StdioTransport::new();
let server = McpServer::new(HelloHandler, transport);
server.run().await.unwrap();
}Build and register with your MCP client
Build the release binary and register it in your Claude Desktop config. Point the command to the compiled binary.
cargo build --release
# Then add to claude_desktop_config.json:
{
"mcpServers": {
"my-mcp-server": {
"command": "/path/to/my-mcp-server/target/release/my-mcp-server",
"args": []
}
}
}Rust MCP SDK Examples
Client configuration
Claude Desktop config for a compiled Rust MCP server binary. After building with `cargo build --release`, point the command to the binary path.
{
"mcpServers": {
"my-rust-mcp-server": {
"command": "/home/user/my-mcp-server/target/release/my-mcp-server",
"args": []
}
}
}Prompts to try
Example prompts for testing a Rust MCP server built with the SDK. These depend on the tools your server implements.
- "List all tools available from my Rust MCP server"
- "Call the say_hello tool with name 'World'"
- "What tools does this server expose and what parameters do they accept?"
- "Run the my-tool tool with the following arguments: ..."Troubleshooting Rust MCP SDK
Compilation errors related to async traits
Ensure `async-trait = "0.1"` is in your dependencies and you have `use async_trait::async_trait;` imported. The `ServerHandler` and `ClientHandler` traits require the `#[async_trait]` attribute on implementations.
Macro errors with #[mcp_tool] attribute
The `macros` feature must be enabled in your Cargo.toml: `rust-mcp-sdk = { version = "0.9.0", features = ["macros"] }`. Also ensure the struct derives `Serialize`, `Deserialize`, and `macros::JsonSchema`.
MCP client does not receive tool list
Verify your `handle_list_tools_request` implementation returns the tools correctly and the server is using stdio transport for Claude Desktop. Check that the binary path in the config is correct and the binary has execute permissions.
Frequently Asked Questions about Rust MCP SDK
What is Rust MCP SDK?
Rust MCP SDK is a Model Context Protocol (MCP) server that high-performance, asynchronous toolkit for building mcp servers and clients in rust. It connects AI assistants to external tools and data sources through a standardized interface.
How do I install Rust MCP SDK?
Follow the installation instructions on the Rust MCP SDK GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.
Which AI clients work with Rust MCP SDK?
Rust MCP SDK works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.
Is Rust MCP SDK free to use?
Yes, Rust MCP SDK is open source and available under the MIT license. You can use it freely in both personal and commercial projects.
Rust MCP SDK Alternatives — Similar Developer Tools Servers
Looking for alternatives to Rust MCP SDK? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
Browse More Developer Tools MCP Servers
Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.
Set Up Rust MCP SDK in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
Ready to use Rust MCP SDK?
Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.