cargo-mcp
Provides tools for Rust development by exposing Cargo operations, including code compilation checks, linting with Clippy, test execution, formatting verification, and project building in debug or release mode.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Cargo MCP Server
A Model Context Protocol (MCP) server that provides safe access to Cargo operations for Rust projects.
Features
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.
Related MCP server: cursor-rust-tools
Installation
cargo install cargo-mcpUsage with Claude Desktop
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"
Safety Features
Only whitelisted Cargo commands are available
Path validation ensures the target is a valid Rust project (has Cargo.toml)
No arbitrary command execution
All commands run in the specified project directory
License
MIT or APACHE-2.0
This server cannot be deployed
Maintenance
Related MCP Connectors
Related MCP Servers
- MIT
- FlicenseNot gradedqualityCmaintenanceA MCP server to allow the LLM in Cursor to access Rust Analyzer, Crate Docs and Cargo Commands.83-
- -
- AlicenseNot gradedqualityAmaintenanceOfficial MCP Server for Buildkite.56MIT