Skip to content

[codex] Add Binary Ninja Python execution tool - #89

Open
farvend wants to merge 4 commits into
fosdickio:mainfrom
farvend:codex/feat-execute-python
Open

[codex] Add Binary Ninja Python execution tool#89
farvend wants to merge 4 commits into
fosdickio:mainfrom
farvend:codex/feat-execute-python

Conversation

@farvend

@farvend farvend commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

What changed

  • Add execute_python backed by Binary Ninja's persistent Python scripting provider.
  • Expose one POST endpoint: /executePython.
  • Capture output, warnings, and errors with a 1,000,000-character limit.
  • Enforce 0.1–300 second timeouts and discard timed-out contexts.
  • Avoid logging submitted source code.
  • Mark the MCP tool destructive, non-idempotent, and open-world.

Why

Some analysis and automation operations require direct Binary Ninja API access that cannot be expressed through the existing fixed endpoints.

Impact

MCP clients can run multi-line Python with console variables such as bv. This is intentionally a high-risk capability and should be confirmed by clients.

Dependency

This branch is stacked on the tool-annotations branch. Its diff against main will shrink after that PR merges.

Validation

  • python -B -m unittest discover -s tests -p "test_*.py" (6 tests)
  • npm run build
  • npm run test:annotations (55 tools)

@farvend
farvend marked this pull request as ready for review August 26, 2026 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant