MCP Rust Template

v1.0.0Developer Toolsstable

Model Context Protocol (MCP) CLI server template for Rust

json-rpcmcp
Share:
82
Stars
0
Downloads
0
Weekly
0/5

What is MCP Rust Template?

MCP Rust Template is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to model context protocol (mcp) cli server template for rust

Model Context Protocol (MCP) CLI server template for Rust

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • Model Context Protocol (MCP) CLI server template for Rust

Use Cases

Bootstrap new MCP servers with Rust template.
Build JSON-RPC based MCP servers in Rust.
Standardize MCP server development patterns.
linux-china

Maintainer

LicenseApache-2.0
Languagerust
Versionv1.0.0
UpdatedFeb 17, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

Manual Installation

npx mcp-rs-template

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use MCP Rust Template

MCP Rust Template is a scaffold for building Model Context Protocol CLI servers in Rust, giving developers a ready-to-compile project structure with handlers for prompts, resources, and tools already wired up. It uses JSON-RPC over stdio, making it compatible with any MCP client such as Claude Desktop. Developers use this template to bootstrap production-quality Rust MCP servers without writing protocol boilerplate from scratch, then extend the generated stubs with their own domain logic.

Prerequisites

  • Rust toolchain (rustup + cargo) installed and in PATH
  • Git to clone the repository
  • An MCP client such as Claude Desktop to test the compiled server
  • Basic familiarity with JSON-RPC and the Model Context Protocol architecture
1

Clone the template repository

Clone the linux-china/mcp-rs-template repository to your local machine to get the full project scaffold.

git clone https://github.com/linux-china/mcp-rs-template.git my-mcp-server
cd my-mcp-server
2

Rename the project in Cargo.toml

Open Cargo.toml and replace the placeholder package name and binary name with your own server name. Also update the description and authors fields as appropriate.

3

Implement your tools, prompts, and resources

The scaffold includes src/mcp/tools.rs, src/mcp/prompts.rs, and src/mcp/resources.rs. Add your handler logic in these files. You can also place JSON template files in src/mcp/templates/ to declare capabilities declaratively.

4

Build the binary

Compile the project in release mode. The resulting binary will be placed in target/release/ and is a self-contained executable with no runtime dependencies.

cargo build --release
5

Verify the server CLI flags

Run the binary with the helper flags to confirm tools, prompts, and resources are registered correctly before wiring it into an MCP client.

./target/release/my-mcp-server --tools
./target/release/my-mcp-server --prompts
./target/release/my-mcp-server --resources
6

Register the server with Claude Desktop

Add the compiled binary to claude_desktop_config.json. Pass --mcp to activate MCP server mode, and supply any required secrets via the env block.

MCP Rust Template Examples

Client configuration

Add the compiled Rust binary to Claude Desktop's MCP server list. Replace the command path with the actual path to your release binary.

{
  "mcpServers": {
    "my-mcp-server": {
      "command": "/path/to/target/release/my-mcp-server",
      "args": ["--mcp"],
      "env": {
        "API_KEY": "your_api_key_here"
      }
    }
  }
}

Prompts to try

After wiring up the server and implementing your tools, test these prompts in Claude Desktop.

- "List all available tools from the MCP server."
- "Use the MCP server to [invoke your custom tool name]."
- "What prompts are available in the connected Rust MCP server?"

Troubleshooting MCP Rust Template

Binary exits immediately without entering MCP mode

Ensure you pass the --mcp flag when launching the binary. Without it the server prints help text and exits rather than reading JSON-RPC from stdin.

Claude Desktop shows 'server disconnected' right after starting

Check that the command path in claude_desktop_config.json is the absolute path to the compiled binary. Relative paths are not resolved by Claude Desktop.

Cargo build fails with missing dependency errors

Run 'cargo update' to refresh the lock file, then retry 'cargo build --release'. Ensure your Rust toolchain is up to date with 'rustup update'.

Frequently Asked Questions about MCP Rust Template

What is MCP Rust Template?

MCP Rust Template is a Model Context Protocol (MCP) server that model context protocol (mcp) cli server template for rust It connects AI assistants to external tools and data sources through a standardized interface.

How do I install MCP Rust Template?

Follow the installation instructions on the MCP Rust Template GitHub repository. Clone the repo, install dependencies, and add the server config to your AI client.

Which AI clients work with MCP Rust Template?

MCP Rust Template works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is MCP Rust Template free to use?

Yes, MCP Rust Template is open source and available under the Apache-2.0 license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "mcp-rs-template": { "command": "npx", "args": ["-y", "mcp-rs-template"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use MCP Rust Template?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides