Sign inSign up

poynt2005/ghidra-mcp-server

By poynt2005

•Updated about 2 months ago

Image
0

192

poynt2005/ghidra-mcp-server repository overview

⁠Ghidra MCP Server

Turn Ghidra's headless decompiler into a searchable MCP service for AI-assisted reverse engineering. Upload a PE, ELF, or Mach-O binary, run a full static analysis, and let an MCP client navigate functions, decompiled code, strings, cross-references, call graphs, initialized memory, and a triage summary.

The server does not include an LLM and does not require an AI API key. It exposes analysis tools to whichever MCP client and model you choose.

⁠Highlights

  • Ghidra 12.1.2 headless analysis with quick, standard, and deep profiles
  • PE, ELF, and Mach-O input through HTTP upload or a read-only mounted directory
  • Public PDB retrieval from the Microsoft Symbol Server for supported PE files
  • Up-front decompilation with an on-disk SQLite/FTS5 index for fast queries
  • Thirteen bounded MCP tools for jobs, triage, code navigation, data, and cleanup
  • SHA-256 content addressing and per-profile analysis caching
  • Untrusted-content fencing and response-size limits for model-facing output
  • Optional bearer authentication and browser Origin validation
  • A non-root container with dropped Linux capabilities and no sample execution

⁠Quick start

Create local persistence directories and start the container:

mkdir -p data samples
sudo chown -R 10001:10001 data

docker run -d \
  --name ghidra-mcp \
  --restart unless-stopped \
  -p 8080:8080 \
  --memory 10g \
  --memory-swap 10g \
  --pids-limit 2048 \
  --cap-drop ALL \
  --security-opt no-new-privileges:true \
  -v "$(pwd)/data:/data" \
  -v "$(pwd)/samples:/data/samples:ro" \
  <dockerhub-user>/ghidra-mcp-server:latest

The image runs as UID/GID 10001. Check readiness with:

curl http://localhost:8080/health

Configure a Streamable HTTP MCP client with:

{
  "mcpServers": {
    "ghidra": {
      "type": "http",
      "url": "http://localhost:8080/mcp"
    }
  }
}

Upload binaries with POST /upload as multipart form data in a field named file. Uploading does not automatically start analysis; call submit_analysis with the returned binary ID.

⁠MCP tools

  • Jobs: submit_analysis, get_job_status, cancel_job, list_binaries
  • Overview: get_triage_report
  • Navigation: list_functions, get_function, search_code, list_strings, get_xrefs, get_callgraph
  • Data: get_data
  • Administration: delete_binary

Two prompt templates are included: reverse_engineer_binary and find_capability.

⁠Security warning

The default configuration listens on 0.0.0.0:8080 without authentication. Anyone who can reach the port can upload binaries, read cached analysis, and delete cached binaries. Use it only on a trusted network, or set AUTH_TOKEN and send Authorization: Bearer <token> with requests. Alternatively, publish only 127.0.0.1:8080:8080 and use an SSH tunnel.

This service performs static analysis and never intentionally executes an uploaded sample. Treat uploaded binaries and all decompiler output as hostile content regardless.

⁠Important environment variables

VariableDefaultPurpose
AUTH_TOKENemptyEnables bearer authentication when set
MCP_ALLOWED_ORIGINSemptyComma-separated browser origins; empty rejects all requests carrying Origin
GHIDRA_HEADLESS_MAXMEM8GGhidra JVM heap
DECOMPILE_THREADS12Parallel decompiler threads
MAX_CONCURRENT_JOBS1Simultaneous analysis jobs
CACHE_MAX_BYTES53687091200Analysis cache limit (50 GiB)
SYMBOL_MAX_BYTES5368709120Public-symbol store limit (5 GiB)
DISK_MIN_FREE_BYTES10737418240Free-space safety floor (10 GiB)
MAX_UPLOAD_BYTES524288000Upload limit (500 MiB)
SYMBOL_DOWNLOAD1Set to 0 to disable PDB downloads
MEMORY_DUMP_MAX_BYTES536870912Maximum initialized-memory export per analysis
MAX_DATA_BYTES4096Maximum bytes returned by one get_data call

The defaults target a host with roughly 16 CPU cores and 14.5 GiB of RAM. Tune the memory and concurrency settings together for smaller systems.

⁠Persistent data and source

All state is stored below /data, including uploads, Ghidra projects, decompiled functions, indexes, logs, job metadata, and downloaded symbols. Source code, Compose deployment, full configuration details, and development instructions are in the poynt2005/ghidra-mcp-server GitHub repository.

Tag summary

Content type

Image

Digest

sha256:2cc1b995e…

Size

743.4 MB

Last updated

about 2 months ago

docker pull poynt2005/ghidra-mcp-server