MCP Rust CLI server template
A Rust template for creating MCP CLI servers, with support for JSON-based prompts, resources, and tools.
MCP Rust CLI server template
Model Context Protocol (MCP) is an open protocol that enables seamless integration between LLM applications and external data sources and tools. Whether you’re building an AI-powered IDE, enhancing a chat interface, or creating custom AI workflows, MCP provides a standardized way to connect LLMs with the context they need.
mcp-rs-template is a simple application template that demonstrates how to implement MCP CLI server in Rust.
How to use template?
- Clone the repository
- Modify project information in
Cargo.tomlandsrc/mcp/mod.rs - Modify server handlers:
src/mcp/prompts.rs: prompts handlerssrc/mcp/resources.rs: resources handlerssrc/mcp/tools.rs: tools handlers
- Modify
src/mcp/templates/*.jsonif you prefer to use json files for prompts, resources, and tools
mcp-rs-template is based on rust-rpc-router, a JSON-RPC routing library for Rust.
CLI options
--mcp: Enable MCP server--resources: display resources--prompts: display prompts--tools: display tools
How to use MCP CLI server in Claude Desktop?
- Edit
claude_desktop_config.json: Claude Desktop ->Settings->Developer->Edit Config - Add the following configuration to the
serverssection:
{
"mcpServers": {
"current-time": {
"command": "mcp-rs-template",
"args": [
"--mcp"
],
"env": {
"API_KEY": "xxxx"
}
}
}
}
If you want to check MCP log, please use tail -n 20 -f ~/Library/Logs/Claude/mcp*.log.
References
- MCP Specification: https://spec.modelcontextprotocol.io/
- Model Context Protocol (MCP): https://modelcontextprotocol.io/introduction
- rpc-router: json-rpc routing library - https://github.com/jeremychone/rust-rpc-router/
- Zed context_server: https://github.com/zed-industries/zed/tree/main/crates/context_server
Related Servers
Feishu MCP Server
An MCP server with built-in Feishu OAuth authentication, deployable on Cloudflare Workers.
Blueprint MCP
Browser automation via MCP for Chrome and Firefox
MCPunk
Explore and understand codebases through conversation by breaking files into logical chunks for searching and querying without embeddings.
MCP Server Boilerplate
A TypeScript boilerplate for building MCP servers with streamable HTTP and OAuth proxy support.
Flame MCP Server
Provides live, up-to-date documentation for the Flame game engine.
scan-mcp
Minimal MCP server for scanner capture (ADF/duplex/page-size), batching, and multipage assembly
Remote MCP Server (Authless)
An example of a remote MCP server deployable on Cloudflare Workers without authentication.
DiffuGen
Generate images from text using Flux and Stable Diffusion models.
MCP All Servers
A collection of reference implementations for the Model Context Protocol (MCP), showcasing servers built with TypeScript and Python SDKs.
Enkrypt AI
Integrate red-teaming, prompt auditing, and AI safety analysis into any MCP-compatible client.