Skip to main content
Glama

ghidraMCP

by LaurieWired

ghidra\_MCP\_logo

ghidraMCP

ghidraMCP 是一个模型上下文协议 (MLM) 服务器,允许 LLM 自主地对应用程序进行逆向工程。它向 MCP 客户端公开了 Ghidra 核心功能中的众多工具。

https://github.com/user-attachments/assets/36080514-f227-44bd-af84-78e29ee1d7f9

特征

MCP 服务器 + Ghidra 插件

  • 在 Ghidra 中反编译和分析二进制文件
  • 自动重命名方法和数据
  • 列出方法、类、导入和导出

安装

先决条件

吉德拉

首先,从此仓库下载最新版本。其中包含 Ghidra 插件和 Python MCP 客户端。然后,你可以直接将插件导入 Ghidra。

  1. 运行 Ghidra
  2. 选择File -> Install Extensions
  3. 点击+按钮
  4. 从下载的版本中选择GhidraMCP-1-2.zip (或您选择的版本)
  5. 重启 Ghidra
  6. 确保在File -> Configure -> Developer中启用了 GhidraMCPPlugin
  7. 可选:使用Edit -> Tool Options -> GhidraMCP HTTP Server在 Ghidra 中配置端口

视频安装指南:

https://github.com/user-attachments/assets/75f0c176-6da1-48dc-ad96-c182eb4648c3

MCP 客户端

理论上,任何 MCP 客户端都可以与 ghidraMCP 兼容。下面给出了三个示例。

示例 1:Claude Desktop

要将 Claude Desktop 设置为 Ghidra MCP 客户端,请转到Claude -> Settings -> Developer -> Edit Config -> claude_desktop_config.json并添加以下内容:

{ "mcpServers": { "ghidra": { "command": "python", "args": [ "/ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py", "--ghidra-server", "http://127.0.0.1:8080/" ] } } }

或者,直接编辑此文件:

/Users/YOUR_USER/Library/Application Support/Claude/claude_desktop_config.json

服务器 IP 和端口可配置,应设置为指向目标 Ghidra 实例。如果未设置,则两者均默认为 localhost:8080。

示例 2:克莱恩

要将 GhidraMCP 与Cline一起使用,还需要手动运行 MCP 服务器。首先运行以下命令:

python bridge_mcp_ghidra.py --transport sse --mcp-host 127.0.0.1 --mcp-port 8081 --ghidra-server http://127.0.0.1:8080/

唯一必需的参数是传输。如果所有其他参数均未指定,则默认为上述参数。MCP 服务器启动后,打开 Cline 并选择顶部的MCP Servers

克莱恩选择

然后选择Remote Servers并添加以下内容,确保 URL 与 MCP 主机和端口匹配:

  1. 服务器名称:GhidraMCP
  2. 服务器网址: http://127.0.0.1:8081/sse 8081/sse

例 3:5ire

另一个支持后端多种模型的 MCP 客户端是5ire 。要设置 GhidraMCP,请打开 5ire,然后前往Tools -> New ,并设置以下配置:

  1. 工具密钥:ghidra
  2. 名称:GhidraMCP
  3. 命令: python /ABSOLUTE_PATH_TO/bridge_mcp_ghidra.py

从源代码构建

  1. 将以下文件从 Ghidra 目录复制到此项目的lib/目录:
  • Ghidra/Features/Base/lib/Base.jar
  • Ghidra/Features/Decompiler/lib/Decompiler.jar
  • Ghidra/Framework/Docking/lib/Docking.jar
  • Ghidra/Framework/Generic/lib/Generic.jar
  • Ghidra/Framework/Project/lib/Project.jar
  • Ghidra/Framework/SoftwareModeling/lib/SoftwareModeling.jar
  • Ghidra/Framework/Utility/lib/Utility.jar
  • Ghidra/Framework/Gui/lib/Gui.jar
  1. 通过运行以下命令使用 Maven 进行构建:

mvn clean package assembly:single

生成的 zip 文件包含构建的 Ghidra 插件及其资源。这些文件是 Ghidra 识别新扩展所必需的。

  • lib/GhidraMCP.jar
  • 扩展属性
  • 模块清单
-
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.

MCP 服务器允许 LLM 通过公开 Ghidra 功能自主地对应用程序进行逆向工程,从而实现方法和数据的反编译、分析和自动重命名。

  1. 特征
    1. 安装
      1. 先决条件
      2. 吉德拉
      3. MCP 客户端
      4. 示例 1:Claude Desktop
      5. 示例 2:克莱恩
      6. 例 3:5ire
    2. 从源代码构建

      Related MCP Servers

      • A
        security
        A
        license
        A
        quality
        An MCP server that enables secure terminal command execution, directory navigation, and file system operations through a standardized interface for LLMs.
        Last updated -
        10
        23
        Python
        MIT License
        • Apple
      • A
        security
        F
        license
        A
        quality
        A lightweight MCP server that provides a unified interface to various LLM providers including OpenAI, Anthropic, Google Gemini, Groq, DeepSeek, and Ollama.
        Last updated -
        6
        218
        Python
      • -
        security
        F
        license
        -
        quality
        Enables LLMs to perform binary analysis using Ghidra in headless mode, extracting functions, pseudocode, structs, and enums from binaries for interactive reverse-engineering.
        Last updated -
        1
        Python
      • A
        security
        A
        license
        A
        quality
        MCP server implementation that enables LLMs to interact with Rollbar error tracking data, allowing users to list and analyze errors, view occurrences, track deployments, and access project information.
        Last updated -
        13
        256
        2
        TypeScript
        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/LaurieWired/GhidraMCP'

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