| Crates.io | copilot |
| lib.rs | copilot |
| version | 0.0.2 |
| created_at | 2025-12-16 10:19:40.383549+00 |
| updated_at | 2025-12-16 20:21:19.236166+00 |
| description | MCP Server for Cargo |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1987490 |
| size | 68,136 |
MCP Server for Rust
cargo-copilot is a Model Context Protocol (MCP) server that gives LLMs access
to your local Cargo workspace context and documentation.
Install the binary:
cargo install copilot
Configure .vscode/mcp.json:
{
"servers": {
"cargo-copilot": {
"command": "cargo",
"args": ["copilot"]
}
}
}
cargo-copilot allows the LLM to inspect dependencies and read local
documentation generated by cargo doc.
| Tool | Description |
|---|---|
cargo_dependencies |
Lists all available dependencies in the current workspace as crate ids (name@version). Useful for discovering what packages are available to inspect. |
cargo_doc_overview |
Fetches the main documentation page for a specific crate. It runs cargo doc --package <name> --no-deps internally to ensure docs are available. |
cargo_doc_index |
Lists all symbols (modules, macros, structs, enums, functions, types) found in a crate's generated documentation. |
cargo_doc_get |
Retrieves the full documentation for a specific symbol (e.g., de/struct.Deserializer) as Markdown. |
To get the best results, provide the following system prompt to your LLM:
# CRITICAL: cargo-copilot Tool Usage
You have access to the `cargo-copilot` MCP server. Follow this strict workflow
to answer questions about the codebase:
1. **Discovery**: Use `cargo_dependencies` to see available crates.
2. **Overview**: Use `cargo_doc_overview` to understand a crate's purpose.
3. **Lookup**: Use `cargo_doc_index` to find the generated documentation
location for a symbol.
4. **Retrieval**: Use `cargo_doc_get` to read the documentation.
**IMPORTANT CONSTRAINT**: Generated documentation paths (HTML) often differ from
logical Rust module paths due to re-exports.
- **NEVER guess** the `symbol_path` argument for `cargo_doc_get`.
- **ALWAYS** copy the `symbol_path` strictly verbatim from the output of
`cargo_doc_index`.
- If a path like `model/struct.ServerInfo.html` fails, it means the symbol is
documented elsewhere (e.g. `handler/server/struct.ServerInfo.html`). You must
check the index.
MIT. Use it for whatever.