Get the FREE Ultimate OpenClaw Setup Guide →

rust

MCP server from MythEclipse/rust-mcp-server

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio mytheclipse-rust-mcp-server docker run -i mytheclipse/rust-mcp-server:latest

How to use

This Rust MCP server provides AI-assisted code analysis for Rust projects, including file syntax checking, workspace indexing, code navigation, smell detection, and automated refactoring suggestions. It exposes MCP-compatible JSON-RPC 2.0 tools that a client (such as an AI coding assistant) can call over stdio when running the server. Available tools include: check_file for syntax verification of a single Rust file, index_workspace to build call graphs, type usage graphs, and module dependencies across a workspace, goto_definition to locate symbol definitions, and find_references to enumerate all usages of a symbol. Typical usage involves starting the server, then issuing JSON-RPC requests to perform analysis, retrieve structural information, and receive actionable insights to improve Rust code quality and maintainability.

How to install

Prerequisites:

  • Docker and Docker Compose (recommended for deployment and experiments)
  • Git (optional, for cloning the repository)
  • Rust toolchain (for building from source, Rust 1.70+)

Docker Hub install (recommended):

  1. Pull and run: docker run --rm -i mytheclipse/rust-mcp-server:latest

  2. With workspace mounting (for analyzing local projects): docker run --rm -i -v $(pwd):/workspace mytheclipse/rust-mcp-server:latest

  3. Run in the background: docker run -d --name rust-mcp-server mytheclipse/rust-mcp-server:latest docker stop rust-mcp-server && docker rm rust-mcp-server

Development setup (optional):

  1. Clone the repository and navigate to it: git clone https://github.com/MythEclipse/rust-mcp-server.git cd rust-mcp-server

  2. Run with Docker Compose (development): docker-compose up --build

  3. Build and run manually: docker build -t rust-mcp-server . docker run --rm -i rust-mcp-server

Manual build from source (advanced): Prerequisites:

  • Rust 1.70+ (2024 edition)
  • Cargo

Build from source:

git clone https://github.com/MythEclipse/rust-mcp-server.git
cd rust-mcp-server
cargo build --release
./target/release/rust-mcp-server

If you prefer to run locally without Docker, you can run the binary directly after building.

Additional notes

Tips and notes:

  • The MCP communication is JSON-RPC 2.0 over libstdio. When running in Docker, ensure the client connects to the container's STDIN/STDOUT streams.
  • The server performs extensive Rust code analysis, including function complexity checks, unused code detection, and refactoring suggestions. When indexing a large workspace, expect longer indexing times.
  • If you see missing type information or symbol resolution issues, ensure the workspace is correctly mounted and that the analyzer has access to all source files within the workspace root.
  • For production deployments, prefer the Docker image which is configured with Rust nightly to support the latest MCP SDK features.
  • If you customize or extend analysis features, keep your local Rust toolchain in sync with the nightly version used by the image to avoid compatibility issues.

Related MCP Servers

Sponsor this space

Reach thousands of developers