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
Servidores relacionados
Alpha Vantage MCP Server
patrocinadorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
MCPJam Inspector
A developer tool for testing and debugging MCP servers, supporting STDIO, SSE, and Streamable HTTP protocols.
API Tester
This MCP Server accepts swagger/postman documents as input. It then generates API & Load test scenarios, executes the tests and generates the execution report.
Databutton App MCP
Call your Databutton app endpoints as LLM tools with MCP.
Sequential Thinking Multi-Agent System (MAS)
An MCP agent that utilizes a Multi-Agent System (MAS) for sequential thinking and problem-solving.
Scanpy-MCP
A natural language interface for single-cell RNA sequencing (scRNA-Seq) analysis using the Scanpy library.
MCP Streamable HTTP Python Server
A Python template for creating a streamable HTTP MCP server. Requires an external 'mcp-config.json' file for client setup.
Flux ImageGen MCP Server
An MCP server for generating images using the Pollinations AI API.
Nuxt MCP
MCP server helping models to understand your Vite/Nuxt app better.
FastMCP ThreatIntel
An AI-powered threat intelligence analysis tool for multi-source IOC analysis, APT attribution, and interactive reporting.
Jules
Jules async coding agent - run autonomous tasks using Jules