Ryuumonbuchi 标志

Ryuumonbuchi

社区
elliottophellia

Maybe the headless Ghidra MCP you are looking for.

发布者elliottophellia
代码仓库Ryuumonbuchi
语言Python
复刻数
4
星标数
79
可用工具
0
传输类型stdio
分类
许可协议GPL-2.0
链接
  • 将工具接入 AI 工作流

    Ryuumonbuchi 提供 MCP 功能,可供兼容的 AI 客户端和智能体使用。

  • 0 个可用工具

    浏览下方可调用的操作;如果服务器提供了名称和描述,也会一并显示。

  • 可直接复制的配置

    使用安装配置片段,在您首选的 MCP 客户端中配置此服务器。

  • 开源社区热度

    关联的代码仓库有 79 个 Star 和 4 个 Fork。

Ryuumonbuchi

Maybe the headless Ghidra MCP you are looking for.

Python License Ghidra MCP

Overview

Ryuumonbuchi turns Ghidra into a 217-tool Model Context Protocol server. An LLM agent opens a binary and drives analysis through typed tool calls: decompilation, disassembly, type reconstruction, patching, symbol and memory edits, and project export. No GUI automation, no hand-written analyzeHeadless scripts.

The server builds on the low-level MCP SDK (mcp.server.lowlevel) with a registry generated from one authoritative catalog. The catalog declares 217 dotted tool names; 212 map one-to-one onto methods of a persistent PyGhidra backend. health.ping and mcp.response_format are server-native, headless.run and headless.start are the native launcher paths, and operation.batch is the batching dispatcher.

Behind the transport, one persistent worker child holds a live PyGhidra/JVM session for the whole MCP lifespan. Repeated calls reuse the warmed backend instead of paying JVM startup per request.

Architecture

 MCP client ── stdio or streamable HTTP ──► Ryuumonbuchi server
                                          (low-level SDK, schema/policy dispatch)
                                                     │
                                                     │ protocol-v2, 8-byte length-prefixed socket IPC
                                                     ▼
                                          persistent worker child
                                          (lazy PyGhidra/JVM, multiple program sessions)
                                                     │
                                  ┌──────────────────┴───────────────────┐
                                  ▼                                      ▼
                          backend (PyGhidra)              headless.run ── analyzeHeadless
                          program sessions,                (separate process group)
                          decompiler, analysis

Three dispatch paths:

  1. Worker tools (212): validated against the catalog schema, sent to the persistent child over protocol-v2 IPC, run against a live program session.
  2. headless.run: spawns support/analyzeHeadless directly with the caller's argv in its own process group. No shell, no rewriting of arguments.
  3. operation.batch: 1 to 32 worker tools in one call; read-only batches run without a transaction, mutating batches wrap in one undo transaction with rollback on error.

Prerequisites

  • Ghidra 12.0 or newer. Its bundled JDK supplies Java, so no separate Java install is needed.
  • Python 3.10 through 3.13. Python 3.14 is not yet supported: pyghidra pins Jpype1==1.5.2, which ships no Python 3.14 wheel.
  • uv to run the documented workflow.

Install

Run the published package from PyPI:

bash
uvx ryuumonbuchi

uvx builds an isolated environment on first run and reuses it after.

To run the current main branch instead:

bash
uvx --from git+https://github.com/elliottophellia/Ryuumonbuchi@main ryuumonbuchi

For a local checkout:

bash
git clone https://github.com/elliottophellia/Ryuumonbuchi.git
cd ryuumonbuchi
uv sync --locked --all-groups
uv run ryuumonbuchi

Configuration

Precedence is CLI flag over environment variable over built-in default. Classpath, class-file, and VM-argument values from CLI and environment are combined rather than overridden.

CLI flagEnvironment variableDefaultDescription
--ghidra-install-dir PATHGHIDRA_INSTALL_DIR/usr/share/ghidra (/opt/homebrew/share/ghidra on macOS)Ghidra installation root
--max-heap-mb MIBRYUUMONBUCHI_MAX_HEAP_MB1024Worker JVM max heap, 256 to 8192
--max-cpu COUNTRYUUMONBUCHI_MAX_CPU2Worker CPU affinity count, 1 to os.cpu_count()
--operation-timeout-seconds SECONDSRYUUMONBUCHI_OPERATION_TIMEOUT_SECONDS900Per-operation wall-clock deadline, 30 to 86400
--max-import-bytes BYTESRYUUMONBUCHI_MAX_IMPORT_BYTES67108864Cap on program.open_bytes payloads
--max-response-bytes BYTESRYUUMONBUCHI_MAX_RESPONSE_BYTES4194304Inline response cap before spill-to-file
--max-log-tail-bytes BYTESRYUUMONBUCHI_MAX_LOG_TAIL_BYTES65536Worker log tail returned on failure
--classpath PATH (repeatable)RYUUMONBUCHI_CLASSPATH (path-separated)emptyExtra Java classpath entries
--class-file PATH (repeatable)RYUUMONBUCHI_CLASS_FILES (path-separated)emptyExtra Java class files to load
--vmarg ARG (repeatable)RYUUMONBUCHI_VMARGS (shlex)emptyExtra JVM arguments
--allow-exportRYUUMONBUCHI_ALLOW_EXPORTdisabledEnable export and save tools
--allow-import-bytesRYUUMONBUCHI_ALLOW_IMPORT_BYTESdisabledEnable program.open_bytes
--transport {stdio,http}RYUUMONBUCHI_TRANSPORTstdioMCP transport to serve
--http-host HOSTRYUUMONBUCHI_HTTP_HOST127.0.0.1Bind address for --transport http
--http-port PORTRYUUMONBUCHI_HTTP_PORT8765Bind port for --transport http, 1 to 65535
--http-path PATHRYUUMONBUCHI_HTTP_PATH/mcpStreamable HTTP mount path

[!IMPORTANT] program.export_binary, program.export_packed, program.save, program.save_as, and project.export require RYUUMONBUCHI_ALLOW_EXPORT=1 or --allow-export. program.open_bytes requires RYUUMONBUCHI_ALLOW_IMPORT_BYTES=1 or --allow-import-bytes, and obeys the byte cap. Both gates default to deny.

Tool surface

All 217 tools use dotted names and take a JSON object. Backend tools generally accept a session_id (returned by program.open or program.open_bytes) and are batch-eligible. A representative slice, drawn from the catalog:

CategoryExample tools
Program & sessionprogram.open, program.open_bytes, program.close, program.summary, program.report, program.mode.get/set, program.image_base.set, program.save, program.save_as, program.export_binary, program.export_packed
Analysis & tasksanalysis.update, analysis.update_and_wait, analysis.status, analysis.options.*, analysis.analyzers.*, analysis.clear_cache, task.analysis_update, task.status, task.result, task.cancel
Listing, decompilation, p-codelisting.disassemble.*, listing.code_units.list, listing.data.*, listing.clear, decomp.function, decomp.tokens, decomp.ast, decomp.writeback.*, pcode.function, pcode.block, pcode.op.at
Functions, symbols, types, layoutsfunction.*, symbol.*, namespace.create, class.create, type.*, layout.struct.*, layout.enum.*, layout.union.*, variable.*, parameter.*
References, search, graphsreference.*, search.*, graph.basic_blocks, graph.cfg.edges, graph.call_paths
Memorymemory.blocks.list, memory.read, memory.write, memory.block.*
Comments, bookmarks, tagscomment.*, bookmark.*, tag.*
Transactions & patchestransaction.*, patch.assemble, patch.nop, patch.branch_invert
Projects & metadataproject.*, metadata.query, metadata.store
External, source, relocationsexternal.*, source.file.*, source.map.*, relocation.*, equate.*
Open worldghidra.call, ghidra.eval, ghidra.script
Server-nativehealth.ping, mcp.response_format, headless.run, headless.start, operation.batch

Usage

A first-analysis sequence:

  1. health.ping: confirm the server responds; this never starts the JVM.
  2. program.open with path, read_only: true, update_analysis: false. Both read_only and update_analysis default to true when omitted, so set update_analysis: false when analysis options must be changed first.
  3. analysis.update_and_wait to run auto-analysis to completion.
  4. function.list to enumerate recovered functions.
  5. decomp.function on a function start address.
  6. program.close.

Function addresses and decompiler views

Function tools accept exact function entries and addresses contained within a function. An unresolved address remains an error rather than selecting a nearby function; the error reports the normalized address plus the nearest previous and next function entries.

decomp.function defaults to view: "raw", the complete Ghidra C output. Use view: "compact" only for initial triage of declaration-heavy functions:

json
{
  "session_id": "<session_id>",
  "function_start": 1053104,
  "view": "compact"
}

Compact output conservatively elides Ghidra-generated local declarations, is not compilable, and reports the omission count. Return to raw C, decomp.tokens, decomp.ast, or p-code when exact structure matters.

Typed tools come first. Sessions open read-only by default; switch program.mode.set to read_only: false only before intended mutations. Use operation.batch for 1 to 32 atomic program-bound calls. Treat ghidra.call, ghidra.eval, ghidra.script, headless.run, and headless.start as open-world execution. Inspect the second TextContent block for the full JSON result; the first is a compact summary. Close sessions with program.close when done.

Long operations

analysis.update_and_wait and headless.run block until they finish. When the client attaches a progress token to the call, both stream notifications/progress while they run:

  • analysis.update_and_wait runs as a worker task and polls it every 2 seconds. progress is elapsed seconds, total is operation_timeout_seconds, and message is Ghidra's current analyzer phase (for example Disassembled 14 K). Ghidra's task monitor rescopes its own counters per analyzer, so elapsed time is the only monotonic series available. Without a progress token the call keeps its original blocking behavior.
  • headless.run reports elapsed seconds against its timeout_seconds once per second.

headless.start takes the same arguments as headless.run minus terminal, returns immediately with {"task_id": "native-<hex>", "status": "running"}, and is polled with the regular task.status, task.result, and task.cancel tools. task.cancel terminates the launcher's whole process group. Background runs have no PTY, so terminal capture stays exclusive to headless.run.

Claude Code

Add the server under mcpServers in .mcp.json or ~/.claude.json:

json
{
  "mcpServers": {
    "ryuumonbuchi": {
      "type": "stdio",
      "command": "uvx",
      "args": [
        "ryuumonbuchi",
        "--ghidra-install-dir",
        "/usr/share/ghidra"
      ],
      "env": {
        "RYUUMONBUCHI_MAX_CPU": "4",
        "RYUUMONBUCHI_MAX_HEAP_MB": "2048"
      }
    }
  }
}

Codex

Add the server to ~/.codex/config.toml:

toml
[mcp_servers.ryuumonbuchi]
command = "uvx"
args = ["ryuumonbuchi", "--ghidra-install-dir", "/usr/share/ghidra"]
[mcp_servers.ryuumonbuchi.env]
RYUUMONBUCHI_MAX_CPU = "4"
RYUUMONBUCHI_MAX_HEAP_MB = "2048"

Streamable HTTP

The default transport is stdio. --transport http serves the same tool surface over MCP streamable HTTP:

bash
uv run ryuumonbuchi --transport http --http-port 8765

Clients connect to http://127.0.0.1:8765/mcp:

json
{
  "mcpServers": {
    "ryuumonbuchi": {
      "type": "http",
      "url": "http://127.0.0.1:8765/mcp"
    }
  }
}

One process serves one persistent worker and one JVM. Concurrent HTTP sessions share it and serialize on the worker lock.

[!WARNING] The HTTP transport is unauthenticated. It binds 127.0.0.1 by default, where DNS-rebinding protection restricts Host and Origin to loopback. Binding beyond loopback (--http-host 0.0.0.0) exposes every tool, including headless.run, ghidra.eval, and ghidra.script, to anyone who can reach the port. Put it behind an authenticating reverse proxy or a private network boundary.

Development

bash
uv sync --locked --all-groups     # install runtime and dev dependencies
uv run ryuumonbuchi --version     # print version and exit
uv run ryuumonbuchi --help        # list every CLI flag

Test tiers:

bash
uv run pytest tests/test_mcp_client_smoke.py tests/test_worker_lifecycle.py -q
uv run pytest -m "not live and not live_server" --cov=ryuumonbuchi --cov-branch --cov-report=term-missing --cov-fail-under=100

The live matrix requires a real Ghidra install plus Java 21 and a C compiler, and is skipped by default:

bash
RYUUMONBUCHI_REQUIRE_LIVE=1 GHIDRA_INSTALL_DIR=/usr/share/ghidra uv run pytest -m live tests/test_live_workflow.py -q

Static checks run with ruff check, ruff format --check, and strict pyright.

安装

TypingMind
{
  "mcpServers": {
    "ryuumonbuchi": {
      "command": "uvx",
      "args": [
        "ryuumonbuchi"
      ]
    }
  }
}

将 Ryuumonbuchi MCP 与多个 AI 模型配合使用

TypingMind 在工作区级别连接 MCP 工具,因此连接 Ryuumonbuchi 后,您就可以在 TypingMind 中搭配不同的 AI 模型使用,无需为每个模型单独设置。 此 MCP 通过您设备上的 TypingMind MCP 连接器在本地运行。

本地连接器设置指南

如果 MCP 服务器需要访问您电脑上的本地文件、应用或私有资源,请选择此方式。

1

打开 MCP 设置

在 TypingMind 中,依次前往“设置”、“高级设置”和“模型上下文协议”,然后选择“设置连接器”。

  1. 在您的浏览器中打开 TypingMind。
  2. 点击“设置”图标。
  3. 进入“高级设置”。
  4. 打开“模型上下文协议”部分。
  5. 点击“设置连接器”,然后选择“此设备”。
TypingMind MCP 连接器设置界面,已选择“此设备”
2

运行连接器命令

选择“此设备”,从 TypingMind 复制命令并在终端中运行。使用 MCP 时,请保持该进程运行。

  1. 复制 TypingMind 显示的设置命令。
  2. 在 macOS 上打开“终端”,或在 Windows 上打开 Windows Terminal。
  3. 粘贴并运行命令。
  4. 如果终端询问您是否继续,请确认安装软件包。
  5. 使用 MCP 工具时,请保持终端窗口及其中的进程运行。
3

将 Ryuumonbuchi 添加为服务器

当连接器状态为“就绪”时,点击“编辑服务器”,然后粘贴 MCP 服务器配置。

  1. 等待连接器状态显示为“就绪”。
  2. 点击“编辑服务器”。
  3. 粘贴 Ryuumonbuchi MCP 服务器配置。
  4. 保存服务器列表。
  5. 如需确认连接器是否仍处于就绪状态,请刷新。
TypingMind MCP 设置界面,显示正在运行的服务器和“编辑服务器”按钮
{
  "mcpServers": {
    "ryuumonbuchi": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

在不同模型中使用同一连接

保存服务器列表,打开“插件”,启用 Ryuumonbuchi MCP 工具,然后在 TypingMind 中选择任意受支持的 AI 模型,即可在聊天中使用这些工具,或将其分配给智能体。

  1. 在 TypingMind 中打开“插件”页面。
  2. 启用 Ryuumonbuchi MCP 工具。
  3. 开始聊天并选择您想使用的 AI 模型。
  4. 在聊天中使用 MCP 工具,或将其分配给 AI 智能体。
  5. 根据需要随时切换到其他 AI 模型,无需重新连接 MCP。
在 TypingMind 聊天中使用已启用的 MCP 工具和选定的 AI 模型
您能使用 Ryuumonbuchi 帮我完成这项任务吗?
Ryuumonbuchi
当然。我已阅读。
以下是我使用 Ryuumonbuchi 得到的结果。

常见问题

Ryuumonbuchi MCP 服务器有什么用途?

Ryuumonbuchi 是一个 MCP 服务器,可让兼容的 AI 客户端连接外部工具并获取上下文。在 TypingMind 中,只需添加一次此 MCP 服务器,即可在您的 AI 工作区中使用其工具。

可以在 TypingMind 中让多个 AI 模型使用 Ryuumonbuchi MCP 吗?

可以。TypingMind 在工作区层面连接 MCP 工具,因此您可以让 Claude、ChatGPT、Gemini 等不同 AI 模型,或您在 TypingMind 中配置的其他模型使用 Ryuumonbuchi,而无需为每个模型单独配置 MCP 服务器。

为什么在 TypingMind 中使用 Ryuumonbuchi MCP?

TypingMind 将多个 AI 模型、提示词、插件、AI 智能体、API 密钥和 MCP 工具整合到同一个工作区中,是优秀的大语言模型聊天前端之一。连接 Ryuumonbuchi 后,您可以在偏好的不同模型中使用其 MCP 工具,同时在 TypingMind 中井然有序地管理聊天工作流程。

如何将 Ryuumonbuchi MCP 连接到 TypingMind?

Ryuumonbuchi 通过 TypingMind 本地 MCP 连接器运行。当 MCP 服务器需要访问您计算机上的本地文件、桌面应用、命令行工具或私有资源时,这种方式最合适。

Ryuumonbuchi MCP 在 TypingMind 中提供哪些工具?

Ryuumonbuchi 提供 MCP 功能,您可以在 TypingMind 的插件页面启用这些功能,然后在聊天中使用,或将其分配给 AI 智能体。

使用 Ryuumonbuchi MCP 需要向 TypingMind 提供我的 API 密钥吗?

不需要。TypingMind 采用本地优先的设计,让您自行掌控模型提供商、API 密钥、提示词和 MCP 配置。如果 Ryuumonbuchi 需要身份验证,请在创建连接时,为该 MCP 服务器添加所需的请求头、OAuth 设置或本地配置。

相关 MCP 服务器

查看全部

立即创建您自己的 AI 工作区

订阅我们的电子简报,获取新功能和后续赠奖活动的通知 👇