Get the FREE Ultimate OpenClaw Setup Guide →

rust

MCP server for development in Rust

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio vaiz-rust-mcp-server rust-mcp-server

How to use

The rust-mcp-server exposes a rich set of Rust development tools to an LLM via the Model Context Protocol (MCP). It acts as a bridge between your local Rust project and an AI agent, allowing the model to execute common Cargo commands, manage dependencies, inspect metadata, and enforce code quality practices against your workspace. With this server running, the LLM can automate tasks such as building, testing, formatting, linting, and even managing dependencies or generating documentation, all while operating in your local environment. Tools available include cargo-build, cargo-check, cargo-test, cargo-doc, cargo-fmt, cargo-clippy, cargo-clean, and a suite of project management and dependency utilities like cargo-add, cargo-remove, cargo-update, cargo-metadata, cargo-search, cargo-info, and more. The server also provides Rust toolchain insights through commands like rustup-show and rustup-update, helping the agent keep toolchains consistent with your project.

To use it, start the server in your development environment and point your MCP client (such as a VS Code Copilot integration) to the rust-mcp-server. The agent can then request operations (for example, run cargo test --workspace or cargo fmt --all) and receive structured results suitable for follow-up actions. You can disable specific tools if needed via the CLI flag --disable-tool, and you can scope operations to a particular workspace to keep actions focused on your project.

How to install

Prerequisites:\n- Rust toolchain installed (rustup, cargo)\n- Internet access to fetch crates\n\nInstallation steps:\n1) Ensure Rust and Cargo are installed. If you don't have Rust, install via rustup:\n\n curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n\n2) Install the MCP server binary using Cargo:\n\nbash\ncargo install rust-mcp-server\n``\n\n3) Verify installation:\n\nbash\nrust-mcp-server --version\n\n\n4) Run the server (in a suitable terminal):\n\n```bash\nrust-mcp-server --log-level info\n\n\nOptional flags you might find useful:\n- --log-level <level> to control verbosity (error, warn, info, debug, trace)\n- --log-file <path> to write logs to a file\n- --disable-tool <TOOL_NAME> to disable specific tools for safety or performance reasons\n- --workspace <PATH> to limit operations to a specific Rust project\n\n5) If you prefer using a package manager environment, you can also install and run via a container or your preferred runtime, then connect your MCP client to the running server.

Additional notes

Tips and notes:\n- The server exposes a comprehensive toolset; start with core commands like cargo-check and cargo-build to validate your workspace quickly.\n- Use --disable-tool to prevent the agent from invoking potentially dangerous or long-running commands for sensitive projects.\n- Ensure your workspace path (--workspace) is correctly set to avoid accidental edits in unrelated directories.\n- For CI or shared environments, consider pinning tool versions with a cargo profile or using rustup-toolchain-add to guarantee consistent toolchains.\n- When integrating with VS Code Copilot, configure the MCP server in .vscode/mcp.json and enable chat.mcp.enabled in settings for a seamless experience.\n- If you encounter permission or path issues, run the server from a user account with access to the Rust project and ensure your PATH includes the rust-mcp-server binary location.\n- The server can generate documentation with --generate-docs <OUTPUT_FILE> and can provide machine-readable cargo metadata via cargo-metadata for automated tooling.

Related MCP Servers

Sponsor this space

Reach thousands of developers