Описание
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
Установить Template Rust в Claude Desktop, Claude Code, Cursor
unyly install template-rustСтавит в Claude Desktop, Claude Code, Cursor и VS Code — сам разбирается с npx, uvx и сборкой из исходников.
Впервые? Поставь CLI: curl -fsSL https://unyly.org/install | sh
Или настроить вручную
Выполни в терминале:
claude mcp add template-rust -- uvx REPLACE_MEПошаговые гайды: как установить Template Rust
FAQ
Template Rust MCP бесплатный?
Да, Template Rust MCP бесплатный — установка в пару кликов через Unyly без оплаты.
Нужен ли API-ключ для Template Rust?
Нет, Template Rust работает без API-ключей и переменных окружения.
Template Rust — hosted или self-hosted?
Self-hosted: сервер запускается локально на твоей машине командой из раздела установки.
Как установить Template Rust в Claude Desktop, Claude Code или Cursor?
Открой Template Rust на unyly.org, выбери вкладку своего клиента (Claude Desktop, Claude Code, Cursor) и нажми Install — конфиг сгенерируется автоматически, без правки JSON.
Похожие MCP
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
автор: 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
автор: GitHub ActionsAWS KB Retrieval
Retrieval from AWS Knowledge Base using Bedrock Agent Runtime.
автор: 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
автор: xuzexin-hzMCP-Agent
A simple, composable framework to build agents using Model Context Protocol by [LastMile AI](https://www.lastmileai.dev)
автор: 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
Не уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории ai
