Cargo MCP

by seemethere

Not rated
GitHub

About

Interact with Rust projects using Cargo commands like build, test, and run.

Details

Author
seemethere
Categories
Developer Tools

Setup

Install Cargo MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/seemethere/cargo-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

AModel Context Protocol (MCP)server that provides tools for running Cargo commands. This server allows AI agents to interact with Rust projects through Cargo, enabling automated builds, tests, documentation generation, and more.

The server provides the following Cargo tools:

- cargo_build- Build a Rust project with Cargo
- cargo_test- Run tests for a Rust project
- cargo_run- Run a Rust binary
- cargo_check- Check a project for errors without building
- cargo_clippy- Run Clippy linter
- cargo_fmt- Format Rust code using rustfmt
- cargo_doc- Generate documentation
- cargo_clean- Clean build artifacts
- cargo_tree- Display dependency tree
- cargo_update- Update dependencies in Cargo.lock
- cargo_bench- Run benchmarks

- Python 3.8 or higher
- Rust and Cargo installed on your system
- Access to install Python packages

git clone <repository-url> cd cargo-mcp

Add the server to yourclaude_desktop_config.json:

MacOS:~/Library/Application Support/Claude/claude_desktop_config.json
Windows:%APPDATA%/Claude/claude_desktop_config.json

{ "mcpServers": { "cargo-mcp": { "command": "cargo-mcp" } } }

The server can be used with any MCP-compatible client. Start the server using:

You can test the server using the MCP Inspector:

npx @modelcontextprotocol/inspector cargo-mcp

- release(boolean, optional): Build in release mode with optimizations
- features(array, optional): List of features to activate
- target(string, optional): Build for the given target triple
- workspace_path(string, optional): Path to the workspace root (auto-detected if not provided)

- test_name(string, optional): Name of specific test to run
- release(boolean, optional): Run tests in release mode
- features(array, optional): List of features to activate
- workspace_path(string, optional): Path to the workspace root

- bin_name(string, optional): Name of the binary to run (for multi-binary projects)
- args(array, optional): Arguments to pass to the binary
- release(boolean, optional): Run in release mode
- features(array, optional): List of features to activate
- workspace_path(string, optional): Path to the workspace root

Check a Rust project for errors without building it.

- features(array, optional): List of features to activate
- workspace_path(string, optional): Path to the workspace root

- fix(boolean, optional): Automatically apply suggested fixes
- features(array, optional): List of features to activate
- workspace_path(string, optional): Path to the workspace root

- check(boolean, optional): Check if files are formatted without modifying them
- workspace_path(string, optional): Path to the workspace root

Generate documentation for a Rust project.

- open(boolean, optional): Open documentation in browser after generation
- no_deps(boolean, optional): Don't build documentation for dependencies
- workspace_path(string, optional): Path to the workspace root

- workspace_path(string, optional): Path to the workspace root

- package(string, optional): Package to display tree for
- features(array, optional): List of features to activate
- workspace_path(string, optional): Path to the workspace root

- package(string, optional): Specific package to update
- workspace_path(string, optional): Path to the workspace root

- bench_name(string, optional): Name of specific benchmark to run
- features(array, optional): List of features to activate
- workspace_path(string, optional): Path to the workspace root

The server automatically detects Rust projects by searching forCargo.tomlfiles. It walks up the directory tree from the current working directory to find the nearestCargo.tomlfile and uses that directory as the workspace root.

You can override this behavior by providing theworkspace_pathparameter to any tool.

The server provides detailed error messages and logs for troubleshooting:

- Checks if Cargo is installed and available in PATH
- Validates that Cargo.toml exists in the target directory
- Captures both stdout and stderr from Cargo commands
- Provides detailed command execution information
- Clone the repository
- Install development dependencies:

This project is licensed under the MIT License - see the LICENSE file for details.

Contributions are welcome! Please feel free to submit a Pull Request.

- Create an issue on GitHub
- Check the
MCP documentationfor general MCP questions

This is a web browser that enables your coding agent, such as Claude Code, to visit websites on your behalf and assist you in identifying bugs or creating UI test cases.

Create crafted UI components inspired by the best 21st.dev design engineers.

Bring agent evaluations, observability, and synthetic test set generation directly into your IDE for free with Galileo's new MCP server

An MCP server to help AI assistants to answer questions and generate AccelByte Extend SDK code more effectively .

MCP server for AI Diagram Maker — generate beautiful software engineering diagrams directly inside Cursor, Claude Desktop, Claude Code, or any MCP-compatible AI agent

ALAPI MCP Tools,Call hundreds of API interfaces via MCP

AI-powered SVG animation generator that transforms static files into animated SVG components using the Allyson platform

MCP server that gives AI assistants on-demand access to 1,500+ amCharts docs, ~300 code examples, and 1000+ class API references.

APIMatic MCP Server is used to validate OpenAPI specifications using APIMatic. The server processes OpenAPI files and returns validation summaries by leveraging APIMatic’s API.

One shared context layer for AI agents and humans — live API specs, DB schemas, and versioned contracts across repos so every agent and teammate works from the same source of truth.

Build and deploy full-stack Next.js apps with 98 tools for React, AWS, and MongoDB

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.