
Rust Mcp Server Generator
Scaffold a production-shaped Rust MCP server with rmcp SDK, tools, optional prompts/resources, and integration tests from a short requirements interview.
Overview
rust-mcp-server-generator is an agent skill for the Build phase that scaffolds a complete Rust Model Context Protocol server using the official rmcp SDK, including tools, optional prompts and resources, and integration t
Install
npx skills add https://github.com/github/awesome-copilot --skill rust-mcp-server-generatorWhat is this skill?
- Interviews for project name, description, transport (stdio, sse, http, or all), and tool list
- Emits full Cargo workspace: main, handler, tools, prompts, resources, state modules
- Pins rmcp 0.8.1 server features with tokio, serde, schemars, and tracing stack
- Includes integration_test.rs scaffold under tests/
- Supports optional prompts and resources directories alongside tool implementations
- Targets rmcp 0.8.1 with server features and rmcp-macros 0.8
- Scaffolds seven-plus source areas including tools, prompts, resources, and integration tests
Adoption & trust: 8.8k installs on skills.sh; 34.6k GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You know what tools your agent needs but lack a consistent Rust MCP project structure, handler patterns, and test harness around rmcp.
Who is it for?
Indie developers comfortable with Rust who want a standardized MCP server starter tied to rmcp 0.8.x instead of copying disjoint snippets.
Skip if: Builders who need a hosted MCP marketplace listing only, want a non-Rust stack, or expect zero follow-up implementation after codegen.
When should I use this skill?
You need a new Rust MCP server and can specify project name, description, transport type, tools, and whether to include prompts and resources.
What do I get? / Deliverables
You receive a ready-to-cargo-build MCP server tree with modular tools, chosen transports, and integration tests you can fill in with domain logic.
- Complete Cargo.toml and src module tree for an MCP server
- Per-tool Rust modules plus optional prompts and resources
- integration_test.rs starter under tests/
Recommended Skills
Journey fit
Build is the home phase because the skill generates a new codebase and project layout rather than shipping, marketing, or operating an existing service. agent-tooling fits MCP servers that extend Claude, Cursor, and Codex with custom tools—the core output of this generator.
How it compares
A generator skill for greenfield Rust MCP repos—not an MCP runtime registry and not a one-file script integration.
Common Questions / FAQ
Who is rust-mcp-server-generator for?
Solo builders shipping custom agent tools in Rust who want rmcp-aligned structure, transports, and tests generated in one pass.
When should I use rust-mcp-server-generator?
During Build agent-tooling when you are creating a new MCP server—after you know tool names and transport needs but before you implement business logic and wire CI.
Is rust-mcp-server-generator safe to install?
The skill instructs the agent to write project files locally; review the Security Audits panel on this Prism page and audit generated dependencies before publishing the server.
SKILL.md
READMESKILL.md - Rust Mcp Server Generator
# Rust MCP Server Generator You are a Rust MCP server generator. Create a complete, production-ready Rust MCP server project using the official `rmcp` SDK. ## Project Requirements Ask the user for: 1. **Project name** (e.g., "my-mcp-server") 2. **Server description** (e.g., "A weather data MCP server") 3. **Transport type** (stdio, sse, http, or all) 4. **Tools to include** (e.g., "weather lookup", "forecast", "alerts") 5. **Whether to include prompts and resources** ## Project Structure Generate this structure: ``` {project-name}/ ├── Cargo.toml ├── .gitignore ├── README.md ├── src/ │ ├── main.rs │ ├── handler.rs │ ├── tools/ │ │ ├── mod.rs │ │ └── {tool_name}.rs │ ├── prompts/ │ │ ├── mod.rs │ │ └── {prompt_name}.rs │ ├── resources/ │ │ ├── mod.rs │ │ └── {resource_name}.rs │ └── state.rs └── tests/ └── integration_test.rs ``` ## File Templates ### Cargo.toml ```toml [package] name = "{project-name}" version = "0.1.0" edition = "2021" [dependencies] rmcp = { version = "0.8.1", features = ["server"] } rmcp-macros = "0.8" tokio = { version = "1", features = ["full"] } serde = { version = "1.0", features = ["derive"] } serde_json = "1.0" anyhow = "1.0" tracing = "0.1" tracing-subscriber = "0.3" schemars = { version = "0.8", features = ["derive"] } async-trait = "0.1" # Optional: for HTTP transports axum = { version = "0.7", optional = true } tower-http = { version = "0.5", features = ["cors"], optional = true } [dev-dependencies] tokio-test = "0.4" [features] default = [] http = ["dep:axum", "dep:tower-http"] [[bin]] name = "{project-name}" path = "src/main.rs" ``` ### .gitignore ```gitignore /target Cargo.lock *.swp *.swo *~ .DS_Store ``` ### README.md ```markdown # {Project Name} {Server description} ## Installation ```bash cargo build --release ``` ## Usage ### Stdio Transport ```bash cargo run ``` ### SSE Transport ```bash cargo run --features http -- --transport sse ``` ### HTTP Transport ```bash cargo run --features http -- --transport http ``` ## Configuration Configure in your MCP client (e.g., Claude Desktop): ```json { "mcpServers": { "{project-name}": { "command": "path/to/target/release/{project-name}", "args": [] } } } ``` ## Tools - **{tool_name}**: {Tool description} ## Development Run tests: ```bash cargo test ``` Run with logging: ```bash RUST_LOG=debug cargo run ``` ``` ### src/main.rs ```rust use anyhow::Result; use rmcp::{ protocol::ServerCapabilities, server::Server, transport::StdioTransport, }; use tokio::signal; use tracing_subscriber; mod handler; mod state; mod tools; mod prompts; mod resources; use handler::McpHandler; #[tokio::main] async fn main() -> Result<()> { // Initialize tracing tracing_subscriber::fmt() .with_max_level(tracing::Level::INFO) .with_target(false) .init(); tracing::info!("Starting {project-name} MCP server"); // Create handler let handler = McpHandler::new(); // Create transport (stdio by default) let transport = StdioTransport::new(); // Build server with capabilities let server = Server::builder() .with_handler(handler) .with_capabilities(ServerCapabilities { tools: Some(Default::default()), prompts: Some(Default::default()), resources: Some(Default::default()), ..Default::default() }) .build(transport)?; tracing::info!("Server started, waiting for requests"); // Run server until Ctrl+C server.run(signal::ctrl_c()).await?; tracing::info!("Server shutting down"); Ok(()) } ``` ### src/handler.rs ```rust use rmcp::{ model::*, protocol::*, server::{RequestContext, ServerHand