Skip to main content
Glama

Binary Ninja MCP

by fosdickio

二进制忍者 MCP

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

特征

  • Binary Ninja 和 MCP 客户端之间的无缝实时集成

  • 借助人工智能增强逆向工程工作流程

  • 主要支持 Claude Desktop 作为 MCP 客户端,但可扩展用于其他集成

示例

生成二进制分析报告

二进制分析报告生成

重命名函数

重命名函数演示

成分

该存储库包含两个独立的组件:

  1. 一个 Binary Ninja 插件,它提供了一个 MCP 服务器,可以通过 HTTP 端点公开 Binary Ninja 的功能。它可以与任何实现了 MCP 协议的客户端一起使用。

  2. 一个独立的 MCP 桥接组件,用于将您常用的 MCP 客户端连接到 Binary Ninja MCP 服务器。虽然 Claude Desktop 是主要的集成路径,但 MCP 服务器也可以与其他客户端一起使用。

支持的集成

下表详细说明了当前支持与 Binary Ninja 的集成。

功能

描述

get_binary_status

获取已加载二进制文件的当前状态。

list_classes

列出程序中的所有命名空间/类名。

list_data_items

列出定义的数据标签及其值。

list_exports

列出导出的函数/符号。

list_imports

列出程序中导入的符号。

list_methods

列出程序中的所有函数名称。

list_namespaces

列出程序中的所有非全局命名空间。

list_segments

列出程序中的所有内存段。

rename_data

重命名指定地址处的数据标签。

rename_function

将函数的当前名称重命名为新的用户定义名称。

search_functions_by_name

搜索名称包含给定子字符串的函数。

decompile_function

按名称反编译特定函数并返回反编译的 C 代码。

set_comment

在特定地址设置评论。

set_function_comment

为函数设置注释。

get_comment

获取特定地址的评论。

get_function_comment

获取函数的注释。

delete_comment

删除特定地址的评论。

delete_function_comment

删除函数的注释。

get_assembly_function

通过名称或地址获取函数的汇编表示。

function_at

检索地址所属函数的名称。

code_references

检索调用给定函数的函数的名称和地址。

get_user_defined_type

检索用户定义类型(结构、枚举、typedef、联合)的定义。

rename_variable

重命名给定函数内的变量。

retype_variable

在给定函数内重新输入变量。

define_types

从 C 字符串类型定义添加类型定义。

edit_function_signature

编辑给定函数的签名,以类型字符串形式给出。

先决条件

安装

二进制忍者插件

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

插件管理器列表

要手动配置插件,可以将此存储库复制到 Binary Ninja 插件文件夹中。

Claude 桌面桥(可选)

仅当您想使用 Claude Desktop 作为 MCP 客户端时才需要执行此操作。请确保您已先配置好虚拟环境:

git clone git@github.com:fosdickio/binary_ninja_mcp.git cd binary_ninja_mcp python3 -m venv .venv source .venv/bin/activate # On macOS/Linux pip install -r bridge/requirements.txt

自动配置(Mac)

在 Mac 上,您可以通过运行以下命令来自动执行设置:

./scripts/setup_claude_desktop.py

手动配置

在其他操作系统上或手动配置 Claude Desktop 集成:

  1. 导航至Settings > Developer > Edit Config

  2. 添加以下配置:

{ "mcpServers": { "binary_ninja_mcp": { "command": "/ABSOLUTE/PATH/TO/binary_ninja_mcp/.venv/bin/python", "args": [ "/ABSOLUTE/PATH/TO/binary_ninja_mcp/bridge/binja_mcp_bridge.py" ] } } }

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

用法

克劳德桌面

  1. 打开 Binary Ninja 并安装Binary Ninja MCP插件

  2. 重新启动 Binary Ninja,然后打开二进制文件

  3. 启动 MCP 服务器( Plugins > MCP Server > Start MCP Server

  4. 启动 Claude Desktop

打开 Claude Desktop 后,集成将自动可用。

克劳德积分

现在你可以开始向 Claude 询问当前打开的二进制文件了。示例提示:

  • “为当前二进制生成二进制分析报告。”

  • “在当前二进制文件中将函数 X 重命名为 Y。”

  • “列出当前二进制文件中的所有函数。”

  • “加载的二进制文件的状态是什么?”

其他 MCP 客户端集成

通过实现适当的集成层,该桥可以与其他 MCP 客户端一起使用。

发展

项目结构组织如下:

binary_ninja_mcp/ ├── bridge/ # MCP client integration ├── plugin/ # Binary Ninja plugin ├── scripts/ │ └── setup_claude_desktop.py # Setup script for Claude Desktop

贡献

欢迎贡献代码。欢迎提交 Pull 请求。

-
security - not tested
A
license - permissive license
-
quality - not tested

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

该服务器能够将 Binary Ninja 的逆向工程功能与 LLM 辅助功能无缝集成,从而允许 Claude 等 AI 工具实时与二进制分析功能进行交互。

  1. 特征
    1. 示例
      1. 生成二进制分析报告
      2. 重命名函数
    2. 成分
      1. 支持的集成
        1. 先决条件
          1. 安装
            1. 二进制忍者插件
            2. Claude 桌面桥(可选)
          2. 用法
            1. 克劳德桌面
            2. 其他 MCP 客户端集成
          3. 发展
            1. 贡献

              Related MCP Servers

              • A
                security
                F
                license
                A
                quality
                The server facilitates natural language interactions for exploring and understanding codebases, providing insights into data models and system architecture using a cost-effective, simple setup with support for existing Claude Pro subscriptions.
                Last updated -
                4
                20
                • Apple
              • A
                security
                A
                license
                A
                quality
                Chat with your codebase through intelligent code searching without embeddings by breaking files into logical chunks, giving the LLM tools to search these chunks, and letting it find specific code needed to answer your questions.
                Last updated -
                8
                55
                MIT License
              • -
                security
                A
                license
                -
                quality
                A Model Context Protocol server that enables Large Language Models to interact with Binary Ninja for reverse engineering tasks like viewing assembly code, decompiled code, renaming functions, and adding comments.
                Last updated -
                2
                MIT License
                • Linux
                • Apple
              • A
                security
                A
                license
                A
                quality
                A multi-language code analysis server that helps LLMs or humans automatically lint, type-check, and improve code with minimal installation friction, currently supporting Python with plans for other languages.
                Last updated -
                1
                3
                MIT License

              View all related MCP servers

              MCP directory API

              We provide all the information about MCP servers via our MCP API.

              curl -X GET 'https://glama.ai/api/mcp/v1/servers/fosdickio/binary_ninja_mcp'

              If you have feedback or need assistance with the MCP directory API, please join our Discord server