About
Template for building MCP servers in Rust
README
A template for building MCP servers in Rust.
Single binary, zero runtime dependencies, stdio + HTTP transports out of the box.
What's Included
- rmcp — official Rust MCP SDK with
#[tool]macro for tool definitions - Dual transport — stdio for local clients, streamable HTTP for hosted deployments
- Distribution — uvx (via maturin), rvx, cargo install, Nix flake, Docker
- CI/CD — clippy, fmt, cross-compilation (Linux/macOS/Windows), Nix check, cargo-deny, gitleaks
- Release — tag-triggered GitHub releases with binaries, crates.io, and PyPI publishing
Quick Start
Click "Use this template" on GitHub (or clone the repo)
Run the setup script:
./setup.sh my-mcp-server your-github-username "My awesome MCP server"
- Build and run:
cargo build
cargo run
- Delete the setup script:
rm setup.sh
Project Structure
src/
├── main.rs # Entry point, transport setup
├── lib.rs # Module declarations
├── server.rs # MCP server, tool definitions
├── config.rs # CLI args (clap)
└── errors.rs # Error types
Adding Tools
Edit src/server.rs:
#[derive(Deserialize, JsonSchema)]
pub struct MyParams {
/// Description shown to the AI model
pub query: String,
}
#[tool_router]
impl McpServer {
#[tool(
name = "my_tool",
description = "What this tool does"
)]
async fn my_tool(
&self,
Parameters(params): Parameters<MyParams>,
) -> Result<CallToolResult, McpError> {
// your logic here
to_json_result(&serde_json::json!({ "result": params.query }))
}
}
Usage
Claude Desktop / Claude Code
With uvx:
{
"mcpServers": {
"REPLACE_ME": {
"command": "uvx",
"args": ["REPLACE_ME"]
}
}
}
With rvx:
{
"mcpServers": {
"REPLACE_ME": {
"command": "rvx",
"args": ["REPLACE_ME"]
}
}
}
Other installation methods
With Nix:
nix run github:REPLACE_ME_GITHUB_OWNER/REPLACE_ME
With cargo:
cargo install REPLACE_ME
From releases:
Download a prebuilt binary from GitHub Releases.
With Docker:
docker run -p 3000:3000 REPLACE_ME
HTTP Transport
REPLACE_ME --transport streamable-http --port 3000
The server listens on http://127.0.0.1:3000/mcp.
Debugging
RUST_LOG=debug REPLACE_ME
Development
nix develop # or install Rust toolchain manually
just check # clippy + test + fmt + taplo + typos
just fmt # auto-format
just deny # dependency audit
License
MIT
Install Template Rust in Claude Desktop, Claude Code & Cursor
unyly install template-rustInstalls into Claude Desktop, Claude Code, Cursor & VS Code — handles npx, uvx and build-from-source repos for you.
First time? Get the CLI: curl -fsSL https://unyly.org/install | sh
Or configure manually
Run in your terminal:
claude mcp add template-rust -- uvx REPLACE_MEStep-by-step: how to install Template Rust
FAQ
Is Template Rust MCP free?
Yes, Template Rust MCP is free — one-click install via Unyly at no cost.
Does Template Rust need an API key?
No, Template Rust runs without API keys or environment variables.
Is Template Rust hosted or self-hosted?
Self-hosted: the server runs locally on your machine via the install command above.
How do I install Template Rust in Claude Desktop, Claude Code or Cursor?
Open Template Rust on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
Related MCPs
Fetch
Web content fetching and conversion for efficient LLM usage.
Roblox Studio
Enables AI coding tools to control Roblox Studio for workspace exploration, instance manipulation, and script management. It provides tools for playtesting, sce
by paralovOpencode Omniroute Plugin
OpenCode plugin for the OmniRoute AI Gateway. Drives dynamic model discovery, /connect auth flow, and multi-instance OmniRoute providers via the official @openc
by GitHub ActionsAWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
by modelcontextprotocolSpring AI MCP Server
Provides auto-configuration for setting up an MCP server in Spring Boot applications.
llm-analysis-assistant
A very streamlined mcp client that supports calling and monitoring stdio/sse/streamableHttp, and can also view request responses through the /logs page. It also
by xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
by lastmile-aiSpring AI MCP Client
Provides auto-configuration for MCP client functionality in Spring Boot applications.
mcp.natoma.ai
A Hosted MCP Platform to discover, install, manage and deploy MCP servers by [Natoma Labs](https://www.natoma.ai)
MCPHub
Website to list high quality MCP servers and reviews by real users. Also provide online chatbot for popular LLM models with MCP server support.
Compare Template Rust with
Not sure what to pick?
Find your stack in 60 seconds
Author?
Embed badge for your README
Browse similar
All ai MCPs
