# pyobfus-mcp [Health: Active]

**Category:** 💻 Developer Tools  
**Repository:** https://github.com/zhurong2020/pyobfus  
**GitHub Stars:** 11  
**Views:** 0  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/pyobfus-mcp

## Description
MCP tools for pyobfus — the Python obfuscator for AI-assisted development.

## Tools
Capabilities this server exposes over MCP:

- **protect_project** — One call to protect a Python project end-to-end AND verify it still works: scans risks, picks a framework-aware preset, obfuscates, then byte-compiles + import-smoke-tests the output in isolated subprocesses and returns verified:true/false. Writes a private de-obfuscation mapping alongside (not inside) the output. Use this when the user wants to 'protect/obfuscate before shipping' and expects a green check, not just a transform.
- **check_obfuscation_risks** — Scan a Python project for patterns that may break obfuscation (eval/exec, dynamic attribute access, framework reflection, unsafe model loading). Returns severity counts, detected frameworks (FastAPI/Django/Flask/Pydantic/Click/SQLAlchemy/ML), and a suggested preset. Also locates requirements*.txt / pyproject.toml and, only if verify_dependencies_online=true, checks each declared dependency against public PyPI to flag AI-hallucinated ('slopsquatting') package names -- off by default, this tool makes no outbound network calls unless you opt in. By default the scan honors the project's pyobfus config; set use_project_config=false for the legacy config-free scan.
- **generate_pyobfus_config** — Generate a pyobfus.yaml for a Python project. Auto-detects frameworks and applies the matching preset. By default returns the YAML text without writing to disk; set write=true to persist.
- **unmap_stack_trace** — Reverse obfuscated identifiers in a stack trace using a pyobfus mapping.json. Accepts the trace as plain text and the path to a mapping file produced by --save-mapping.
- **check_delivery** — Check an output directory or .whl right before shipping: fails on a pyobfus mapping file, a private key or an original source file inside it, and warns about Python files the build did not produce or Pro options the build skipped. Pass the build's --build-report and --provenance-manifest JSON for the full check. Read-only: files are hashed, never imported or executed, and contents are not returned.
- **list_presets** — List every pyobfus preset available, grouped by tier (community / framework-aware / Pro).
- **explain_preset** — Describe what a named preset changes: exclude names count, exclude patterns, preserve_param_names, docstring handling. For Pro presets, returns full pro_unlock metadata (trial command, checkout URL, price, money-back guarantee).
- **recommend_tier** — Analyze a Python project and recommend pyobfus tier (community vs Pro) with reasons. Combines a preflight scan with a sensitive-string-literal heuristic. Returns free_action and pro_action with concrete next-step commands.
- **start_pro_trial** — Return structured guidance for starting the 5-day pyobfus Pro trial. Does NOT invoke the side effect — the user runs `pyobfus-trial start` in their shell. Detects whether a trial is already active and surfaces the appropriate next step plus post-trial purchase URL.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `uvx` (confidence: high):

```json
"mcpServers": {
  "pyobfus-mcp": {
    "command": "uvx",
    "args": ["pyobfus-mcp"]
  }
}
```

## Documentation

## What pyobfus-mcp does

pyobfus-mcp exposes the pyobfus Python obfuscator as MCP tools for AI-assisted development workflows. It works with Python projects and packages, helping an agent inspect compatibility risks, create configuration, run protection, review delivery artifacts, and recover original identifiers from obfuscated stack traces.

The central workflow is `protect_project`. It scans the project, chooses a framework-aware preset, performs obfuscation, and validates the generated output by compiling bytecode and running import smoke tests in isolated subprocesses. The result includes a verification status and writes the de-obfuscation mapping beside the output rather than placing it in the shipped artifact.

## How it works

`check_obfuscation_risks` looks for constructs that commonly complicate obfuscation, including `eval` and `exec`, dynamic attribute access, framework reflection, and unsafe model loading. It reports severity counts, identifies supported frameworks such as FastAPI, Django, Flask, Pydantic, Click, SQLAlchemy, and ML tooling, and suggests a preset. It can inspect dependency declarations in `requirements*.txt` or `pyproject.toml`; public PyPI checks occur only when explicitly enabled.

Configuration generation uses the detected framework to produce a `pyobfus.yaml`. By default, the generated YAML is returned without changing the project, while `write=true` persists it. Project configuration is respected during risk scans unless the caller requests the legacy config-free behavior.

Obfuscation mappings remain separate from the protected output. `unmap_stack_trace` accepts plain-text trace data and a mapping file created by pyobfus, allowing obfuscated identifiers to be translated back for debugging. `check_delivery` inspects a directory or wheel without importing or executing files, hashes files during its read-only review, and checks for mappings, private keys, original source files, incomplete Python output, and skipped Pro options.

## Tools and capabilities

- `protect_project` builds and verifies an obfuscated Python project.
- `check_obfuscation_risks` finds compatibility risks and optionally checks declared package names against PyPI.
- `generate_pyobfus_config` creates framework-aware YAML configuration.
- `unmap_stack_trace` restores identifiers using a private mapping file.
- `check_delivery` reviews a directory or wheel before release.
- `list_presets` and `explain_preset` expose available presets and their behavior, including exclusions, parameter-name preservation, and docstring handling.
- `recommend_tier` compares Community and Pro options using a preflight scan and sensitive-string heuristic.
- `start_pro_trial` returns instructions for the five-day trial without starting it automatically.

## Limitations and notes

The server supports workflows built around pyobfus for Python 3.9 through 3.15. Community output remains ordinary Python and does not require pyobfus at runtime; commercial Pro features include additional protection and distribution controls.

Verification by `protect_project` covers byte compilation and import smoke tests, not the application's complete test suite. Run project-specific tests against the protected output before shipping. Delivery inspection is also bounded: it provides checks and warnings rather than proving an artifact is secure.

Dependency verification is opt-in and is the only described risk-scan behavior that contacts public PyPI. Keep mapping files private, because they enable restoration of original names. A new build should be paired with its newly generated mapping. Starting a Pro trial is deliberately not performed by the MCP tool; the developer must run the returned shell command.

_Full upstream README: https://allmcps.com/mcp/pyobfus-mcp/readme_

