About Rust MCP Server
Rust MCP Server is an MCP server published by yuunnn-w in the Files category: rust MCP Server is a high-performance Model Context Protocol (MCP) server implementation built with Rust. It provides a comprehensive set of tools for AI assistants to interact with the file system, execute commands, make HTTP requests, and more - all through a modern WebUI control panel.
The repository has 8 stars and 2 forks, with the last commit a month ago. Recent commit activity is the strongest signal that reported issues will get attention.
Install
git clone https://github.com/yuunnn-w/Rust-MCP-ServerThis server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.
Ask AI
Ask AI about Rust MCP Server
Powered by Claude · Grounded in docs
Security checks
Static checks derived from the repository yesterday. Heuristics on the source, not an audit.
- ✓README presentThe repository ships documentation.
- ✓License declaredUsable under a stated license.
- ✓Tests presentA test suite exists in the repository.
- !Dependencies pinnedNo lockfile. Installs can pull different code over time.
- !No dynamic code executionSource scan found eval or shell execution. Review how tool inputs reach it before granting credentials.
1 check has not been run yet.
Releases
README
Rust MCP Server
Overview
Rust MCP Server is a high-performance Model Context Protocol (MCP) server implementation built with Rust. It provides a comprehensive set of tools for AI assistants to interact with the file system, execute commands, make HTTP requests, and more - all through a modern WebUI control panel.
Demo Screenshots
Features
Core Features
- 20 Built-in Tools: File operations, Office document support via a dedicated
Officetool (27 operations over .docx/.pptx/.xlsx/.pdf/.ipynb, including PDF page operations, encrypted-PDF read/edit and markdown→PDF creation), PDF page-to-image rendering with an embedded PDFium payload (chromium/7881) and a pdfium → pdftoppm → embedded-image fallback chain, HTTP requests, full Git operations on a built-in libgit2 engine (read/write/network, no system git required), Python execution (embedded RustPython; 48 frozen third-party pure-Python distributions), archive, diff, note storage, task management, web search, notebook editing, command monitoring, and more - Tool Presets: 6 built-in presets (minimal, coding, data_analysis, system_admin, research, full_power) for one-click tool configuration
- System Prompt: Custom instructions appended to MCP
initializeresponse via--system-promptor WebUI - WebUI Control Panel: Cyberpunk AI Command Center theme with glassmorphism HUD, animated background, terminal log stream, and 3D card tilt effects
- Real-time Updates: SSE-based live status updates in WebUI
- System Metrics: Real-time CPU, memory, and load monitoring via HUD and
/api/system-metricsendpoint - Streamable HTTP Transport: the only transport; stateless + JSON responses; the legacy SSE transport was removed in 0.5.0
- Concurrency Control: Configurable max concurrent tool calls
- Internationalization: Support for English and Chinese
Security Features
- Working Directory Restriction: Write operations restricted to configured directory; read-only tools can access any path (intentional design for system-level code analysis)
- Dangerous Command Blacklist: 20 configurable dangerous command patterns
- Script Execution Heuristics: Flags script-file wrappers and evasion forms
- Two-Step Confirmation: Dangerous and script-like commands require user confirmation
- Audit Logging: All command executions are logged
- Injection-Pattern Detection Removed: Shell operators (
;,|,&, command substitution, redirection) no longer trigger confirmation — an accepted design trade-off
Available Tools
File Operations (Safe / Enabled by Default)
The following read-only tools are not restricted to the working directory:
| Tool | Description | Dangerous |
|---|---|---|
Glob |
List directory contents with enhanced filtering (max depth 10). Multi-pattern glob/regex matching, exclude patterns, file type/size/time filters, and offset paging ([Next page: offset=N] footer with a drift hint). |
No |
Read |
Read a text file or image. Modes: auto/text/media. Text mode handles UTF-8/UTF-16 (BOM sniffing plus a BOM-less heuristic) with an encoding line, column_offset long-line continuation, an always-printed status line and max_chars capped at 500000. Media mode returns base64-encoded image content for vision models (e.g., llama.cpp): BMP/TIFF/ICO are auto-converted to PNG when decodable (SVG/AVIF/HEIC return conversion guidance), single images over 8 MB are rejected with guidance, and meta carries delivered_format/converted_from/hint. Office documents (DOCX/PPTX/XLSX/PDF/IPYNB) are handled by the Office tool. |
No |
Grep |
Search pattern in files with enhanced filtering. Regex, whole-word, multiline, office document search; glob (with file_pattern as a deprecated alias) / include / exclude filters, offset paging and output_mode="count" per-file counts. |
No |
File Operations (Dangerous / Disabled by Default)
The following write operations are restricted to the working directory:
| Tool | Description | Security Check |
|---|---|---|
Edit |
Multi-mode text editing in one batch: string_replace, line_replace, insert, delete, patch (1-based line numbers). Office document editing (DOCX/PPTX/XLSX/PDF) is handled by the Office tool, which returns migration guidance for office extensions. |
Working directory check |
Write |
Write text files via files (mode: new/overwrite/append). Text-only: writing to office extensions is refused with migration guidance pointing at the Office tool. |
Working directory check |
FileOps |
Copy, move, delete, or rename files and directories. dry_run preview, conflict_resolution. | Working directory check |
System & Network Tools
| Tool | Description | Default Status |
|---|---|---|
Bash |
Execute shell commands with working_dir, stdin, env, async_mode, description and disable_timeout. A synchronous timeout is converted into a background command tracked by Monitor instead of killing the process. |
Disabled |
SystemInfo |
Get system information with sections parameter (includes processes). | Disabled |
Git |
Run git commands (status, diff, log, show, branch, tag, blame, init, add, commit, config, checkout, merge, reset, stash, remote, clone, fetch, pull, push) on a built-in libgit2 engine — no system git install required (`engine=auto | libgit2 |
ExecutePython |
Execute Python code or a .py script in an embedded RustPython interpreter (no CPython dependency): code/script_path (mutually exclusive), args/stdin/timeout (seconds)/working_dir/env/max_output_chars, real sys.argv/__main__/exit_code semantics, 48 frozen third-party pure-Python distributions, and a filesystem-access toggle for sandbox mode. |
Enabled |
Utility Tools
| Tool | Description |
|---|---|
Archive |
Create, extract, list, or append archives: ZIP (deflate/zstd/bzip2 + AES-256), tar family (tar/tar.gz/tgz/tar.zst/tar.xz/tar.bz2), single-stream (gz/xz/bz2/zst), and 7z (LZMA2 + AES-256, no append); non-UTF-8 ZIP names are decoded (UTF-8 → GBK → CP437) |
Diff |
Compare text, files, or directories. ignore_blank_lines, multiple output formats |
NoteStorage |
AI short-term memory scratchpad with export/import (auto-clears after 30min) |
Task, Web & Interaction Tools
| Tool | Description | Default Status |
|---|---|---|
Task |
Unified task management (create/list/get/update/delete via operation parameter) | Disabled |
WebSearch |
Search the web through a configurable backend — duckduckgo (default; region/language filters apply to this backend only) or moonshot (remote API, falling back to DuckDuckGo on any failure); results are short snippets with a citation note, the response names the backend that served them, and errors are classified (timeout/network/authentication/other) |
Enabled |
WebFetch |
Fetch a public http/https URL with extract_mode (text/html/markdown); text/plain/text/markdown bodies are returned verbatim, other pages yield their main article text (whole-page fallback above 8 MB or when no article is found); redirects (301/302/303/307/308) are followed for up to 5 hops with every hop re-validated and re-pinned (private/loopback/non-http(s) targets are still refused) |
Enabled |
AskUser |
Prompt user for input or confirmation with timeout and default_value; requires client MCP elicitation support | Disabled |
Office & Monitoring Tools
| Tool | Description | Default Status |
|---|---|---|
Office |
Create, read, and edit Office documents (DOCX/PPTX/XLSX/PDF/IPYNB) with 27 operations; family-scoped read_mode (outline, comments, info, layouts, paragraph, search), DOCX structured content and deep formatting (paragraph-index anchoring, table options, merged-cell addressing), PPTX elements plus package-level slide editing (add/move/notes/delete, placeholder filling, insertion-time image transforms, set_chart_data), and PDF support (encrypted input, page operations, Info metadata, text insertion with a CJK font subset, markdown→PDF creation); read paths are unrestricted, create/edit paths are restricted, creation refuses to overwrite, and parameters are scoped to their operation |
Disabled |
NotebookEdit |
Read, write, and edit Jupyter .ipynb notebook files | Enabled |
Monitor |
Monitor long-running Bash commands (stream, wait, signal) | Enabled |
Quick Start
Installation
Option 1: Download Pre-built Binary
Download the latest release from GitHub Releases.
Option 2: Build from Source
# Clone the repository
git clone https://github.com/yuunnn-w/Rust-MCP-Server.git
cd Rust-MCP-Server
# Build using the provided script
# On Linux/macOS:
./scripts/build-unix.sh
# On Windows:
.\scripts\build-windows.bat
# Or build manually with cargo
cargo build --release
Note: PDF page rendering embeds a PDFium payload for Windows x64/x86 builds (
assets/pdfium/{x64,x86}/pdfium.dll.zst, chromium/7881). Other targets (including ARM64, Apple Silicon and ARM64 Linux) build with an empty payload and fall back to pdftoppm/embedded-image extraction at runtime.
Asset Dependencies
The project includes several pre-bundled assets and relies on build.rs to auto-download others at build time. Below is a complete reference.
Bundled Assets (committed to git)
| Path | Purpose | Source |
|---|---|---|
assets/vc-ltl/x64/*.lib |
VC-LTL5 CRT replacement for Win7 x64 | VC-LTL5 v5.3.1 |
assets/vc-ltl/x86/*.lib |
VC-LTL5 CRT replacement for Win7 x86 | Same |
assets/yy-thunks/YY_Thunks_for_Win7.obj |
Win8+ API stubs for Win7 x64 | YY-Thunks v1.2.2 |
assets/yy-thunks/YY_Thunks_for_Win7_x86.obj |
Win8+ API stubs for Win7 x86 | Same |
assets/icon.ico, assets/icon.png |
Application icons | — |
assets/pdfium/x64/pdfium.dll.zst, assets/pdfium/x86/pdfium.dll.zst |
PDFium payload embedded into the binary (PE subsystem rewritten to 6.1, SHA256-pinned; used for PDF page rendering) | pdfium-binaries chromium/7881 |
Build-Time PDFium Pipeline (build.rs)
| Step | What happens |
|---|---|
| 1. Restore | Extract assets/pdfium/{arch}/pdfium.dll from the committed .zst when the working DLL is absent (offline-capable) |
| 2. Download (fallback) | Only when neither the DLL nor the .zst is present: fetch the pinned archive (3 attempts, SHA256 checked) |
| 3. Rewrite | Patch the PE subsystem version to 6.1 (idempotent) and read it back to confirm the write stuck |
| 4. Verify | Compare the rewritten DLL against a hard-coded SHA256 sentinel; an unexpected payload aborts the build |
| 5. Embed | Re-compress to .zst when its content does not match the sentinel, decompress-read-back, and emit OUT_DIR constants consumed by the runtime loader |
- A downloaded archive is a build cache, not a source file: only the
.dll.zstpayloads are committed to git, and the working.dllis ignored. - Missing assets fail the build with an actionable message (exact path, upstream URL, expected hash). Set
RUST_MCP_PDFIUM_OPTIONAL=1to build without the payload deliberately (the runtime then degrades to the fallback chain). - At runtime the payload is extracted to a per-user temp cache directory, re-hashed on every install (including cache hits), and rejected on any mismatch.
Note: If the fallback download fails (e.g., no network, GitHub rate limit),
build.rsprints the same actionable instructions; you can also place the DLL or its.tgzarchive inassets/pdfium/{arch}/manually.
Windows 7 Compatibility Assets (Required for Win7 Target Only)
Only needed when building with --target x86_64-win7-windows-msvc:
| Path | Download |
|---|---|
assets/vc-ltl/{x64,x86}/*.lib |
VC-LTL5 Binary v5.3.1 — extract TargetPlatform/6.0.6000.0/lib/{x64,Win32}/ |
assets/yy-thunks/YY_Thunks_for_Win7.obj |
YY-Thunks-Objs.zip v1.2.2 — extract objs/x64/YY_Thunks_for_Win7.obj |
assets/yy-thunks/YY_Thunks_for_Win7_x86.obj |
Same archive — extract objs/x86/YY_Thunks_for_Win7.obj |
Windows 7 Compatibility
The server can run natively on Windows 7 without third-party compatibility layers (e.g., VxKex). This is achieved through two embedded compatibility layers:
- VC-LTL5 v5.3.1 (
assets/vc-ltl/) — replaces the UCRT/VCRUNTIME CRT withmsvcrt.dll, eliminatingapi-ms-win-crt-*andVCRUNTIME140.dllimports that don't exist on Windows 7 - YY-Thunks v1.2.2 (
assets/yy-thunks/) — provides runtime stubs for Windows 8+ APIs (e.g.,GetSystemTimePreciseAsFileTime,WaitOnAddress,ProcessPrng), falling back to older equivalents
Both are injected at link time via build.rs. The project is fully self-contained — no external downloads required.
To build for Windows 7:
rustup update nightly
cargo +nightly build -Z build-std=std,panic_abort --target x86_64-win7-windows-msvc --release
Note: On Windows 7, the
system_infotool automatically returns limited information (CPU, memory, and OS basics) and skips disk, network, and hardware temperature enumeration to avoid compatibility issues with thesysinfocrate.
Usage
# Start with default settings (HTTP transport + WebUI)
./rust-mcp-server
# Start with custom WebUI port
./rust-mcp-server --webui-port 8080
# Enable dangerous commands (by ID)
./rust-mcp-server --allow-dangerous-commands 1,2
# See all options
./rust-mcp-server --help
Access WebUI
Once started, open your browser:
http://127.0.0.1:2233
Browser requirement: the WebUI requires a modern browser with ES2020 support (Chrome 79+ / Edge 79+). On Windows 7, please use a recent Chromium-based browser; older browsers (e.g. IE11) will only show an upgrade prompt instead of the interface.
Configuration
Command Line Options
| Option | Environment Variable | Default | Description |
|---|---|---|---|
--webui-host |
MCP_WEBUI_HOST |
127.0.0.1 |
WebUI listening address |
--webui-port |
MCP_WEBUI_PORT |
2233 |
WebUI listening port |
--mcp-host |
MCP_HOST |
127.0.0.1 |
MCP service address |
--mcp-port |
MCP_PORT |
3344 |
MCP service port |
--max-concurrency |
MCP_MAX_CONCURRENCY |
10 |
Max concurrent calls |
--working-dir |
MCP_WORKING_DIR |
. |
Working directory for file ops |
--preset |
MCP_PRESET |
minimal |
Startup tool preset: minimal/coding/data_analysis/system_admin/research/full_power/none |
--system-prompt |
MCP_SYSTEM_PROMPT |
- | Custom system prompt appended to MCP instructions |
--disable-tools |
MCP_DISABLE_TOOLS |
See below | Tools to disable on top of preset |
--allow-dangerous-commands |
MCP_ALLOW_DANGEROUS_COMMANDS |
- | Allow dangerous command IDs |
--log-level |
MCP_LOG_LEVEL |
info |
Log level: trace/debug/info/warn/error |
--disable-webui |
- | - | Disable WebUI panel |
--allowed-hosts |
MCP_ALLOWED_HOSTS |
- | Custom allowed Host headers (comma-separated) |
--disable-allowed-hosts |
MCP_DISABLE_ALLOWED_HOSTS |
- | Disable DNS rebinding protection (not recommended for public) |
--webui-token |
MCP_WEBUI_TOKEN |
- | Bearer token for protecting mutating WebUI endpoints |
--custom-shell-enabled |
MCP_CUSTOM_SHELL_ENABLED |
- | Allow Bash tool to use custom shell_path / shell_arg |
--web-search-provider |
MCP_WEB_SEARCH_PROVIDER |
duckduckgo |
Web search backend: duckduckgo (default, no API key) or moonshot (remote API, falls back to DuckDuckGo on failure) |
--moonshot-search-url |
MCP_MOONSHOT_SEARCH_URL |
- | Full URL of a Moonshot-compatible search endpoint (POST {"text_query": ...} with Bearer auth) |
--moonshot-api-key |
MCP_MOONSHOT_API_KEY |
- | Moonshot API key (sensitive: never written to config.json, never logged, never echoed) |
Configuration Persistence: The server loads configuration from multiple sources with the following priority (highest to lowest):
- CLI arguments — explicitly provided flags always take precedence
config.jsonin the executable directory — loaded if present, but only fields explicitly present in the file override lower-priority sources- Environment variables — used when neither CLI nor config.json provides a value
- Built-in defaults — lowest priority
Runtime changes made via the WebUI or API are persisted to config.json immediately.
Tool Presets:
The server starts with the minimal preset by default. Use --preset <name> to choose a different preset, or --preset none to skip auto-applying.
- minimal (7 tools): Safe read-only tools + sandboxed Python
- coding (18 tools): Development-focused, includes file editing, task management, and command execution
- data_analysis (14 tools): Data analysis, includes Python, diff, archive, and web tools
- system_admin (17 tools): System administration, includes system info, processes, commands, and file operations
- research (9 tools): Research and documentation, includes web search, web fetch, and file reading
- full_power (20 tools): All tools enabled
Dangerous Command IDs
The following commands are blocked by default and require explicit permission:
| ID | Linux Command | Windows Command |
|---|---|---|
| 1 | rm (delete) |
- |
| 2 | del (delete) |
- |
| 3 | format |
format |
| 4 | mkfs |
- |
| 5 | dd |
- |
| 6 | Fork bomb (`:(){: | :&};:`) |
| 7 | eval |
- |
| 8 | exec |
- |
| 9 | system |
- |
| 10 | shred |
- |
| 11 | - | rd /s (delete tree) |
| 12 | - | format (Windows) |
| 13 | - | diskpart |
| 14 | - | reg (registry) |
| 15 | - | net (network) |
| 16 | - | sc (services) |
| 17 | - | schtasks |
| 18 | - | powercfg |
| 19 | - | bcdedit |
| 20 | - | wevtutil |
Enable with: --allow-dangerous-commands 1,3,5
Security
Command Execution Security
The Bash tool implements multiple security layers:
- Working Directory Restriction: Commands can only operate within the configured working directory
- Dangerous Command Blacklist: Blocks known dangerous commands (see list above)
- Script Execution Heuristics: Flags interpreter/script-file wrappers (e.g.
sh evil.sh,cmd /C evil.bat,source file,. file, commands starting with backticks) and evasion forms (bare tabs, wide Unicode whitespace,$IFS) - Two-Step Confirmation: Commands hitting the blacklist or heuristics require user confirmation via repeated call
- Audit Logging: All commands are logged with timestamp and result
Command injection pattern detection (shell metacharacters such as ;, |, &, backticks, $) has been removed by design — commands containing these operators generally execute directly without confirmation. Also, the blacklist is mostly anchored on the leading prefix (a few pure-substring patterns, such as the fork bomb, are not position-limited), so a dangerous primitive not in first position (e.g. echo ok; rm -rf /) is not caught by it; mitigations remain: [AUDIT] logging for every command, Bash disabled by default, and WebUI tool toggling.
WebUI Authentication
When --webui-token is configured, most WebUI endpoints require an Authorization: Bearer <token> header (Bearer prefix is case-insensitive). The following endpoints remain open without authentication:
GET /api/tools— list all toolsGET /api/status— tool status alias (deprecated, use/api/v1/tools)GET /api/tool-presets— list presetsGET /api/python-fs-access— check Python FS access statusGET /api/v1/events— SSE stream
All other endpoints (including most GET endpoints such as /api/config, /api/system-metrics, /api/tool/{name}/stats, /api/version, and all mutating endpoints) require a valid Bearer token.
File Operation Security
Read-only tools (Glob, Read, Grep, Office read) and the Git tool's read actions can access paths outside the working directory. This is intentional design to facilitate system-level code analysis. Git write/network actions are restricted to the working directory and disabled by default; write/edit/delete tools remain strictly restricted to the working directory:
- Path traversal attacks (
../etc/passwd) are blocked for write operations - Symbolic link escaping is prevented for write operations
- Absolute paths outside working directory are rejected for write operations
Example Security Flow
User: Bash("rm -rf /")
Server: "Security Warning: Dangerous command 'rm (delete files)' detected.
This command may cause damage to the system or data.
Please confirm with the user whether to execute this command.
If the user agrees, please call the Bash tool again."
User: Bash("rm -rf /") [Second call within 5 minutes]
Server: [Command executed after confirmation]
Documentation
- API Documentation - REST API reference
- Architecture - System architecture and design
- User Guide - Detailed user guide
- Security Guide - Security features and best practices
- Windows 7 Compatibility Guide - Building native Windows 7 binaries (VC-LTL5 + YY-Thunks), principles-first
- Contributing - Contribution guidelines
Development
Project Structure
Rust-MCP-Server/
├── src/
│ ├── main.rs # Entry point
│ ├── config.rs # Configuration management
│ ├── mcp/
│ │ ├── handler.rs # MCP protocol handler
│ │ ├── state.rs # Shared server state
│ │ └── tools/ # Tool implementations
│ ├── utils/ # Utility functions (file, image, system metrics, office conversion)
│ │ ├── office_converter.rs # Office document conversion (docx-rs, lopdf, calamine, LibreOffice)
│ │ ├── office_utils.rs # Office document utility functions
│ └── web/ # WebUI and HTTP API
├── scripts/ # Build scripts
├── docs/ # Documentation
├── README.md # This file
├── README-zh.md # Chinese README
└── LICENSE # GPL v3.0 License
Testing with llama.cpp
You can test the MCP server using llama.cpp's llama-server which supports MCP via WebUI configuration.
# 1. Start the MCP server
./rust-mcp-server --mcp-port 8080
# 2. Start llama-server
llama-server -m your-model.gguf
# 3. Open llama.cpp WebUI, go to Settings and configure MCP server URL
# (e.g., http://localhost:8080)
# 4. Enable MCP tools and start chatting
Note: llama.cpp provides experimental MCP CORS proxy support via
--webui-mcp-proxyflag. See llama.cpp documentation for details and security considerations.
Building Documentation
cargo doc --no-deps --open
Changelog
See CHANGELOG.md for version history and changes.
Contributing
Contributions are welcome! Please read our Contributing Guidelines before submitting PRs.
License
This project is licensed under the GPL v3.0 License - see the LICENSE file for details.
Acknowledgments
- Model Context Protocol - The protocol specification
- rmcp - Official Rust MCP SDK
- Axum - Web framework for Rust
- Tokio - Async runtime for Rust
Support
- GitHub Issues: Report bugs or request features
- GitHub Discussions: Ask questions or share ideas
README fetched from the repository yesterday. The original is authoritative.