Crates.io | cargo-mcp |
lib.rs | cargo-mcp |
version | 0.2.0 |
created_at | 2025-06-06 19:10:39.097825+00 |
updated_at | 2025-07-18 22:48:06.175408+00 |
description | mcp server for cargo commands |
homepage | |
repository | https://github.com/jbr/cargo-mcp |
max_upload_size | |
id | 1703349 |
size | 99,582 |
A Model Context Protocol (MCP) server that provides safe access to Cargo operations for Rust projects.
This MCP server exposes the following Cargo tools:
cargo_check - Verify code compiles without producing executables
cargo_clippy - Run the Clippy linter for code suggestions
cargo_test - Execute project tests
cargo_fmt_check - Check code formatting without modifying files
cargo_build - Build the project (debug or release mode)
cargo_bench - Run benchmarks
cargo_add - Add dependencies to Cargo.toml
cargo_remove - Remove dependencies from Cargo.toml
cargo_update - Update dependencies
cargo_clean - Remove artifacts that cargo has generated in the past
cargo_run - Run a binary or example
All tools support setting custom environment variables via the cargo_env
parameter and rust
toolchain with the toolchain
parameter.
cargo install cargo-mcp
Add this to your Claude Desktop MCP configuration:
{
"mcpServers": {
"cargo-mcp": {
"command": "/path/to/cargo-mcp/cargo-mcp",
"args": ["serve"]
}
}
}
Optionally, include "env": {"CARGO_MCP_DEFAULT_TOOLCHAIN": {{toolchain}} }
in the arguments where
{{toolchain}}
is something like "nightly" or "stable"
MIT or APACHE-2.0