Cargo MCP Server

A Model Context Protocol (MCP) server that provides tools for managing Rust projects using the `cargo` command-line tool.

Local serverstdio

What is the Cargo MCP Server?

A Model Context Protocol (MCP) server that provides tools for managing Rust projects using the cargo command-line tool.

More MCP options

Compare MCP servers by category, or browse hosted MCP servers if you prefer an endpoint over a local process.

Maintainer setup documentation.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
working_directorystring, optional) - Working directory to run cargo in
packagestring, optional) - Package to operate on
featuresarray of strings, optional) - Features to activate
all_featuresboolean, optional) - Activate all available features
no_default_featuresboolean, optional) - Do not activate default features
releaseboolean, optional) - Use release profile
targetstring, optional) - Target triple
libboolean, optional) - Only this package's library
binstring, optional) - Only the specified binary
binsboolean, optional) - All binaries
examplestring, optional) - Only the specified example
examplesboolean, optional) - All examples
teststring, optional) - Only the specified test target
testsboolean, optional) - All tests
benchstring, optional) - Only the specified bench target
benchesboolean, optional) - All benches
all_targetsboolean, optional) - All targets
profilestring, optional) - Build artifacts with the specified profile
message_formatstring, optional) - Error format (human, short, json, etc.)
workspaceboolean, optional) - Update all packages in workspace
excludearray of strings, optional) - Exclude packages from the operation
fixboolean, optional) - Automatically apply lint suggestions
allow_dirtyboolean, optional) - Fix code even if working directory has changes
allow_stagedboolean, optional) - Fix code even if working directory has staged changes
exactboolean, optional) - Exactly match filters rather than by substring
ignoredboolean, optional) - Run ignored tests
include_ignoredboolean, optional) - Run both ignored and not ignored tests
jobsinteger, optional) - Number of parallel jobs
nocaptureboolean, optional) - Don't capture stdout/stderr
test_threadsinteger, optional) - Number of threads for running tests
dependencystring, required) - Dependency to remove
devboolean, optional) - Remove as development dependency
buildboolean, optional) - Remove as build dependency
renamestring, optional) - Rename the dependency
pathstring, required for new) - Path for the new package
gitstring, optional) - Git repository location
branchstring, optional) - Git branch
tagstring, optional) - Git tag
revstring, optional) - Git reference
default_featuresboolean, optional) - Re-enable default features
registrystring, optional) - Registry to use
aggressiveboolean, optional) - Force updating all dependencies
dry_runboolean, optional) - Don't actually write the lockfile
precisestring, optional) - Update to exactly this version
duplicatesboolean, optional) - Show only dependencies with multiple versions
edgesstring, optional) - Kinds of dependencies to display
formatstring, optional) - Format string for printing dependencies
invertarray of strings, optional) - Invert dependency graph
no_dedupeboolean, optional) - Repeat shared dependencies
prefixstring, optional) - How to display the tree
prunearray of strings, optional) - Prune packages from display
depthinteger, optional) - Maximum display depth
charsetstring, optional) - Character set (utf8, ascii)
bin_templateboolean, optional) - Use binary template
lib_templateboolean, optional) - Use library template
editionstring, optional) - Edition to set
openboolean, optional) - Open docs in browser
no_depsboolean, optional) - Don't fetch dependencies
document_private_itemsboolean, optional) - Document private items
querystring, required) - Package name to uninstall
limitinteger, optional) - Limit results (default: 10, max: 100)
versionstring, optional) - Specify version
git_urlstring, optional) - Git URL to install from
branch_installstring, optional) - Git branch
tag_installstring, optional) - Git tag
rev_installstring, optional) - Git commit
path_installstring, optional) - Local path
bin_installstring, optional) - Only uninstall specified binary
bins_installboolean, optional) - Install all binaries
example_installstring, optional) - Install only specified example
examples_installboolean, optional) - Install all examples
forceboolean, optional) - Force overwrite
no_trackboolean, optional) - Don't save tracking information
lockedboolean, optional) - Assert Cargo.lock unchanged
rootstring, optional) - Directory to uninstall from
indexstring, optional) - Registry index
listboolean, optional) - List installed packages
format_versioninteger, optional) - Format version

How to install the Cargo MCP Server

{
  "mcpServers": {
    "cargo-mcp": {
      "command": "/path/to/cargo-mcp/target/release/cargo-mcp",
      "args": []
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Example prompts to try

  • “Use Cargo MCP to check.”
  • “Use Cargo MCP to build.”
  • “Use Cargo MCP to clippy.”

Frequently asked questions

A Model Context Protocol (MCP) server that provides tools for managing Rust projects using the `cargo` command-line tool. Confirm the tools offered by your installed version in the connected client. Tool availability and permissions depend on the server and account configuration.