Token导航 LogoToken导航TokenDH.com
Binary Ninja MCP logo
AI代理stdio官方级别未说明来源级核验

Binary Ninja MCP

MCP Server

Binary Ninja MCP是一款增强逆向工程工作流程的插件,通过MCP协议实现Binary Ninja与LLM客户端的无缝集成,支持AI辅助分析和自动化功能。

工具数

0

提示词数

0

GitHub Stars

350

资源数

0
逆向工程PythonClaudeClaude DesktopClaudeCursorWindsurfCline

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

fosdickio

提供方

fosdickio

最后核验

2026/5/17 20:19

运行时

Python

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

python scripts/mcp_client_installer.py --install # auto setup supported MCP clients

详细介绍

二进制忍者MCP

此存储库包含一个Binary Ninja插件、MCP服务器和桥接器,可将Binary忍者的功能与您最喜欢的LLM客户端无缝集成。

Binary Ninja MCP Logo

特性

  • Binary Ninja和MCP客户端之间的无缝实时集成
  • 借助人工智能增强逆向工程工作流程
  • 支持每个MCP客户端(Cline、Claude桌面、Roo Code等)
  • 打开多个二进制文件并自动切换活动目标

示例

解决CTF挑战

结账 YouTube上的演示视频 其使用该扩展来解决CTF挑战。

组件

此存储库包含两个单独的组件:

  1. 一个Binary Ninja插件,它提供了一个MCP服务器,通过HTTP端点公开Binary忍者的功能。这可以与实现MCP协议的任何客户端一起使用。
  2. 一个单独的MCP网桥组件,将您最喜欢的MCP客户端连接到Binary Ninja MCP服务器。

先决条件

  • 二进制忍者
  • Python 3.12+
  • MCP客户端(下面列出了支持自动设置的客户端)

安装

MCP客户端

请在安装Binary Ninja MCP之前安装MCP客户端,以便MCP客户端可以自动设置。我们目前支持这些MCP客户端的自动设置:

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

扩展安装

安装MCP客户端后,您可以使用Binary Ninja插件管理器或手动安装MCP服务器。这两种方法都支持MCP客户端的自动设置。

如果您的MCP客户端尚未设置,您应该先安装它,然后尝试重新安装扩展。

二进制Ninja插件管理器

您可以通过Binary Ninja的插件管理器安装扩展(Plugins > Manage Plugins).

Plugin Manager

手动安装

要手动安装扩展,可以将此存储库复制到 二进制Ninja插件文件夹.

\[可选\]手动设置MCP客户端

*如果您使用支持的MCP客户端并按照之前的安装步骤进行操作,则不需要手动设置。*

您还可以从命令行管理MCP客户端条目:

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

使用npm包(推荐)

建议使用官方npm包设置MCP客户端:

npx -y binary-ninja-mcp

对于MCP客户端,请使用以下配置:

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

或者,如果全局安装:

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

使用Python桥(遗留)

对于其他MCP客户端,直接使用Python桥:

{
    "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"
            ]
        }
    }
}

注:更换 /ABSOLUTE/PATH/TO 使用项目目录的实际绝对路径。必须使用虚拟环境的Python解释器来访问已安装的依赖项。

用法

  1. 打开Binary Ninja并加载二进制文件
  2. 点击左下角显示的按钮
  3. 通过MCP客户端开始使用它

现在,您可以开始向LLM提示当前打开的二进制文件。示例提示:

CTF挑战

You're the best CTF player in the world. Please solve this reversing CTF challenge in the  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.

恶意软件分析

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:

- Start from the entry point of the code
- If this function call others, make sure to follow through the calls and analyze these functions as well to understand their context
- If more details are necessary, disassemble or decompile the function and add comments with your findings
- Inspect the decompilation and add comments with your findings to important areas of code
- Add a comment to each function with a brief summary of what it does
- Rename variables and function parameters to more sensible names
- Change the variable and argument types if necessary (especially pointer and array types)
- Change function names to be more descriptive, using mcp_ as prefix.
- NEVER convert number bases yourself. Use the convert_number MCP tool if needed!
- When you finish your analysis, report how long the analysis took
- At the end, create a report with your findings.
- Based only on these findings, make an assessment on whether the file is malicious or not.

支持的功能

下表列出了可用的MCP功能:

功能说明
decompile_function按名称分解特定函数,并返回带地址的类似HLIL的代码。
get_il(name_or_address, view, ssa)获取函数的IL hlil, mlil,或 llil (SSA支持MLIL/LLIL)。
define_types从C字符串类型定义中添加类型定义。
delete_comment删除特定地址的评论。
delete_function_comment删除函数的注释。
declare_c_type(c_declaration)从单个C声明创建/更新本地类型。
format_value(address, text, size)转换一个值并在BN中的地址处对其进行注释(添加注释)。
function_at检索地址所属函数的名称
fetch_disassembly通过名称或地址获取函数的程序集表示形式。
get_entry_points()列出加载的二进制文件的入口点。
get_binary_status获取加载的二进制文件的当前状态。
get_comment在特定地址获取评论。
get_function_comment获取函数的注释。
get_user_defined_type检索用户定义类型(结构、枚举、typedef、联合)的定义。
get_xrefs_to(address)获取地址的所有交叉引用(代码和数据)。
get_data_decl(name_or_address, length)返回一个类似C的声明和一个数据符号或地址的十六进制转储。
hexdump_address(address, length)在地址处发送文本hexdump。 length &text=&size=:转换并在地址处设置注释。
  • /getXrefsTo?address=:指向地址的外部参照(代码+数据)。
  • /getDataDecl?name=|address=&length=:JSON,带有声明样式字符串和数据符号或地址的十六进制转储。钥匙: address, name, size, type, decl, hexdump. length &length=:在地址处对齐的文本十六进制转储; length &length=:按符号名称排列的文本hexdump。识别BN汽车标签,如 data_, byte_, word_, dword_, qword_, off_, unk_,以及纯十六进制地址。
  • /makeFunctionAt?address=&platform=:在地址处创建一个函数(如果已经存在,则幂等)。 platform=default 使用BinaryView/平台默认值。
  • /platforms:列出所有可用的平台名称。
  • /binaries/views:列出带有id和活动标志的托管/打开二进制文件。
  • /selectBinary?view=:选择活动二进制以进行后续操作。
  • /data?offset=&limit=&length=:带有预览的已定义数据项。 length 控制每个项目读取的字节数(限制在定义的大小)。默认行为在可用时读取精确定义的大小; length=-1 力精确大小。
  • /getXrefsToEnum?name=:通过匹配成员常量来使用枚举。
  • /getXrefsToField?struct=&field=:结构域的外部参照。
  • /getXrefsToType?name=:与结构/类型名称相关的外部引用/用法。
  • /getTypeInfo?name=:解析类型和返回声明以及详细信息。
  • /getXrefsToUnion?name=:联合外部参照/用法(成员、全局变量、参照)。
  • /getStackFrameVars?name=|address=:获取函数的堆栈帧变量信息。
  • /getCallers?identifiers=[,...]:返回一个或多个标识符的调用者摘要(函数、调用站点、HLIL/IL代码段)。接受 identifiers, identifier, names,或 addresses 查询参数。
  • /getCallees?identifiers=[,...]:返回与相同架构的被叫方摘要 /getCallers,详细说明每个请求标识符的每个呼出目标。
  • /localTypes?offset=&limit=:列出本地类型。
  • /strings?offset=&limit=:分页字符串。
  • /strings/filter?offset=&limit=&filter=:已筛选字符串。
  • /searchTypes?query=&offset=&limit=:按子字符串搜索本地类型。
  • /patch/patchBytes?address=&data=&save_to_file=:在地址处修补原始字节(字节级别,而不是程序集)。可以通过提供字节码来修补整个指令。地址:十六进制(例如“0x401000”)或十进制。数据:十六进制字符串(例如“90 90”)。 save_to_file (默认为True)保存到磁盘并在macOS上重新签名。
  • /renameVariables:批量重命名函数中的局部变量。参数:

- 功能:其中之一 functionAddress, address, function, functionName,或 name. - 通过以下方式之一提供重命名: - renames:JSON数组 {old, new} 物体 - mapping:JSON对象 old->new - pairs:紧凑型字符串 old1:new1,old2:new2 返回每个项目的结果加上总计。秩序得到尊重;后面的配对可以引用前面的新名称。

发展

代码质量

此项目使用 拉夫 用于裁剪和格式化。配置已完成 ruff.toml.

手动运行Ruff

检查问题:

ruff check .

自动修复问题:

ruff check --fix .

检查格式问题:

ruff format --check .

格式代码:

ruff format .

GitHub 操作

GitHub Action工作流(.github/workflows/lint-format.yml)自动运行Ruff:

  • 每一次推 main 分支
  • 每个拉取请求都针对 main 分支

如果存在linting错误或格式问题,工作流将失败,从而确保CI中的代码质量。

贡献

欢迎捐款。请随时提交拉取请求。

目录标签

目录标签

逆向工程PythonClaude本地部署AI辅助分析二进制分析插件开发MCP协议

支持客户端

Claude DesktopClaudeCursorWindsurfCline

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

none

运行时(runtime,运行环境)

Python

工具数量(toolCount,工具数)

0

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdionone部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP