Obfuscation breaks on eval, reflection and framework magic, and it breaks quietly — the transform succeeds and the import fails much later. protect_project byte-compiles and import-smoke-tests the output and answers verified true or false, and the mapping file is what turns the resulting production stack trace back into something a person can read.
The MCP server for pyobfus, an AST-based Python obfuscator. It scans a project for the patterns that break obfuscation, picks a framework-aware preset, obfuscates, then byte-compiles and import-smoke-tests the output before reporting back.
- protect_project runs the whole pipeline — scan, preset, obfuscate, then byte-compile and import-smoke-test in isolated subprocesses — and returns verified true or false
- check_obfuscation_risks flags eval and exec, dynamic attribute access, framework reflection and unsafe model loading, and names the frameworks it detected (FastAPI, Django, Flask, Pydantic, Click, SQLAlchemy, ML)
- generate_pyobfus_config writes a pyobfus.yaml matched to the detected framework, returning the text unless write=true
- unmap_stack_trace reverses obfuscated identifiers in a production trace using a mapping.json produced by --save-mapping
- list_presets and explain_preset show what a preset actually changes — excluded names, excluded patterns, preserve_param_names, docstring handling
- recommend_tier analyses the project and returns concrete next-step commands; start_pro_trial returns the guidance without triggering anything
The pyobfus-mcp package from PyPI over stdio — uvx pyobfus-mcp needs no install, or pip install pyobfus-mcp. It is registered as io.github.zhurong2020/pyobfus-mcp. No account or key. The server makes no outbound calls by default; the PyPI dependency lookup only runs when verify_dependencies_online=true. unmap_stack_trace needs a mapping file, which exists only if the build ran with --save-mapping. Some presets are Pro; the trial is started by running pyobfus-trial start in your own shell, not by the server.
One command — uvx pyobfus-mcp
