Sokoliem/rusty-mcp-scaffold
If you are the rightful owner of rusty-mcp-scaffold and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to henry@mcphub.com.
Rusty MCP Scaffold is a minimal Rust-based Model Context Protocol (MCP) server scaffold designed for quick integration with Claude Desktop.
Rusty MCP Scaffold
A minimal Rust-based Model Context Protocol (MCP) server scaffold for quickly bootstrapping MCP servers that integrate with Claude Desktop.
Features
This scaffold provides a working MCP server implementation with:
- 🦀 Pure Rust Implementation using the
rmcpcrate - 🔧 Example Tools: Echo, Calculator, and Stats tools for reference
- 📝 Comprehensive Logging: File and console logging with configurable levels
- 🚀 Easy Setup: Pre-configured for Claude Desktop integration
- 📦 Minimal Dependencies: Only essential crates included
Quick Start
-
Clone the repository
git clone https://github.com/Sokoliem/rusty-mcp-scaffold.git cd rusty-mcp-scaffold -
Build the server
cargo build --release -
Configure Claude Desktop
Add to your
claude_desktop_config.json:"rusty-server": { "command": "C:\\path\\to\\rusty-mcp-scaffold\\target\\release\\rusty-server.exe", "args": [], "env": { "RUST_LOG": "debug", "RUST_BACKTRACE": "1" } } -
Restart Claude Desktop and your server should be available!
Project Structure
rusty-mcp-scaffold/
├── Cargo.toml # Project dependencies
├── build.rs # Build script for compile-time info
├── src/
│ ├── main.rs # Server entry point and logging setup
│ └── server.rs # MCP server implementation and tools
├── logs/ # Generated log files (gitignored)
└── target/ # Build artifacts (gitignored)
Available Tools
1. Echo Tool
Echoes back any message sent to it.
Parameters:
- message (string): The message to echo back
2. Calculator Tool
Performs basic arithmetic operations.
Parameters:
- operation (string): "add", "subtract", "multiply", or "divide"
- a (number): First number
- b (number): Second number
3. Get Stats Tool
Returns server statistics including request count.
Parameters: None
Extending the Server
To add new tools:
-
Add a new method to the
RustyServerimplementation insrc/server.rs:#[tool(description = "Your tool description")] async fn your_tool_name( &self, #[tool(param)] #[schemars(description = "Parameter description")] param_name: String, ) -> Result<CallToolResult, McpError> { // Your implementation Ok(CallToolResult::success(vec![Content::text("Result")])) } -
Rebuild the server:
cargo build --release -
Restart Claude Desktop to use the new tool
Logging
Logs are written to:
- Console: stderr output for immediate feedback
- Files:
logs/rusty_server_YYYYMMDD_HHMMSS.logfor detailed debugging
Configure logging verbosity with the RUST_LOG environment variable:
error: Only errorswarn: Warnings and errorsinfo: General informationdebug: Debug informationtrace: Very detailed trace information
Development
Prerequisites
- Rust 1.70+ (install from rustup.rs)
- Windows, macOS, or Linux
Testing Standalone
# Run with default logging
cargo run
# Run with trace logging
RUST_LOG=trace cargo run
# Run the release build
./target/release/rusty-server
Building for Distribution
# Build optimized binary
cargo build --release
# Binary will be at target/release/rusty-server (or .exe on Windows)
Troubleshooting
-
Server doesn't appear in Claude Desktop
- Ensure Claude Desktop is fully restarted
- Check the path in your config is correct
- Look for errors in the log files
-
Tools not working
- Check
logs/directory for error messages - Verify the server is running with
test_server.bat(Windows) - Ensure RUST_LOG is set for debugging
- Check
-
Build failures
- Update Rust:
rustup update - Clean build:
cargo clean && cargo build --release
- Update Rust:
Dependencies
rmcp: MCP protocol implementationtokio: Async runtimetracing: Structured loggingserde/serde_json: JSON serializationschemars: JSON schema generation
License
MIT License - feel free to use this scaffold for your own MCP servers!
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.