Skip to content

Add add_binary MCP tool / capability#62

Open
k-o-n-t-o-r wants to merge 2 commits into
fosdickio:mainfrom
k-o-n-t-o-r:main
Open

Add add_binary MCP tool / capability#62
k-o-n-t-o-r wants to merge 2 commits into
fosdickio:mainfrom
k-o-n-t-o-r:main

Conversation

@k-o-n-t-o-r
Copy link
Copy Markdown

This change adds a new MCP tool, add_binary(file_path, wait_for_analysis), that allows agents to programmatically load additional binary files into Binary Ninja. This is quite useful for AI-driven exploratory firmware analysis, for example.

  • Supports both GUI mode (with proper Qt main thread handling) and headless mode fallback
  • Optionally waits for initial analysis to complete before returning

@k-o-n-t-o-r
Copy link
Copy Markdown
Author

k-o-n-t-o-r commented Jan 30, 2026

Update:

  • We now check whether a given binary is already loaded before adding
  • I've changed the way binaries are being added - The initial method turned out to not be robust enough. We now simply pass the path of the file as an argument to binaryninja CLI. Way simpler and more reliable... I hope :)

@Arrowana
Copy link
Copy Markdown

@k-o-n-t-o-r nice PR.

Adding the binary opens a new window, which if the intent is to manipulate many binaries, it quickly becomes a mess and takes the focus, should there be a way to add it to the same window?

@k-o-n-t-o-r
Copy link
Copy Markdown
Author

@Arrowana
On my machine (Linux, KDE, Wayland), new binaries are added as additional views in the existing BinaryNinja window. Since the MCP tool essentially just launches the BinaryNinja CLI with the path to the new binary as a command-line argument, whether a new window is created or the existing one is reused likely depends on your BinaryNinja settings.

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.

2 participants