MCP server and CLI/TUI utility for safe code obfuscation before LLM usage and reverse application of LLM changes back to your project.
sequenceDiagram
actor User
participant CodeObfuscator as code obfuscator
participant AgentIDE as Agent IDE (Codex)
participant LLM
User->>CodeObfuscator: Prepare full project in obfuscated form
CodeObfuscator->>CodeObfuscator: Obfuscate selected project files
CodeObfuscator-->>AgentIDE: Return obfuscated project context
AgentIDE->>LLM: Send obfuscated context for implementation
sequenceDiagram
actor User
participant IDE as Agent IDE (Codex)
participant MCP as MCP server
participant LLM
participant Project as Project / root_dir
User->>IDE: Request a code change
IDE->>MCP: ls_tree / pull(..., options.request_id) or clone(..., options.request_id)
MCP->>Project: Read source files
Project-->>MCP: Source files
MCP-->>IDE: obfuscated_files
IDE->>LLM: Send obfuscated_files only
LLM-->>IDE: Return modified obfuscated_files
IDE->>MCP: status(workspace_dir, options.request_id) / push(workspace_dir, options.request_id)
MCP->>MCP: Deobfuscate and apply workspace delta
MCP->>Project: Apply add/modify/delete in source root
MCP-->>IDE: applied_files / deleted_files
IDE-->>User: Show result
curl -fsSL https://raw.githubusercontent.com/sawrus/code-obfuscator/main/install | bashBinaries are installed from GitHub Releases: sawrus/code-obfuscator/releases.
code-obfuscatormake mcp-docker-buildMCP_HTTP_ADDR=127.0.0.1:18787 \
MCP_LOG_STDOUT=true \
MCP_LOG_MODE=default \
MCP_PROJECTS_HOST_DIR=$HOME/projects \
MCP_DEFAULT_MAPPING_PATH=$HOME/mcp/code-obfuscator/mapping.default.json \
./scripts/run-mcp-docker.shWhen MCP_HTTP_ADDR is set, ./scripts/run-mcp-docker.sh starts the container in HTTP-only mode.
Use it as a standalone server launcher, then register Codex by URL. Do not point a stdio MCP config at this script.
Readable MCP logs are enabled by MCP_LOG_STDOUT=true:
http: logs are printed to containerstdoutstdio: logs are printed tostderrso MCP framing onstdoutstays intact- all transports also write the same readable format to
logs/mcp-server.log
MCP_LOG_MODE controls verbosity:
deep: full request/response bodiesdefault: readable request/response bodies with file content redactedsystem: lifecycle, health, and error logs only
Every MCP operational error logs a full backtrace before the server returns an error response or terminates.
codex mcp remove code_obfuscator >/dev/null 2>&1 || true
codex mcp add code_obfuscator --url http://127.0.0.1:18787/mcpFor http, Codex connects to the already running endpoint. Unlike stdio, Codex does not start the server for you.
opencode mcp remove code_obfuscator >/dev/null 2>&1 || true
opencode mcp add code_obfuscator --url http://127.0.0.1:18787/mcpantigravity mcp remove code_obfuscator >/dev/null 2>&1 || true
antigravity mcp add code_obfuscator --url http://127.0.0.1:18787/mcp{
"name": "code_obfuscator",
"transport": "http",
"url": "http://127.0.0.1:18787/mcp",
"tools_allowlist": ["ls_tree", "ls_files", "pull", "clone", "status", "push"]
}{
"name": "code_obfuscator",
"transport": "http",
"url": "http://127.0.0.1:18787/mcp",
"tools_allowlist": ["ls_tree", "ls_files", "pull", "clone", "status", "push"]
}kilocode mcp remove code_obfuscator >/dev/null 2>&1 || true
kilocode mcp add code_obfuscator --url http://127.0.0.1:18787/mcpMCP_PROJECTS_HOST_DIR maps to -v "<ABS_PATH>:/workspace/projects:rw" inside Docker.
curl -i http://127.0.0.1:18787/healthWork only through the MCP code_obfuscator. Your task is to locate a project whose runtime path within /workspace/projects/x/y contains z-api, then read the file query_v2.py from that project and output all SQL scripts stored in it.
- Full documentation (install lifecycle, CLI/TUI modes, MCP integrations, architecture, troubleshooting): docs/DETAILS.md
- Security and performance: docs/SECURITY_AND_PERFORMANCE.md
- Samples: docs/SAMPLES.md
- MCP server plan: docs/MCP_TOOLS.md
- CLI and MCP project scans respect rules from
<project-root>/.gitignore. - In MCP listing tools,
include_hiddencontrols only dot-prefixed paths;.gitignorefilters are still active. - MCP
pullwith explicitfile_pathssilently skips paths ignored by root.gitignore.
make build
make test