Skip to content
Back to search

Binary Ninja MCP

SkillWorks with Claude CodeGitHub

A Binary Ninja extension that provides a MCP (Model Context Protocol) server with HTTP endpoints for LLM integration.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/fosdickio/binary_ninja_mcp with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/fosdickio/binary_ninja_mcp'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/fosdickio--binary-ninja-mcp/badge.svg)](/listings/fosdickio--binary-ninja-mcp)

HTML

<a href="/listings/fosdickio--binary-ninja-mcp"><img src="/api/listings/fosdickio--binary-ninja-mcp/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

MCP Client

Please install the MCP client before you install Binary Ninja MCP so that the MCP clients can be auto-setup. We currently support auto-setup for these MCP clients:

1. Cline (recommended) 2. Roo Code 3. Claude Desktop (recommended) 4. Cursor 5. Windsurf 6. Claude Code 7. LM Studio

Extension Installation

After the MCP client is installed, you can install the MCP server using the Binary Ninja Plugin Manager or manually. Both methods support auto-setup of MCP clients.

If your MCP client is not set, you should install it first then try to reinstall the extension.

Binary Ninja Plugin Manager

You may install the extension through Binary Ninja's Plugin Manager (`Plugins > Manage Plugins`).

Manual Install

To manually install the extension, this repository can be copied into the [Binary Ninja plugins folder](https://docs.binary.ninja/guide/plugins.html).

[Optional] Manual Setup of the MCP Client

*You do NOT need to set this up manually if you use a supported MCP client and follow the installation steps before.*

You can also manage MCP client entries from the command line:

python scripts/mcp_client_installer.py --install    # auto setup supported MCP clients
python scripts/mcp_client_installer.py --uninstall  # remove entries and delete `.mcp_auto_setup_done`
python scripts/mcp_client_installer.py --config     # print a generic JSON config snippet

Using npm package (Recommended)

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

npx -y binary-ninja-mcp

For MCP clients, use this configuration:

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

Or if installed globally:

{
  "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:

{
    "mcpServers": {
        "binary_ninja_mcp": {
            "command": "/ABSOLUTE/PATH/TO/Binary Ninja/plugins/repositories/community/plugins/fosdickio_binary_ninja_mcp/.venv/bin/python",
            "args": [
                "/ABSOLUTE/PATH/TO/Binary Ninja/plugins/repositories/community/plugins/fosdickio_binary_ninja_mcp/bridge/binja_mcp_bridge.py"
            ]
        }
    }
}

Note: Replace `/ABSOLUTE/PATH/TO` with the actual absolute path to your project directory. The virtual environment's Python interpreter must be used to access the installed dependencies.

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 295 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # Binary Ninja MCP
  2. This repository contains a Binary Ninja plugin, MCP server, and bridge that enables seamless integration of Binary Ninja's capabilities with your favorite LLM client.
  3. ![Binary Ninja MCP Logo](images/logo-small.png)
  4. ## Features
  5. - Seamless, real-time integration between Binary Ninja and MCP clients
  6. - Enhanced reverse engineering workflow with AI assistance
  7. - Support for every MCP client (Cline, Claude desktop, Roo Code, etc.)
  8. - Open multiple binaries and switch the active target automatically
  9. ## Examples
  10. ### Solving a CTF Challenge
  11. Check out [this demo video on YouTube](https://www.youtube.com/watch?v=0ffMHH39L_M) that uses the extension to solve a CTF challenge.
  12. ## Components
  13. This repository contains two separate components:
  14. 1. A Binary Ninja plugin that provides an MCP server that exposes Binary Ninja's capabilities through HTTP endpoints. This can be used with any client that implements the MCP protocol.
  15. 2. A separate MCP bridge component that connects your favorite MCP client to the Binary Ninja MCP server.
  16. ## Prerequisites
  17. - [Binary Ninja](https://binary.ninja/)
  18. - Python 3.12+
  19. - MCP client (those with auto-setup support are listed below)
  20. ## Installation
  21. ### MCP Client
  22. Please install the MCP client before you install Binary Ninja MCP so that the MCP clients can be auto-setup. We currently support auto-setup for these MCP clients:
  23. 1. Cline (recommended)
  24. 2. Roo Code
  25. 3. Claude Desktop (recommended)
  26. 4. Cursor
  27. 5. Windsurf
  28. 6. Claude Code
  29. 7. LM Studio
  30. ### Extension Installation
  31. After the MCP client is installed, you can install the MCP server using the Binary Ninja Plugin Manager or manually. Both methods support auto-setup of MCP clients.
  32. If your MCP client is not set, you should install it first then try to reinstall the extension.
  33. #### Binary Ninja Plugin Manager
  34. You may install the extension through Binary Ninja's Plugin Manager (`Plugins > Manage Plugins`).
  35. ![Plugin Manager](images/plugin-manager-listing.png)
  36. #### Manual Install
  37. To manually install the extension, this repository can be copied into the [Binary Ninja plugins folder](https://docs.binary.ninja/guide/plugins.html).
  38. ### [Optional] Manual Setup of the MCP Client
  39. *You do NOT need to set this up manually if you use a supported MCP client and follow the installation steps before.*
  40. You can also manage MCP client entries from the command line:
  41. ```bash
  42. python scripts/mcp_client_installer.py --install # auto setup supported MCP clients
  43. python scripts/mcp_client_installer.py --uninstall # remove entries and delete `.mcp_auto_setup_done`
  44. python scripts/mcp_client_installer.py --config # print a generic JSON config snippet
  45. ```
  46. #### Using npm package (Recommended)
  47. The recommended way to set up the MCP client is using the official npm package:
  48. ```bash
  49. npx -y binary-ninja-mcp
  50. ```
  51. For MCP clients, use this configuration:
  52. ```json
  53. {
  54. "mcpServers": {
  55. "binary-ninja-mcp": {
  56. "command": "npx",
  57. "args": ["-y", "binary-ninja-mcp", "--host", "localhost", "--port", "9009"]
  58. }
  59. }
  60. }
  61. ```
  62. Or if installed globally:
  63. ```json
  64. {
  65. "mcpServers": {
  66. "binary-ninja-mcp": {
  67. "command": "binary-ninja-mcp",
  68. "args": ["--host", "localhost", "--port", "9009"]
  69. }
  70. }
  71. }
  72. ```
  73. #### Using Python Bridge (Legacy)
  74. For other MCP clients, use the Python bridge directly:
  75. ```json
  76. {
  77. "mcpServers": {
  78. "binary_ninja_mcp": {
  79. "command": "/ABSOLUTE/PATH/TO/Binary Ninja/plugins/repositories/community/plugins/fosdickio_binary_ninja_mcp/.venv/bin/python",
  80. "args": [
  81. "/ABSOLUTE/PATH/TO/Binary Ninja/plugins/repositories/community/plugins/fosdickio_binary_ninja_mcp/bridge/binja_mcp_bridge.py"
  82. ]
  83. }
  84. }
  85. }
  86. ```
  87. Note: Replace `/ABSOLUTE/PATH/TO` with the actual absolute path to your project directory. The virtual environment's Python interpreter must be used to access the installed dependencies.
  88. ## Usage
  89. 1. Open Binary Ninja and load a binary
  90. 2. Click the button shown at left bottom corner
  91. 3. Start using it through your MCP client
  92. You may now start prompting LLMs about the currently open binary (or binaries). Example prompts:
  93. ### CTF Challenges
  94. ```txt
  95. You're the best CTF player in the world. Please solve this reversing CTF challenge in the <folder_name> folder using Binary Ninja. Rename ALL the function and the variables during your analyzation process (except for main function) so I can better read the code. Write a python solve script if you need. Also, if you need to create struct or anything, please go ahead. Reverse the code like a human reverser so that I can read the decompiled code that analyzed by you.
  96. ```
  97. ### Malware Analysis
  98. ```txt
  99. Your task is to analyze an unknown file which is currently open in Binary Ninja. You can use the existing MCP server called "binary_ninja_mcp" to interact with the Binary Ninja instance and retrieve information, using the tools made available by this server. In general use the following strategy:
  100. - Start from the entry point of the code
  101. - If this function call others, make sure to follow through the calls and analyze these functions as well to understand their context
  102. - If more details are necessary, disassemble or decompile the function and add comments with your findings
  103. - Inspect the decompilation and add comments with your findings to important areas of code
  104. - Add a comment to each function with a brief summary of what it does
  105. - Rename variables and function parameters to more sensible names
  106. - Change the variable and argument types if necessary (especially pointer and array types)
  107. - Change function names to be more descriptive, using mcp_ as prefix.
  108. - NEVER convert number bases yourself. Use the convert_number MCP tool if needed!
  109. - When you finish your analysis, report how long the analysis took
  110. - At the end, create a report with your findings.
  111. - Based only on these findings, make an assessment on whether the file is malicious or not.
  112. ```
  113. ## Supported Capabilities
  114. The following table lists the available MCP functions for use:
  115. | Function | Description |
  116. | -------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ |
  117. | `decompile_function` | Decompile a specific function by name and return HLIL-like code with addresses. |
  118. | `get_il(name_or_address, view, ssa)` | Get IL for a function in `hlil`, `mlil`, or `llil` (SSA supported for MLIL/LLIL). |
  119. | `define_types` | Add type definitions from a C string type definition. |
  120. | `delete_comment` | Delete the comment at a specific address. |
  121. | `delete_function_comment` | Delete the comment for a function. |
  122. | `declare_c_type(c_declaration)` | Create/update a local type from a single C declaration. |
  123. | `format_value(address, text, size)` | Convert a value and annotate it at an address in BN (adds a comment). |
  124. | `function_at` | Retrieve the name of the function the address belongs to. |
  125. | `fetch_disassembly` | Get the assembly representation of a function by name or address. |
  126. | `get_entry_points()` | List entry point(s) of the loaded binary. |
  127. | `get_binary_status` | Get the current status of the loaded binary. |
  128. | `get_comment` | Get the comment at a specific address. |
  129. | `get_function_comment` | Get the comment for a function. |
  130. | `get_user_defined_type` | Retrieve definition of a user-defined type (struct, enumeration, typedef, union). |
  131. | `get_xrefs_to(address)` | Get all cross references (code and data) to an address. |
  132. | `get_data_decl(name_or_address, length)` | Return a C-like declaration and a hexdump for a data symbol or address. |
  133. | `hexdump_address(address, length)` | Text hexdump at address. `length < 0` reads exact defined size if available. |
  134. | `hexdump_data(name_or_address, length)` | Hexdump by data symbol name or address. `length < 0` reads exact defined size if available. |
  135. | `get_xrefs_to_enum(enum_name)` | Get usages related to an enum (matches member constants in code). |
  136. | `get_xrefs_to_field(struct_name, field_name)` | Get all cross references to a named struct field. |
  137. | `get_xrefs_to_struct(struct_name)` | Get xrefs/usages related to a struct (members, globals, code refs). |
  138. | `get_xrefs_to_type(type_name)` | Get xrefs/usages related to a struct/type (globals, refs, HLIL matches). |
  139. | `get_xrefs_to_union(union_name)` | Get xrefs/usages related to a union (members, globals, code refs). |
  140. | `get_stack_frame_vars(function_identifier)` | Get stack frame variable information for a function (names, offsets, sizes, types). |
  141. | `get_type_info(type_name)` | Resolve a type and return declaration, kind, and members. |
  142. | `get_callers(identifiers)` | List callers plus call sites for one or more function identifiers. |
  143. | `get_callees(identifiers)` | List callees plus call sites for one or more function identifiers. |
  144. | `make_function_at(address, platform)` | Create a function at an address. `platform` optional; use `default` to pick the BinaryView/platform default. |
  145. | `list_platforms()` | List all available platform names. |
  146. | `list_binaries()` | List managed/open binaries with ids and active flag. |
  147. | `select_binary(view)` | Select active binary by id or filename. |
  148. | `list_all_strings()` | List all strings (no pagination; aggregates all pages). |
  149. | `list_classes` | List all namespace/class names in the program. |
  150. | `list_data_items` | List defined data labels and their values. |
  151. | `list_exports` | List exported functions/symbols. |
  152. | `list_imports` | List imported symbols in the program. |
  153. | `list_local_types(offset, count)` | List local Types in the current database (name/kind/decl). |
  154. | `list_methods` | List all function names in the program. |
  155. | `list_namespaces` | List all non-global namespaces in the program. |
  156. | `list_segments` | List all memory segments in the program. |
  157. | `list_strings(offset, count)` | List all strings in the database (paginated). |
  158. | `list_strings_filter(offset, count, filter)` | List matching strings (paginated, filtered by substring). |
  159. | `rename_data` | Rename a data label at the specified address. |
  160. | `rename_function` | Rename a function by its current name to a new user-defined name. |
  161. | `rename_single_variable` | Rename a single local variable inside a function. |
  162. | `rename_multi_variables` | Batch rename multiple local variables in a function (mapping or pairs). |
  163. | `set_local_variable_type(function_address, variable_name, new_type)` | Set a local variable's type. |
  164. | `retype_variable` | Retype variable inside a given function. |
  165. | `search_functions_by_name` | Search for functions whose name contains the given substring. |
  166. | `search_types(query, offset, count)` | Search local Types by substring (name/decl). |
  167. | `set_comment` | Set a comment at a specific address. |
  168. | `set_function_comment` | Set a comment for a function. |
  169. | `set_function_prototype(name_or_address, prototype)` | Set a function's prototype by name or address. |
  170. | `patch_bytes(address, data, save_to_file)` | Patch raw bytes at an address (byte-level, not assembly). Can patch entire instructions by providing their bytecode. Address: hex (e.g., "0x401000") or decimal. Data: hex string (e.g., "90 90"). `save_to_file` (default True) saves to disk and re-signs on macOS. |
  171. These are the list of HTTP endpoints that can be called:
  172. - `/allStrings`: All strings in one response.
  173. - `/formatValue?address=<addr>&text=<value>&size=<n>`: Convert and set a comment at an address.
  174. - `/getXrefsTo?address=<addr>`: Xrefs to address (code+data).
  175. - `/getDataDecl?name=<symbol>|address=<addr>&length=<n>`: JSON with declaration-style string and a hexdump for a data symbol or address. Keys: `address`, `name`, `size`, `type`, `decl`, `hexdump`. `length < 0` reads exact defined size if available.
  176. - `/hexdump?address=<addr>&length=<n>`: Text hexdump aligned at address; `length < 0` reads exact defined size if available.
  177. - `/hexdumpByName?name=<symbol>&length=<n>`: Text hexdump by symbol name. Recognizes BN auto-labels like `data_<hex>`, `byte_<hex>`, `word_<hex>`, `dword_<hex>`, `qword_<hex>`, `off_<hex>`, `unk_<hex>`, and plain hex addresses.
  178. - `/makeFunctionAt?address=<addr>&platform=<name|default>`: Create a function at an address (idempotent if already exists). `platform=default` uses the BinaryView/platform default.
  179. - `/platforms`: List all available platform names.
  180. - `/binaries` or `/views`: List managed/open binaries with ids and active flag.
  181. - `/selectBinary?view=<id|filename>`: Select active binary for subsequent operations.
  182. - `/data?offset=<n>&limit=<m>&length=<n>`: Defined data items with previews. `length` controls bytes read per item (capped at defined size). Default behavior reads exact defined size when available; `length=-1` forces exact-size.
  183. - `/getXrefsToEnum?name=<enum>`: Enum usages by matching member constants.
  184. - `/getXrefsToField?struct=<name>&field=<name>`: Xrefs to struct field.
  185. - `/getXrefsToType?name=<type>`: Xrefs/usages related to a struct/type name.
  186. - `/getTypeInfo?name=<type>`: Resolve a type and return declaration and details.
  187. - `/getXrefsToUnion?name=<union>`: Union xrefs/usages (members, globals, refs).
  188. - `/getStackFrameVars?name=<function>|address=<addr>`: Get stack frame variable information for a function.
  189. - `/getCallers?identifiers=<name|addr>[,...]`: Return caller summaries (functions, call sites, HLIL/IL snippets) for one or more identifiers. Accepts `identifiers`, `identifier`, `names`, or `addresses` query params.
  190. - `/getCallees?identifiers=<name|addr>[,...]`: Return callee summaries with the same schema as `/getCallers`, detailing every outgoing call target per request identifier.
  191. - `/localTypes?offset=<n>&limit=<m>`: List local types.
  192. - `/strings?offset=<n>&limit=<m>`: Paginated strings.
  193. - `/strings/filter?offset=<n>&limit=<m>&filter=<substr>`: Filtered strings.
  194. - `/searchTypes?query=<substr>&offset=<n>&limit=<m>`: Search local types by substring.
  195. - `/patch` or `/patchBytes?address=<addr>&data=<hex>&save_to_file=<bool>`: Patch raw bytes at an address (byte-level, not assembly). Can patch entire instructions by providing their bytecode. Address: hex (e.g., "0x401000") or decimal. Data: hex string (e.g., "90 90"). `save_to_file` (default True) saves to disk and re-signs on macOS.
  196. - `/renameVariables`: Batch rename locals in a function. Parameters:
  197. - Function: one of `functionAddress`, `address`, `function`, `functionName`, or `name`.
  198. - Provide renames via one of:
  199. - `renames`: JSON array of `{old, new}` objects
  200. - `mapping`: JSON object of `old->new`
  201. - `pairs`: compact string `old1:new1,old2:new2`
  202. Returns per-item results plus totals. Order is respected; later pairs can refer to earlier new names.
  203. ## Development
  204. ### Code Quality
  205. This project uses [Ruff](https://docs.astral.sh/ruff/) for linting and formatting. Configuration is in `ruff.toml`.
  206. #### Running Ruff Manually
  207. Check for issues:
  208. ```bash
  209. ruff check .
  210. ```
  211. Auto-fix issues:
  212. ```bash
  213. ruff check --fix .
  214. ```
  215. Check formatting issues:
  216. ```bash
  217. ruff format --check .
  218. ```
  219. Format code:
  220. ```bash
  221. ruff format .
  222. ```
  223. #### GitHub Actions
  224. A GitHub Action workflow (`.github/workflows/lint-format.yml`) automatically runs Ruff on:
  225. - Every push to the `main` branch
  226. - Every pull request targeting the `main` branch
  227. The workflow will fail if there are linting errors or formatting issues, ensuring code quality in CI.
  228. ## Contributing
  229. Contributions are welcome. Please feel free to submit a pull request.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.