This document describes how to set up and use the multi-binary functionality that allows you to work with multiple Binary Ninja instances simultaneously through the MCP bridge.
The multi-binary setup extends the original single-binary MCP bridge to support:
- Multiple Binary Ninja instances running on different ports
- Automatic server discovery and routing
- Binary selection through MCP tools
- Concurrent analysis of multiple binaries
MCP Client (Claude Desktop, etc.)
↓
MCP Bridge (port 8010)
↓ (routing based on binary_id)
Multiple Binary Ninja Servers:
- Binary A → port 9009
- Binary B → port 9010
- Binary C → port 9011
- etc.
The plugin now supports both legacy single-binary mode and new multi-binary mode.
- Open Binary Ninja
- Load your first binary
- Use
MCP Server > Start Server for This Binary - Open a new Binary Ninja window (or tab)
- Load your second binary
- Use
MCP Server > Start Server for This Binary - Repeat for additional binaries
Each binary will get its own MCP server on a unique port (9009, 9010, 9011, etc.).
Use the new multi-binary bridge instead of the original:
python bridge/bn_mcp_bridge_multi_http.pyThis bridge will:
- Automatically discover all running Binary Ninja MCP servers
- Provide routing to the correct server based on binary selection
- Expose enhanced tools for binary management
Update your MCP client configuration to use the multi-binary bridge:
{
"mcpServers": {
"binary_ninja_multi_mcp": {
"command": "/path/to/venv/bin/python",
"args": [
"/path/to/binary_ninja_mcp/bridge/bn_mcp_bridge_multi_http.py"
]
}
}
}The multi-binary bridge provides several ways to select which binary to work with:
# List all available Binary Ninja servers
list_binary_servers()This returns information about all running servers, including:
binary_id: Unique identifier for the serverfilename: Name of the loaded binaryport: Server port number- Binary metadata (architecture, platform, etc.)
# Find a binary by filename (supports partial matches)
select_binary_by_filename("malware.exe")All MCP tools now accept an optional binary_id parameter:
# List methods from a specific binary
list_entities(kind="methods", binary_id="port_9009")
# Decompile function from a specific binary
decompile_function("main", binary_id="port_9010")
# Get data from a specific binary
list_data(binary_id="port_9011")If no binary_id is provided, the bridge uses the first available server as default.
The plugin provides several new commands for multi-binary management:
MCP Server > Start Server for This Binary- Start server for current binaryMCP Server > Stop Server for This Binary- Stop server for current binaryMCP Server > Restart Server for This Binary- Restart server for current binary
MCP Server > Show Server Status- Detailed status and connection infoMCP Server > List Active Servers- Quick list of running serversMCP Server > Stop All Servers- Stop all MCP servers
MCP Server > Legacy > Start MCP Server- Original single-binary modeMCP Server > Legacy > Stop MCP Server- Stop legacy server
Run the test script to verify your multi-binary setup:
python test_multi_binary.pyThis will:
- Check bridge connectivity
- Discover available Binary Ninja servers
- Test binary selection functionality
- Verify routing works correctly
If the bridge can't find any Binary Ninja servers:
- Make sure Binary Ninja is running
- Load at least one binary
- Use
MCP Server > Start Server for This Binary - Check that the server is accessible:
curl http://localhost:9009/status
If you get port conflicts:
- Check what's running on ports 9009+:
netstat -an | grep 900 - Stop conflicting services
- Restart Binary Ninja MCP servers
If the MCP client can't connect to the bridge:
- Verify the bridge is running:
curl http://localhost:8010/health - Check firewall settings
- Ensure the bridge discovered servers: check startup logs
If binary selection isn't working:
- Use
list_binary_servers()to see available binaries - Check that
binary_idvalues are correct - Verify the target server is still running
You can modify the port range in plugin/core/config.py:
@dataclass
class MultiBinaryServerConfig:
host: str = "localhost"
base_port: int = 9009 # Starting port
max_servers: int = 10 # Maximum number of serversModify discovery settings in bridge/bn_mcp_bridge_multi_http.py:
BINJA_BASE_PORT = 9009 # Starting port to scan
MAX_SERVERS = 10 # Maximum servers to discover
discovery_interval = 30.0 # How often to rediscover (seconds)If you're upgrading from the single-binary setup:
- The original bridge (
bn_mcp_bridge_http.py) still works for single-binary use - Use the new bridge (
bn_mcp_bridge_multi_http.py) for multi-binary support - Legacy plugin commands are still available under
MCP Server > Legacy - Your existing MCP client configuration will work with minor updates
# List all loaded binaries
servers = list_binary_servers()
# Analyze each binary
for server in servers['servers']:
binary_id = server['binary_id']
filename = server['filename']
print(f"Analyzing {filename}...")
# Get overview
overview(binary_id=binary_id)
# List functions
functions = list_entities(kind="methods", binary_id=binary_id, limit=10)
# Decompile main function if it exists
decompile_function("main", binary_id=binary_id)# Get function lists from two binaries
binary1_functions = list_entities(kind="methods", binary_id="port_9009")
binary2_functions = list_entities(kind="methods", binary_id="port_9010")
# Compare function names, signatures, etc.This multi-binary setup enables powerful comparative analysis workflows that weren't possible with the single-binary approach.