This example shows how to build an MCP (Model Context Protocol) server that exposes GhidraInsight resources.
Analyze a binary file:
{
"jsonrpc": "2.0",
"method": "resources/read",
"params": {
"uri": "resource://ghidra/binary",
"data": {
"file": "binary.elf",
"features": ["crypto", "taint", "vulnerabilities"]
}
}
}Analyze a function at an address:
{
"jsonrpc": "2.0",
"method": "resources/read",
"params": {
"uri": "resource://ghidra/function/0x401234",
"data": {
"depth": 2
}
}
}Tool for binary analysis:
{
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"name": "ghidra_analyze",
"arguments": {
"file": "binary.elf",
"features": ["crypto", "vulnerabilities"]
}
}
}With MCP configured, Claude can use GhidraInsight directly:
User: "Analyze binary.elf for vulnerabilities"
Claude: [Uses ghidra_analyze tool]
Claude: "Based on the analysis, I found 3 high-severity issues..."
See mcp_server.py for implementation details.