This MCP server fetches and presents documentation for Rust crates, providing essential context for Large Language Models working with Rust code. It connects to docs.rs to retrieve the latest documentation for any publicly available Rust crate, formats it for readability, and delivers it in a way that's optimized for LLM consumption.
# Clone the repository
git https://github.com/0xKoda/mcp-rust-docs.git
cd mcp-rust-docs
# Install dependencies
npm install
You can start the server directly with:
npm start
To integrate the server with Claude Desktop, add the following to your Claude Desktop configuration file (claude_desktop_config.json
):
{
"mcpServers": {
"rust-docs": {
"command": "node",
"args": ["/absolute/path/to/index.js"]
}
}
}
Be sure to replace /absolute/path/to/index.js
with the actual absolute path to the index.js file in the repository.
Once the server is running and configured with your AI assistant, you can ask questions such as:
The AI will use the lookup_crate_docs
tool to fetch and display the relevant documentation.
You can verify the server is working correctly using the MCP Inspector:
npx @modelcontextprotocol/inspector
Then select the "Connect to a local server" option and follow the prompts to test the functionality.
The server implements a single MCP tool called lookup_crate_docs
that:
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"mcpServers": {
"cursor-rules-mcp": {
"command": "npx",
"args": [
"-y",
"cursor-rules-mcp"
]
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.