ghidra-mcp-server docker container (via bash).
!/bin/bash
Define variables
GHIDRA_VERSION="11.3.2"
GHIDRA_ZIP="ghidra_${GHIDRA_VERSION}PUBLIC_20250322.zip"
GHIDRA_URL="https://github.com/NationalSecurityAgency/ghidra/releases/download/Ghidra${GHIDRA_VERSION}_build/${GHIDRA_ZIP}"
Create Dockerfile
cat < Dockerfile
FROM eclipse-temurin:17-jdk-jammy
1. Install system dependencies
RUN apt-get update && apt-get install -y \
python3 \
python3-pip \
unzip \
wget \
&& rm -rf /var/lib/apt/lists/*
2. Download and Install Ghidra
WORKDIR /opt
RUN wget ${GHIDRA_URL} \
&& unzip ${GHIDRA_ZIP} && rm ${GHIDRA_ZIP} \
&& mv ghidra_* ghidra
3. Setup GhidraMCP Extension
Assuming the GhidraMCP zip is in the current directory
COPY GhidraMCP-1-4.zip /opt/ghidra/Ghidra/Extensions/
4. Setup Python Environment
WORKDIR /app
COPY bridge_mcp_ghidra.py .
RUN pip3 install requests mcp
5. Add entrypoint script
COPY entrypoint.sh .
RUN chmod +x entrypoint.sh
EXPOSE 8080 8081
ENTRYPOINT ["./entrypoint.sh"]
EOF
Create entrypoint.sh
cat < entrypoint.sh
!/bin/bash
Start Ghidra in Headless mode with the MCP plugin enabled
Note: You may need a Ghidra script to keep the HTTP server alive
echo "Starting Ghidra Headless Analyzer..."
/opt/ghidra/support/analyzeHeadless /tmp/project TemporaryProject -import /app/binary_to_analyze &
Wait for Ghidra's HTTP server to initialize
sleep 10
Start the Python MCP Bridge
echo "Starting Python MCP Bridge..."
python3 bridge_mcp_ghidra.py --transport sse --mcp-port 8081 --ghidra-server http://127.0.0.1:8080/
EOF
chmod +x entrypoint.sh
echo "Setup complete. Run 'docker build -t ghidra-mcp .' to build your image."