Skip to content

Commit 9ce9d38

Browse files
committed
resolve merge conflict
2 parents 9eb600c + 9d82f55 commit 9ce9d38

31 files changed

Lines changed: 17353 additions & 321 deletions

.github/workflows/lint-format.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Ruff
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
jobs:
10+
ruff:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v5
17+
with:
18+
python-version: "3.12"
19+
20+
- name: Install Ruff
21+
run: pip install ruff>=0.8.4
22+
23+
- name: Run Ruff linter
24+
run: ruff check .
25+
continue-on-error: false
26+
27+
- name: Run Ruff formatter check
28+
run: ruff format --check .
29+
continue-on-error: false

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,8 @@ Desktop.ini
2323
*.log
2424
*.tmp
2525
*.bak
26+
27+
.env
28+
.mcp_auto_setup_done
29+
30+
bridge/node_modules

README.md

Lines changed: 220 additions & 69 deletions
Large diffs are not rendered by default.

bridge/README.md

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
# Binary Ninja MCP Server (TypeScript)
2+
3+
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.
4+
5+
## Features
6+
7+
- **Standalone MCP Server**: Run independently with any MCP client
8+
- **50+ Tools**: Full access to Binary Ninja's reverse engineering capabilities
9+
- **Easy Configuration**: CLI options and environment variables for host/port
10+
- **TypeScript**: Full type safety and better developer experience
11+
12+
## Installation
13+
14+
### Using npx (Recommended)
15+
16+
```bash
17+
npx -y binary-ninja-mcp
18+
```
19+
20+
### Global Installation
21+
22+
```bash
23+
npm install -g binary-ninja-mcp
24+
binary-ninja-mcp
25+
```
26+
27+
### From Source
28+
29+
```bash
30+
cd bridge
31+
npm install
32+
npm run build
33+
```
34+
35+
## Usage
36+
37+
### Command Line Options
38+
39+
```bash
40+
# Connect to default (localhost:9009)
41+
npx -y binary-ninja-mcp
42+
43+
# Connect to custom host/port
44+
npx -y binary-ninja-mcp --host 192.168.1.100 --port 9009
45+
46+
# Show help
47+
npx -y binary-ninja-mcp --help
48+
```
49+
50+
### Environment Variables
51+
52+
```bash
53+
# Set host and port via environment
54+
BINJA_MCP_HOST=localhost BINJA_MCP_PORT=9009 npx -y binary-ninja-mcp
55+
```
56+
57+
### MCP Client Configuration
58+
59+
#### Claude Desktop
60+
61+
Add to `~/.config/claude-desktop/claude_desktop_config.json`:
62+
63+
```json
64+
{
65+
"mcpServers": {
66+
"binary-ninja-mcp": {
67+
"command": "npx",
68+
"args": ["-y", "binary-ninja-mcp", "--host", "localhost", "--port", "9009"]
69+
}
70+
}
71+
}
72+
```
73+
74+
#### Cline
75+
76+
Add to your Cline MCP configuration:
77+
78+
```json
79+
{
80+
"mcpServers": {
81+
"binary-ninja-mcp": {
82+
"command": "npx",
83+
"args": ["-y", "binary-ninja-mcp"]
84+
}
85+
}
86+
}
87+
```
88+
89+
#### Custom Installation
90+
91+
If installed globally:
92+
93+
```json
94+
{
95+
"mcpServers": {
96+
"binary-ninja-mcp": {
97+
"command": "binary-ninja-mcp",
98+
"args": ["--host", "localhost", "--port", "9009"]
99+
}
100+
}
101+
}
102+
```
103+
104+
## Available Tools
105+
106+
### Function Analysis
107+
108+
- `list_methods` - List all function names with pagination
109+
- `get_entry_points` - List entry point(s) of the loaded binary
110+
- `search_functions_by_name` - Search functions by name substring
111+
- `decompile_function` - Decompile a function to C code
112+
- `get_il` - Get IL (HLIL/MLIL/LLIL) for a function
113+
- `fetch_disassembly` - Get assembly mnemonics for a function
114+
115+
### Rename Tools
116+
117+
- `rename_function` - Rename a function
118+
- `rename_single_variable` - Rename a single variable
119+
- `rename_multi_variables` - Batch rename multiple variables
120+
- `rename_data` - Rename a data label
121+
122+
### Comment Tools
123+
124+
- `set_comment` - Set comment at an address
125+
- `get_comment` - Get comment at an address
126+
- `delete_comment` - Delete comment at an address
127+
- `set_function_comment` - Set function comment
128+
- `get_function_comment` - Get function comment
129+
- `delete_function_comment` - Delete function comment
130+
131+
### Type Tools
132+
133+
- `define_types` - Define types from C code
134+
- `list_local_types` - List local types
135+
- `search_types` - Search types by name
136+
- `get_user_defined_type` - Get user defined type definition
137+
- `get_type_info` - Get type information
138+
- `declare_c_type` - Declare C type
139+
- `retype_variable` - Retype a variable
140+
- `set_local_variable_type` - Set local variable type
141+
142+
### Data Tools
143+
144+
- `list_data_items` - List data labels
145+
- `hexdump_address` - Hexdump at address
146+
- `hexdump_data` - Hexdump data symbol
147+
- `get_data_decl` - Get data declaration and hexdump
148+
149+
### Cross-Reference Tools
150+
151+
- `get_xrefs_to` - Get xrefs to address
152+
- `get_xrefs_to_field` - Get xrefs to struct field
153+
- `get_xrefs_to_struct` - Get xrefs to struct
154+
- `get_xrefs_to_type` - Get xrefs to type
155+
- `get_xrefs_to_enum` - Get xrefs to enum
156+
- `get_xrefs_to_union` - Get xrefs to union
157+
158+
### Binary Modification Tools
159+
160+
- `set_function_prototype` - Set function prototype
161+
- `make_function_at` - Create function at address
162+
- `list_platforms` - List available platforms
163+
- `patch_bytes` - Patch bytes in binary
164+
165+
### Utility Tools
166+
167+
- `function_at` - Find function at address
168+
- `get_stack_frame_vars` - Get stack frame variables
169+
- `list_classes` - List classes/namespaces
170+
- `list_namespaces` - List namespaces
171+
- `list_segments` - List memory segments
172+
- `list_sections` - List sections
173+
- `list_imports` - List imports
174+
- `list_exports` - List exports
175+
- `list_strings` - List strings
176+
- `list_all_strings` - List all strings (aggregated)
177+
- `get_binary_status` - Get binary status
178+
- `list_binaries` - List open binaries
179+
- `select_binary` - Select active binary
180+
- `format_value` - Format and annotate value
181+
- `convert_number` - Convert number representations
182+
183+
## Requirements
184+
185+
- Node.js 18.0.0 or higher
186+
- A running Binary Ninja instance with the MCP plugin
187+
- MCP client (Claude Desktop, Cline, etc.)
188+
189+
## License
190+
191+
GPL-3.0 - See LICENSE file for details.

0 commit comments

Comments
 (0)