Rust expert MCP server — live access to rust-lang GitHub, compiler errors, RFCs, The Book, Reference, Nomicon, and crates.io
rust-expert-mcp
A Rust MCP (Model Context Protocol) server that gives any MCP-compatible AI assistant live access to the entire rust-lang GitHub organization — source code, compiler errors, RFCs, The Book, The Reference, The Nomicon, Rust By Example, and crates.io.
Built with rmcp 1.5.0 (the official Rust MCP SDK).
Tools
| Tool | Description |
|---|---|
| search_rust_source | Code search across all rust-lang repos (rustc, std, Cargo, Clippy, rustdoc…) |
| search_rust_issues | Issues & PRs across any rust-lang repo |
| get_repo_file | Read any file from any rust-lang repository |
| list_rust_repos | List all public repos in the rust-lang org |
| explain_compiler_error | Full E0xxx error explanations sourced directly from rustc |
| get_rust_book | Chapters from The Rust Programming Language |
| get_rust_reference | Sections from the Rust Reference (formal language spec) |
| get_rust_nomicon | Sections from the Rustonomicon (unsafe / advanced Rust) |
| get_rust_by_example | Chapters from Rust by Example |
| get_rust_rfc | Full RFC text by number |
| search_rust_rfcs | Search accepted RFCs by keyword |
| get_crate_info | Crate metadata from crates.io |
| get_rust_edition_guide | Edition migration guides (2015 / 2018 / 2021 / 2024) |
Build
Requires Rust (stable, edition 2021).
git clone https://github.com/Degens-World/rust-expert-mcp
cd rust-expert-mcp
cargo build --release
# binary → target/release/rust-expert-mcp (or .exe on Windows)
Configure in Claude Code
claude mcp add rust-expert -- /path/to/rust-expert-mcp
Or add it manually to your Claude config (~/.claude/claude.json):
{
"mcpServers": {
"rust-expert": {
"command": "/path/to/rust-expert-mcp"
}
}
}
Claude Desktop (claude_desktop_config.json)
{
"mcpServers": {
"rust-expert": {
"command": "/path/to/rust-expert-mcp"
}
}
}
GitHub Token (recommended)
Without a token the GitHub API allows 10 search requests / minute and 60 requests / hour.
With a token: 30 searches / minute and 5 000 requests / hour.
Generate a token at GitHub → Settings → Developer Settings → Personal Access Tokens (no scopes required for public repos), then pass it via environment variable:
{
"mcpServers": {
"rust-expert": {
"command": "/path/to/rust-expert-mcp",
"env": {
"GITHUB_TOKEN": "ghp_your_token_here"
}
}
}
}
Example usage (with Claude)
Search for how `Pin` is implemented in the standard library.
→ search_rust_source(query="Pin", repo="rust")
Explain compiler error E0505.
→ explain_compiler_error(error_code="E0505")
Show me RFC 2094 (Non-Lexical Lifetimes).
→ get_rust_rfc(number=2094)
What chapter covers async/await in The Book?
→ get_rust_book(chapter="SUMMARY")
Read the trait-objects section of the Reference.
→ get_rust_reference(section="trait-objects")
How many downloads does tokio have?
→ get_crate_info(name="tokio")
License
MIT