cargo_buildLABSCO SUMMARY
Cargo as tool calls, not shell strings.
Because each subcommand is a typed tool, release mode or a feature list is a parameter rather than a string an agent assembles - and you can allow the check and test tools without granting a general shell.
What it is
An MCP server that wraps Cargo. Each subcommand is its own tool with typed parameters - release mode, feature list, target triple, workspace path - so builds, tests, Clippy runs and rustfmt happen as tool calls rather than as command lines.
What you get
- A project built, in debug or release, with the features and target you name
- Tests run, all of them or one by name
- A binary run, chosen by name in a multi-binary project
- Errors checked without producing a binary
- Clippy run over the project
- Code formatted with rustfmt
- Documentation generated
- Build artifacts cleared
- The dependency tree displayed
Requirements
Python 3.8 or higher, and Rust with Cargo already installed - the server runs the real toolchain rather than reimplementing it. Install from source with pip install -e . The workspace root is auto-detected; pass workspace_path when it guesses wrong.
Setup effort
Build from source — clone the repository, then follow the steps on this page and add the configuration for your client
USE CASES
Getting a compile error explained without copying it out
Check first for the fast answer, and build when you need the real one.
Running the one test that is failing
Pass the test name rather than waiting for the whole suite.
Cleaning up a branch before review
Format, then lint, so the diff is about the change rather than the whitespace.
Working out where a dependency came from
The dependency tree shows the path that pulled it in.
Checking a release build actually works
Build with optimisations, then run the binary that came out.
Clearing a build that has gone strange
Clean the artifacts, then check from scratch.
11 tools
Listed in project docs. Your client may show a different list.
cargo_testcargo_runcargo_checkcargo_clippycargo_fmtcargo_doccargo_cleancargo_treecargo_updatecargo_benchBEFORE YOU INSTALL
What to know first
Tools you get
11 tools named in the project's documentation.
Requires
- cargo-mcp on PATH
- Python 3.8 or later
- Rust and Cargo installed
INSTALLATION
Connect your client
Clone the repository, then follow the steps on this page and add the configuration for your client. This one is built from source rather than installed with a single command.
Server setup
git clone https://github.com/seemethere/cargo-mcp.git
cd cargo-mcp
pip install -e .MCP Clients
Claude Desktop
{
"mcpServers": {
"cargo-mcp": {
"command": "cargo-mcp"
}
}
}Any MCP client
cargo-mcp