Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ Desktop.ini

.env
.mcp_auto_setup_done

bridge/node_modules
40 changes: 38 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,43 @@ python scripts/mcp_client_installer.py --uninstall # remove entries and delete
python scripts/mcp_client_installer.py --config # print a generic JSON config snippet
```

For other MCP clients, this is an example config:
#### Using npm package (Recommended)

The recommended way to set up the MCP client is using the official npm package:

```bash
npx -y binary-ninja-mcp
```

For MCP clients, use this configuration:

```json
{
"mcpServers": {
"binary-ninja-mcp": {
"command": "npx",
"args": ["-y", "binary-ninja-mcp", "--host", "localhost", "--port", "9009"]
}
}
}
```

Or if installed globally:

```json
{
"mcpServers": {
"binary-ninja-mcp": {
"command": "binary-ninja-mcp",
"args": ["--host", "localhost", "--port", "9009"]
}
}
}
```

#### Using Python Bridge (Legacy)

For other MCP clients, use the Python bridge directly:

```json
{
Expand Down Expand Up @@ -136,7 +172,7 @@ The following table lists the available MCP functions for use:
| `declare_c_type(c_declaration)` | Create/update a local type from a single C declaration. |
| `format_value(address, text, size)` | Convert a value and annotate it at an address in BN (adds a comment). |
| `function_at` | Retrieve the name of the function the address belongs to. |
| `get_assembly_function` | Get the assembly representation of a function by name or address. |
| `fetch_disassembly` | Get the assembly representation of a function by name or address. |
| `get_entry_points()` | List entry point(s) of the loaded binary. |
| `get_binary_status` | Get the current status of the loaded binary. |
| `get_comment` | Get the comment at a specific address. |
Expand Down
191 changes: 191 additions & 0 deletions bridge/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
# Binary Ninja MCP Server (TypeScript)

This is the TypeScript implementation of the Binary Ninja MCP bridge server. It provides a standalone MCP server that connects to a running Binary Ninja instance and exposes its capabilities through the Model Context Protocol.

## Features

- **Standalone MCP Server**: Run independently with any MCP client
- **50+ Tools**: Full access to Binary Ninja's reverse engineering capabilities
Copy link

Copilot AI Jan 18, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation claims "50+ Tools" but there are actually 54 tools defined. Consider updating this to be more precise, such as "54 Tools" or "55+ Tools" for consistency and accuracy.

Suggested change
- **50+ Tools**: Full access to Binary Ninja's reverse engineering capabilities
- **54 Tools**: Full access to Binary Ninja's reverse engineering capabilities

Copilot uses AI. Check for mistakes.
- **Easy Configuration**: CLI options and environment variables for host/port
- **TypeScript**: Full type safety and better developer experience

## Installation

### Using npx (Recommended)

```bash
npx -y binary-ninja-mcp
```

### Global Installation

```bash
npm install -g binary-ninja-mcp
binary-ninja-mcp
```

### From Source

```bash
cd bridge
npm install
npm run build
```

## Usage

### Command Line Options

```bash
# Connect to default (localhost:9009)
npx -y binary-ninja-mcp

# Connect to custom host/port
npx -y binary-ninja-mcp --host 192.168.1.100 --port 9009

# Show help
npx -y binary-ninja-mcp --help
```

### Environment Variables

```bash
# Set host and port via environment
BINJA_MCP_HOST=localhost BINJA_MCP_PORT=9009 npx -y binary-ninja-mcp
```

### MCP Client Configuration

#### Claude Desktop

Add to `~/.config/claude-desktop/claude_desktop_config.json`:

```json
{
"mcpServers": {
"binary-ninja-mcp": {
"command": "npx",
"args": ["-y", "binary-ninja-mcp", "--host", "localhost", "--port", "9009"]
}
}
}
```

#### Cline

Add to your Cline MCP configuration:

```json
{
"mcpServers": {
"binary-ninja-mcp": {
"command": "npx",
"args": ["-y", "binary-ninja-mcp"]
}
}
}
```

#### Custom Installation

If installed globally:

```json
{
"mcpServers": {
"binary-ninja-mcp": {
"command": "binary-ninja-mcp",
"args": ["--host", "localhost", "--port", "9009"]
}
}
}
```

## Available Tools

### Function Analysis

- `list_methods` - List all function names with pagination
- `get_entry_points` - List entry point(s) of the loaded binary
- `search_functions_by_name` - Search functions by name substring
- `decompile_function` - Decompile a function to C code
- `get_il` - Get IL (HLIL/MLIL/LLIL) for a function
- `fetch_disassembly` - Get assembly mnemonics for a function

### Rename Tools

- `rename_function` - Rename a function
- `rename_single_variable` - Rename a single variable
- `rename_multi_variables` - Batch rename multiple variables
- `rename_data` - Rename a data label

### Comment Tools

- `set_comment` - Set comment at an address
- `get_comment` - Get comment at an address
- `delete_comment` - Delete comment at an address
- `set_function_comment` - Set function comment
- `get_function_comment` - Get function comment
- `delete_function_comment` - Delete function comment

### Type Tools

- `define_types` - Define types from C code
- `list_local_types` - List local types
- `search_types` - Search types by name
- `get_user_defined_type` - Get user defined type definition
- `get_type_info` - Get type information
- `declare_c_type` - Declare C type
- `retype_variable` - Retype a variable
- `set_local_variable_type` - Set local variable type

### Data Tools

- `list_data_items` - List data labels
- `hexdump_address` - Hexdump at address
- `hexdump_data` - Hexdump data symbol
- `get_data_decl` - Get data declaration and hexdump

### Cross-Reference Tools

- `get_xrefs_to` - Get xrefs to address
- `get_xrefs_to_field` - Get xrefs to struct field
- `get_xrefs_to_struct` - Get xrefs to struct
- `get_xrefs_to_type` - Get xrefs to type
- `get_xrefs_to_enum` - Get xrefs to enum
- `get_xrefs_to_union` - Get xrefs to union

### Binary Modification Tools

- `set_function_prototype` - Set function prototype
- `make_function_at` - Create function at address
- `list_platforms` - List available platforms
- `patch_bytes` - Patch bytes in binary

### Utility Tools

- `function_at` - Find function at address
- `get_stack_frame_vars` - Get stack frame variables
- `list_classes` - List classes/namespaces
- `list_namespaces` - List namespaces
- `list_segments` - List memory segments
- `list_sections` - List sections
- `list_imports` - List imports
- `list_exports` - List exports
- `list_strings` - List strings
- `list_all_strings` - List all strings (aggregated)
- `get_binary_status` - Get binary status
- `list_binaries` - List open binaries
- `select_binary` - Select active binary
- `format_value` - Format and annotate value
- `convert_number` - Convert number representations

## Requirements

- Node.js 18.0.0 or higher
- A running Binary Ninja instance with the MCP plugin
- MCP client (Claude Desktop, Cline, etc.)

## License

GPL-3.0 - See LICENSE file for details.
Loading
Loading