pyobfus-mcp — MCP server for Claude Code: Python obfuscation
Hands your agent nine pyobfus tools: risk scanning, config generation, obfuscation with a self-check, and traceback decoding. Useful when Python code leaves your machine.
claude mcp add pyobfus-mcp -- uvx pyobfus-mcpWhat pyobfus-mcp does
The server plugs into any client that speaks Model Context Protocol. Nine tools sit inside. protect_project runs the whole chain in one call: it scans for risks, picks a framework-aware preset, obfuscates, then compiles the result and smoke-tests the import in separate subprocesses, reporting verified and confidence. A private mapping.json is written next to the output, never into it.
Other tools cover single steps. check_obfuscation_risks looks for eval/exec and dynamic attribute access, generate_pyobfus_config produces pyobfus.yaml, unmap_stack_trace turns obfuscated names in a production traceback back into readable ones, and check_delivery inspects a build directory or .whl for a leaked key or original sources. list_presets, explain_preset, recommend_tier and start_pro_trial help you choose a mode.
Because verify_cmd in protect_project runs an arbitrary command, it stays off until you set PYOBFUS_MCP_ALLOW_VERIFY_CMD=1. Dependency-name checks against public PyPI are opt-in too — outbound network access is closed unless you pass verify_dependencies_online=true. check_delivery needs pyobfus >=0.7.1; on an older core it returns FeatureUnavailable.
What it helps with
- scan a project for
evaland reflection before obfuscating - produce a
pyobfus.yamlfor FastAPI without hand-tuning options - confirm the obfuscated code compiles and imports
- decode identifiers in a production stack trace from
mapping.json - catch a key or original source left inside a distribution
Example prompts for the agent
- Check
/Users/me/code/my-apifor obfuscation risks and suggest a preset - Generate
pyobfus.yamlfor this project and write it to disk - Here is a traceback from prod — reverse the names using
mapping.json
How to install pyobfus-mcp
Platform CLI
claude mcp add pyobfus-mcp -- uvx pyobfus-mcpuvx runs the command named after the package; if the README names another one, use uvx --from pyobfus-mcp <command>
Platform CLI
codex mcp add pyobfus_mcp -- uvx pyobfus-mcpuvx runs the command named after the package; if the README names another one, use uvx --from pyobfus-mcp <command>
Config file
{
"mcpServers": {
"pyobfus_mcp": {
"command": "uvx",
"args": [
"pyobfus-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from pyobfus-mcp <command>
Config file
{
"servers": {
"pyobfus_mcp": {
"type": "stdio",
"command": "uvx",
"args": [
"pyobfus-mcp"
]
}
}
}uvx runs the command named after the package; if the README names another one, use uvx --from pyobfus-mcp <command>
Platform CLI
gemini mcp add pyobfus_mcp uvx pyobfus-mcpuvx runs the command named after the package; if the README names another one, use uvx --from pyobfus-mcp <command>
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about pyobfus-mcp
How do I install pyobfus-mcp in Claude Code?
Run claude mcp add pyobfus-mcp -- uvx pyobfus-mcp. The package is fetched through uvx on first run, so no separate install step is needed.
What does pyobfus-mcp do?
It exposes nine pyobfus tools to your agent: risk scanning, config generation, obfuscation with a verification step, traceback decoding, and delivery checks.
Does it need an API key or network access?
No key is required. Outbound requests stay off until you ask for dependency-name verification against public PyPI.