mcp-rs-template

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

75
6

MCP Rust CLI server template

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:

  1. Clone the repository.
  2. Modify project information in Cargo.toml and src/mcp/mod.rs.
  3. Customize server handlers in src/mcp/prompts.rs (prompts), src/mcp/resources.rs (resources), and src/mcp/tools.rs (tools).
  4. Modify 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.

Repository

LI
linux-china

linux-china/mcp-rs-template

Created

November 30, 2024

Updated

March 28, 2025

Language

Rust

Category

Developer Tools