
pyghidra-mcp v0.2.5
Python 명령줄 Ghidra MCP
PyGhidra-MCP - Ghidra Model Context Protocol 서버
개요
**pyghidra-mcp**는 강력한 소프트웨어 리버스 엔지니어링(SRE) 제품군인 Ghidra의 모든 분석 기능을 지능형 에이전트와 LLM 기반 도구의 세계로 가져오는 명령줄 Model Context Protocol(MCP) 서버입니다.
Ghidra의 ProgramAPI와 FlatProgramAPI를 pyghidra와 jpype를 사용하여 Python으로 연결한 다음, 그 기능을 Model Context Protocol을 통해 노출합니다.
MCP는 언어 모델, 개발 도구(예: VS Code), 자율 에이전트가 구조화된 컨텍스트에 접근하고, 도구를 호출하며, 지능적으로 협업할 수 있게 해주는 통합 인터페이스입니다. MCP를 강력한 분석 도구와 LLM 생태계 사이의 다리라고 생각하면 됩니다.
pyghidra-mcp를 사용하면 Ghidra는 지능형 백엔드가 됩니다. 컨텍스트가 풍부한 쿼리에 응답하고, 심층 리버스 엔지니어링 작업을 자동화하며, AI 지원 워크플로에 통합될 준비가 된 백엔드입니다.
pyghidra-mcp는 이제 두 가지 운영 모드를 지원합니다:
- CLI 기반 분석 및 자동화를 위한
headless모드 pyghidra-mcp를 통해 Ghidra를 실행하고 실행 중인 GUI와 라이브 프로그램 상태를 공유하는--gui모드
[!NOTE] 이 베타 프로젝트는 활발히 개발 중입니다. 여러분의 피드백, 버그 리포트, 기능 요청, 코드를 기다리고 있습니다.
또 다른 Ghidra MCP?
네, 원래의 ghidra-mcp는 훌륭합니다. 하지만 pyghidra-mcp는 다른 접근 방식을 취합니다:
- 🐍 헤드리스 우선, GUI 지원 – 간소화된 자동화를 위해 전적으로 CLI로 실행하거나, 라이브 GUI 탐색 및 편집을 원할 때
--gui로 Ghidra를 실행할 수 있습니다. - 🔁 자동화를 위해 설계됨 – LLM, CI 파이프라인, 반복 가능한 동작이 필요한 도구와의 통합에 이상적입니다.
- ✅ CI/CD 친화적 – 클라이언트와 서버 세션 모두를 위한 견고한 단위 및 통합 테스트로 구축되었습니다.
- 🚀 빠른 시작 – 비동기 시작을 통해 바이너리가 백그라운드에서 분석되는 동안에도 서버가 요청 처리를 시작할 수 있습니다. 최소한의 설정으로 빠른 명령줄 실행을 지원합니다.
- 📦 프로젝트 전체 분석 – Ghidra 프로젝트의 모든 바이너리에 대한 동시 리버스 엔지니어링을 가능하게 합니다
- 🤖 에이전트 준비 완료 – 지능형 에이전트 기반 워크플로와 대규모 리버스 엔지니어링 자동화를 위해 구축되었습니다.
- 🔍 시맨틱 코드 검색 – 벡터 임베딩(ChromaDB 사용)을 통해 디컴파일된 함수, 주석, 심볼 전반에 걸친 빠르고 유연한 조회를 가능하게 합니다. 의사 C 탐색과 에이전트 기반 트리아지에 완벽합니다.
이 프로젝트는 로컬 개발, 헤드리스 환경, 테스트 가능한 워크플로에 최적화된 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"]
- 헤드리스 MCP:
streamable-http를 사용하세요. Ghidra와 그 프로젝트를 하나의 장기 실행 서버로 유지하며, MCP 호스트와 CLI 클라이언트 모두에서 작동합니다. - GUI 모드:
pyghidra-mcp는 Ghidra를 실행하고, 프로젝트를 열며, 동일한 JVM에서 CodeBrowser를 제어하는 추가 도구를 노출합니다. - CLI 클라이언트:
pyghidra-mcp-cli는 HTTP 클라이언트입니다. 먼저streamable-http서버를 시작한 다음, 실행 중인 서버에 대해 터미널 명령을 실행하세요. - stdio: HTTP 엔드포인트에 연결할 수 없는 MCP 호스트에만 이 옵션을 유지하세요.
자세한 아키텍처 및 도구 표면
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
목차
- PyGhidra-MCP - Ghidra 모델 컨텍스트 프로토콜 서버
시작하기
Python 패키지와 uv를 사용하여 지속적인 스트리머블 HTTP 서버를 시작하세요: