Python 명령줄 Ghidra MCP
**pyghidra-mcp**는 강력한 소프트웨어 리버스 엔지니어링(SRE) 제품군인 Ghidra의 모든 분석 기능을 지능형 에이전트와 LLM 기반 도구의 세계로 가져오는 명령줄 모델 컨텍스트 프로토콜(MCP) 서버입니다.
pyghidra와 jpype를 사용하여 Ghidra의 ProgramAPI와 FlatProgramAPI를 Python에 연결한 다음, 해당 기능을 모델 컨텍스트 프로토콜을 통해 노출합니다.
MCP는 언어 모델, 개발 도구(예: VS Code), 자율 에이전트가 구조화된 컨텍스트에 접근하고, 도구를 호출하며, 지능적으로 협업할 수 있게 해주는 통합 인터페이스입니다. MCP를 강력한 분석 도구와 LLM 생태계 사이의 다리라고 생각하면 됩니다.
pyghidra-mcp를 사용하면 Ghidra는 지능형 백엔드가 되어 컨텍스트가 풍부한 쿼리에 응답하고, 심층 리버스 엔지니어링 작업을 자동화하며, AI 지원 워크플로에 통합될 준비를 갖춥니다.
pyghidra-mcp는 이제 두 가지 작동 모드를 지원합니다:
headless 모드pyghidra-mcp를 통해 Ghidra를 실행하고 실행 중인 GUI와 라이브 프로그램 상태를 공유하는 --gui 모드[!NOTE] 이 베타 프로젝트는 활발히 개발 중입니다. 피드백, 버그 보고, 기능 요청, 코드를 보내주시면 감사하겠습니다.
네, 원래의 ghidra-mcp는 훌륭합니다. 하지만 pyghidra-mcp는 다른 접근 방식을 취합니다:
--gui로 Ghidra를 실행할 수 있습니다.이 프로젝트는 로컬 개발, 헤드리스 환경, 테스트 가능한 워크플로에 최적화된 Python 우선 경험을 제공합니다.
flowchart LR
subgraph Clients["Clients"]
Agent["MCP host / agent"]
Cli["pyghidra-mcp-cli"]
User["Ghidra user"]
end
subgraph Process["pyghidra-mcp process"]
Transport["streamable HTTP (recommended)<br/>stdio (local fallback)"]
Tools["MCP tools"]
Context["PyGhidra context"]
end
Project["Ghidra project<br/>.gpr / .rep"]
Artifacts["MCP artifacts<br/>ChromaDB + GZF cache"]
Gui["Ghidra GUI / CodeBrowser<br/>only with --gui"]
Agent -->|"HTTP (recommended)"| Transport
Cli -->|"HTTP only"| Transport
Transport --> Tools
Tools --> Context
Context --> Project
Context --> Artifacts
Context -.-> Gui
User -.-> Gui
Gui -.-> Project
flowchart TD
Start["What do you need?"]
Start --> Headless["Agent or automation"]
Start --> GuiNeed["Live Ghidra GUI control"]
Start --> Terminal["Interactive terminal client"]
Headless --> Http["pyghidra-mcp<br/>--transport streamable-http"]
GuiNeed --> GuiMode["pyghidra-mcp --gui<br/>--transport streamable-http<br/>--project-path project.gpr"]
Terminal --> HttpServer["Start pyghidra-mcp<br/>--transport streamable-http"]
HttpServer --> CliMode["Run pyghidra-mcp-cli commands"]
streamable-http를 사용하세요. Ghidra와 해당 프로젝트를 하나의 장기 실행 서버로 유지하며 MCP 호스트와 CLI 클라이언트 모두에서 작동합니다.pyghidra-mcp는 Ghidra를 실행하고 프로젝트를 열며, 동일한 JVM에서 CodeBrowser를 제어하는 추가 도구를 노출합니다.pyghidra-mcp-cli는 HTTP 클라이언트입니다. 먼저 streamable-http 서버를 시작한 다음, 실행 중인 해당 서버에 대해 터미널 명령을 실행하세요.flowchart TD
subgraph Clients
Agent["LLM / MCP host"]
Cli["pyghidra-mcp-cli"]
Automation["scripts and CI"]
end
subgraph Transports
Stdio["stdio"]
Http["streamable-http"]
Sse["sse legacy"]
end
subgraph Server["pyghidra-mcp server"]
McpServer["MCPServer tool server"]
Context["PyGhidra context"]
Indexing["background analysis and Chroma indexing"]
subgraph Tools["MCP tools"]
Analysis["decompile, xrefs, bytes, callgraph"]
Search["symbols, strings, code"]
ProjectOps["import, delete, metadata, list binaries"]
Edits["rename function, rename variable, set type, set prototype, set comment"]
GuiOnly["GUI only: open program, goto, list open programs, set current program"]
end
end
subgraph GhidraRuntime["Ghidra runtime"]
PyGhidra["pyghidra"]
Jpype["JPype shared JVM"]
Project["Ghidra project"]
Programs["program databases"]
CodeBrowser["Ghidra GUI / CodeBrowser"]
end
Agent --> Http
Automation --> Http
Automation --> Sse
Cli --> Http
Stdio --> McpServer
Http --> McpServer
Sse --> McpServer
McpServer --> Context
Context --> PyGhidra
PyGhidra --> Jpype
Jpype --> Project
Project --> Programs
Context --> Indexing
Indexing --> Search
McpServer --> Tools
Tools --> Context
GuiOnly -.-> CodeBrowser
Context -.-> CodeBrowser
Python 패키지와 uv를 사용하여 지속적인 스트리머블 HTTP 서버를 시작하세요:
uvx pyghidra-mcp \
--transport streamable-http \
--project-path /absolute/path/to/ghidra-projects \
/absolute/path/to/binary
그러면 서버는 http://127.0.0.1:8000/mcp에서 사용할 수 있습니다. 서버를 계속 실행한 상태로 두고 MCP 클라이언트가 해당 URL을 사용하도록 구성하십시오. 아래의 Claude Code 및 Codex 예시는 예상되는 구성을 보여줍니다.
MCP에서 실행 중인 Ghidra GUI를 시작하고 제어하려면 streamable-http와 함께 --gui를 사용하십시오: