PcmHackMCP

PcmHackMCP

MCP server and Ghidra plugin for reverse engineering, enabling clients like Claude to control Ghidra. Adds a run_python tool to execute arbitrary Jython scripts server-side.

Category
访问服务器

README

License

PcmHackMCP

PcmHackMCP is a fork of LaurieWired/GhidraMCP (Apache-2.0): a Model Context Protocol (MCP) server plus Ghidra plugin that lets MCP clients (Claude, etc.) drive Ghidra for reverse engineering.

It keeps all of the upstream tools and adds one thing: a server-side run_python tool that executes an arbitrary Jython script inside Ghidra in a single call. Bulk work - mass renames, xref sweeps, batch comments, applying data types over many addresses - runs as one loop inside Ghidra instead of thousands of individual MCP/HTTP round-trips. Only the printed result crosses the wire.

To run alongside the original GhidraMCP without clashing, every identifier is renamed and the default port is changed:

Upstream GhidraMCP PcmHackMCP
MCP server name ghidra-mcp pcmhack-mcp
Ghidra module / extension GhidraMCP PcmHackMCP
Java class com.lauriewired.GhidraMCPPlugin com.pcmhack.mcp.PcmHackMCPPlugin
Default HTTP port 8080 8765
MCP bridge script bridge_mcp_ghidra.py bridge_mcp_pcmhack.py

Features

  • Everything in upstream GhidraMCP (decompile, list/rename functions and data, imports/exports, xrefs, strings, set prototypes, and more).
  • run_python(code, timeout=600) - run an arbitrary Jython script server-side against the current program. Full GhidraScript environment is available (currentProgram, the flat API, monitor); a program transaction is opened and committed automatically; both print(...) and println(...) output is captured and returned.

Install

Prerequisites

  • Ghidra 11.3.2
  • Python 3.10+ and the MCP SDK: pip install "mcp>=1.2.0,<2" "requests>=2,<3"

Ghidra plugin

  1. Run Ghidra
  2. File -> Install Extensions
  3. Click + and select PcmHackMCP-11.3.2.zip
  4. Restart Ghidra
  5. Enable PcmHackMCP in File -> Configure -> Developer
  6. Optional: change the port in Edit -> Tool Options -> PcmHackMCP HTTP Server (default 8765)

MCP client (Claude Desktop example)

Claude -> Settings -> Developer -> Edit Config, then:

{
  "mcpServers": {
    "pcmhack": {
      "command": "py",
      "args": [
        "-3",
        "C:\\ABSOLUTE_PATH_TO\\bridge_mcp_pcmhack.py",
        "--ghidra-server",
        "http://127.0.0.1:8765/"
      ]
    }
  }
}

Host/port default to 127.0.0.1:8765 if not set.

Claude Code

claude mcp add pcmhack -- py -3 "C:\ABSOLUTE_PATH_TO\bridge_mcp_pcmhack.py"

run_python example

curl -s -X POST http://127.0.0.1:8765/run_python --data-binary @- <<'PY'
count = 0
for f in currentProgram.getFunctionManager().getFunctions(True):
    if f.getName().startswith("FUN_"):
        count += 1
print("auto-named functions:", count)
PY

The script runs inside Ghidra and returns its printed output.

Security: the embedded HTTP server binds to all interfaces and run_python executes arbitrary code in your Ghidra session. Run it only on a trusted network.

Claude Code skill

A Claude Code skill ships with this repo at .claude/skills/pcmhack-mcp/SKILL.md. It captures the discipline for writing good run_python payloads: the whole-script model, printing results as JSON, the automatic (commit-on-error) transaction, and the Jython 2.7 traps that bite. It loads automatically when you work with run_python.

Build from source

No Maven required (it is a single source file). With JDK 17-21:

  1. Copy these jars from your Ghidra install into lib/:
    • Base.jar, Decompiler.jar, Docking.jar, Generic.jar, Project.jar, SoftwareModeling.jar, Utility.jar, Gui.jar
  2. Compile and package:
    javac --release 17 -cp "lib/*" -d build/classes src/main/java/com/pcmhack/mcp/PcmHackMCPPlugin.java
    jar --create --file target/PcmHackMCP.jar --manifest src/main/resources/META-INF/MANIFEST.MF -C build/classes .
    
  3. Stage an extension folder target/ext/PcmHackMCP/ containing extension.properties, Module.manifest, and lib/PcmHackMCP.jar, then zip it with the jar tool:
    jar --create --file target/PcmHackMCP-11.3.2.zip -C target/ext PcmHackMCP
    
    Do not zip it with PowerShell Compress-Archive or .NET ZipFile.CreateFromDirectory - on Windows PowerShell 5.1 both write backslash zip entry paths, which Ghidra's installer rejects ("Unexpected error installing extension"). The jar tool writes forward-slash paths and directory entries, which Ghidra accepts.

Or, if you have Maven installed: mvn clean package assembly:single.

Credits

Fork of GhidraMCP by LaurieWired. Licensed under Apache-2.0; see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选