The mcp-rs-template is a Rust application template for implementing Model Context Protocol (MCP) CLI servers, enabling seamless integration between LLM applications and external data sources and tools. The mcp-rs-template is
Model Context Protocol (MCP) facilitates integration between LLM applications and external data sources/tools. It offers a standardized way to connect LLMs with necessary context, benefiting AI-powered IDEs, chat interfaces, and custom AI workflows.
mcp-rs-template
is a Rust-based application template for implementing an MCP CLI server.
How to use the template:
Cargo.toml
and src/mcp/mod.rs
.src/mcp/prompts.rs
(prompts), src/mcp/resources.rs
(resources), and src/mcp/tools.rs
(tools).src/mcp/templates/*.json
for prompts, resources, and tools configuration.The template utilizes rust-rpc-router
, a JSON-RPC routing library.
CLI options:
--mcp
: Enables the MCP server.--resources
: Displays resources.--prompts
: Displays prompts.--tools
: Displays tools.Claude Desktop Integration:
Configure claude_desktop_config.json
(via Claude Desktop settings) by adding a mcpServers
entry with the command, arguments (--mcp
), and environment variables (e.g., API_KEY
). MCP logs can be viewed using tail -n 20 -f ~/Library/Logs/Claude/mcp*.log
.
linux-china/mcp-rs-template
November 30, 2024
March 28, 2025
Rust