Depyler MCP
A Python-to-Rust transpiler with an MCP server: agents estimate migration effort, translate modules and verify the output.
- 366 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The agent runs the transpiler and compiler on project files; output is written to disk and needs testing.
Install
- Works in
Manual install
cargo install depylerThe first Installation command in the README. Requires Rust 1.83 or newer.
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The agent runs the transpiler and compiler on project files; output is written to disk and needs testing.
This is third-party code. Review the repository files before installing.
What it does
Depyler translates annotated Python into idiomatic Rust while preserving program behavior. `depyler compile script.py` builds a standalone binary, and `depyler transpile example.py --verify` produces Rust code with verification. The MCP server exposes four tools to an agent: `transpile_python`, `analyze_migration_complexity`, `verify_transpilation` and `pmat_quality_check`. The agent estimates project migration effort, translates files, checks equivalence and reviews the quality of the generated Rust.
Who it is for. Developers moving Python services and scripts to Rust for speed and memory safety who want an agent to take over the translation routine.
Good fit when
- Before migrating a project you need an estimate: how many lines of Rust result and which components are hardest to port.
- A script with type annotations becomes a standalone binary with `depyler compile`.
- An agent translates a module and immediately checks the result against the original Python with `verify_transpilation`.
- Generated Rust is reviewed for complexity and technical debt with `pmat_quality_check`.
Not a fit when
- The code relies on `eval`, `exec`, reflection, multiple inheritance or monkey patching: the README lists them as unsupported.
- Python code without type annotations, where types would have to be guessed.
- A fully automatic port of a large application is expected: about 80% of the project's own examples compile on the first pass.
Example request
Estimate how hard it is to port this Python project to Rust, then translate `main.py` and verify that the result is equivalent.MCP
- Transport
- stdio
- Authentication
- not required
Environment variables
`RUST_LOG`- Server log level, `info` in the sample configuration.
Limitations
The transpiler works on Python marked up with type annotations. Dynamic features (`eval`, `exec`, reflection, multiple inheritance, monkey patching) are not supported. By the project's own measurements, 80% of internal examples compile on the first pass (256 of 320), and only 47.5% on the algorithms corpus. Build and test the result instead of trusting it. Installation needs Rust 1.83 or newer, and test validation needs Python 3.8 or newer. The quality metrics in the README are published by the project itself.
How to disable. Remove the `depyler` block from the MCP client configuration and restart the client. Remove the package installed through Cargo with the standard Cargo command.
FAQ
Which MCP tools are available?
Four. `transpile_python` translates code, `analyze_migration_complexity` estimates migration effort, `verify_transpilation` checks equivalence, and `pmat_quality_check` reviews complexity and technical debt.
How do I build a binary without MCP?
Run `depyler compile script.py` and start `./script`. `-o my_app` sets the output name, and `--profile debug` selects a debug build.
What if the Rust output does not compile?
Run `depyler transpile example.py --explain` or `--trace`: the commands show the transpiler's decisions. Then check the code for unsupported features.
Are type annotations required?
Yes. Rust types are built from Python annotations, so add them before translating.
How do I connect the server to a client?
Add a `depyler` entry to `claude_desktop_config.json` with the command `depyler` and the arguments `agent start --foreground --port 3000`, then restart the client.
Discussion
No questions or reviews yet.
Related
MCP serversrust-analyzer MCP: Rust code navigation for agents
r3bl-rust-analyzer-mcp-server
A Rust MCP server on standard threads: the agent gets hover info, go to definition, references, formatting and compiler diagnostics from rust-analyzer
A Rust binary that doubles as an MCP server: complexity, tech debt, dead code and repository context for Claude Code and Cline.
Rust documentation MCP server: an agent searches crate items, reads source code and inspects the dependency tree.
Three skills and a clippy config: an agent writes, reviews and ports idiomatic Rust, and CI enforces the checkable rules
A Rust binary for agents and the terminal that uses tree-sitter to find a symbol's definition, its calls and file dependencies
A local code graph with version history: an MCP server that tells the agent who calls a function and what an edit breaks
README in short
Version 4.1.1 covers translating annotated Python to Rust, property-based behavior checks and support for 27 standard-library modules. A separate MCP guide lives in `docs/MCP_QUICKSTART.md`.