Rogue Binary MCP
Death to Malware.
rbinmcp is a Rust MCP server for binary analysis, reverse engineering, and malware triage. It is built specifically for AI agents, with compact outputs and focused follow-up tools designed to keep analysis token cost low.
The project is intentionally focused on binary work. The production MCP surface helps an agent inspect binaries, collect evidence, compare artifacts, and pivot into deeper reverse-engineering views.
Public documentation: Rogue Binary Wiki
What It Provides
- Fast first-pass binary triage through
triage_binary - Static PE, ELF, and Mach-O parsing through
static_view - radare2-backed sessions, metadata, search, disassembly, decompilation, xrefs, traces, and compact function projections
- Ghidra-backed import, cached project inspection, decompilation, CFGs, xrefs, P-code, callsite facts, and targeted analysis slices
- Native wrappers for
file,strings,objdump,radiff2, and the Rustbinwalkcrate - Pure Rust analysis for hardening/security properties, static call graphs, capability clustering, fuzzable-function suggestions, component evidence, entropy, compiler and packer hints, crypto constants, DLL export shape, MBA simplification, and VM bytecode helpers
- AI-agent usability helpers for tool discovery, backend status, workflows, and error guidance
Run list_tools from an MCP client for the authoritative live tool list.
Start Here
Use these tools first when analyzing an unknown binary:
get_backend_status- confirm which optional backends are availablelist_toolsorlookup_tool- discover the exact live surfacetriage_binary- file hashes, format, sections, imports, function stats, strings, xref-heavy functions, and call-graph summarystatic_view- quick PE/ELF/Mach-O metadata without opening r2binary_security_properties- Rust-native hardening posture with direct evidence and bounded outputstatic_callgraph- Rust-native x86/x64 call graph summary with paged nodes, edges, confidence, and external fanoutbinary_capabilities- ranked capability families with import/callgraph evidence and source function attachmentsfuzzable_functions- bounded fuzz target suggestions with evidence and follow-up tool callsbinary_component_profile- high-confidence component evidence, imported libraries, and low-confidence runtime hintsr2_openthenr2_function_view- cheap function triage and compact control-flow contextghidra_importthenghidra_decompiler_calls- import once, then query focused decompiler projectionsghidra_callsite_facts- listing-grounded call argument evidence when pseudocode may be misleading
Tool Families
Orchestration
triage_binarybuilds a compact multi-backend overview for one binary.int_convertconverts decimal, hex, binary, and octal values with printable ASCII context.
Static Parsing
static_viewreads PE, ELF, and Mach-O metadata throughgoblin.- Supported static modes include format info, sections, imports, exports, relocations, libraries, and entry points.
- Universal/fat Mach-O containers are projected through a selected architecture slice so agents can inspect real sections, imports, libraries, and entry points without a separate preprocessing step.
export_hash_resolveresolves API/export hashes against local PE/DLL export corpora and optional candidates.
Native Tools
file_identifywrapsfile(1)for human file type and MIME type.strings_extractwrapsstrings(1)with structured limits and offsets.objdump_viewexposes mode-driven headers, disassembly, section dumps, and archive-member views.objdump_search_disasmsearches objdump disassembly and returns contextual matches.binary_diffwrapsradiff2for code, graph, and byte-oriented binary diffs.binwalk_scanuses the Rustbinwalkcrate for embedded signature scans.
radare2 Tools
- Session lifecycle:
r2_open,r2_close,r2_sessions, andr2_cmd. - Metadata and inventory:
r2_metadata,r2_find,r2_classes,r2_imports_grouped, andr2_lookup_address. - Code views:
r2_disassemble,r2_decompile, andr2_function_view. - References and flow:
r2_xrefs,r2_trace_data_flow,r2_value_trace, andr2_var_xrefs. - Focused binary projections:
r2_path_digest,r2_artifact_summary,r2_field_xrefs,r2_jump_table_slices, andr2_esil_accesses. - Byte and expression helpers:
r2_get_bytesandr2_calculate.
Prefer r2_function_view mode analyze for first-pass function triage, then use mode cfg, refs, vars, profile, or strings when narrowing the question.
Ghidra Tools
- Availability and cache:
ghidra_check,ghidra_import,ghidra_project_binaries,ghidra_binary_metadata, andghidra_delete_binary. - Inventory and search:
ghidra_inventory,ghidra_xrefs,ghidra_search_bytes,ghidra_read_bytes, and symbol/string/data modes through inventory. - Code views:
ghidra_decompile,ghidra_decompile_meta,ghidra_disassemble,ghidra_pcode,ghidra_cfg,ghidra_callgraph, andghidra_decompiler_cfg. - Decompiler projections:
ghidra_decompiler_calls,ghidra_decompiler_block_behavior,ghidra_decompiler_memory,ghidra_decompiler_slice, andghidra_decompiler_divergence. - Function evidence:
ghidra_callsite_slices,ghidra_callsite_facts,ghidra_function_checkpoints,ghidra_function_dossier,ghidra_path_digest,ghidra_variables, andghidra_thunk_target. - Specialized reverse-engineering views:
ghidra_dynamic_dispatch_table,ghidra_context_api_slots,ghidra_jump_table_field_summary,ghidra_field_flow,ghidra_field_lineage,ghidra_indirect_jump_slices, andghidra_local_buffer_slices. - Persistent project edits:
ghidra_rename_function,ghidra_set_function_prototype,ghidra_set_bookmark,ghidra_set_comment,ghidra_create_label, andghidra_create_function.
Import is cache-backed by SHA-256. Most read tools use the warm path with analyzeHeadless -process <name> -noanalysis, so the expensive import and analysis work happens once per binary.
For large targets, use ghidra_decompiler_calls first, then narrow with ghidra_decompiler_block_behavior, ghidra_decompiler_memory, ghidra_decompiler_slice, or ghidra_callsite_facts.
Analysis Tools
binary_security_propertiesreports Rust-native loader and hardening properties for PE, ELF, and Mach-O: NX/DEP, PIE/ASLR, RELRO/bind-now, executable stack, RPATH/RUNPATH, PE CFG/SafeSEH/Authenticode indicators, and Mach-O code signature/hardened-runtime hints.static_callgraphbuilds a bounded Rust-native x86/x64 graph from PE, ELF, and Mach-O executable sections usingiced-x86, with function seeds from entry points, exports, symbols, PE unwind ranges, section starts, and direct call targets. It resolves static import thunks and stubs where evidence is available, then reports direct calls, tailcalls, import/API fanout, top connected functions, and per-edge confidence.binary_capabilitiesclusters imports, symbols, and static-callgraph external calls into capability families such as network, file I/O, process/thread, registry, crypto, compression, anti-debug, dynamic loading, and memory allocation/protection.fuzzable_functionsranks functions by parser/decoder/input-handling names, proximity to file/network/compression APIs, callgraph position, and thunk/runtime penalties. Results are fuzzing-interest suggestions with evidence, not vulnerability claims.binary_component_profileseparates high-confidence components, imported shared libraries, and low-confidence runtime/package hints. The first pass supports Go build info, Rust cargo-auditable.dep-v0sections when decodable, imported library inventory, and .NET runtime hints.entropy_profilescores section entropy and packer likelihood.compiler_packer_detectidentifies compiler, runtime, packer, and protector hints.crypto_detectscans bytes for common crypto constants.dll_export_profileanalyzes DLL exports, dispatch shape, lifecycle hints, and plugin/host indicators.
AI-Agent Usability And Reference Helpers
These helpers reduce context cost while using rbinmcp:
- Tool discovery:
list_tools,lookup_tool,lookup_r2_cmd, andget_workflow - Runtime help:
get_backend_status,get_architecture,get_ghidra_info, andlookup_error
Install
rbinmcp is published in the MCP registry as:
io.github.kirkderp/rbinmcp
The registry package points to the public OCI image:
ghcr.io/kirkderp/rbinmcp:1.0.0
Run the image directly:
docker run --rm -i ghcr.io/kirkderp/rbinmcp:1.0.0
For binary analysis, mount the directory that contains the samples you want the MCP server to read:
docker run --rm -i \
-v /absolute/path/to/samples:/samples:ro \
ghcr.io/kirkderp/rbinmcp:1.0.0
Then use paths inside the container, such as /samples/app.exe, when calling tools.
To keep overflow output, r2 sessions, temporary files, and Ghidra cache data across container runs, add a cache volume:
docker run --rm -i \
-v rbinmcp-cache:/cache/rbinmcp \
-v /absolute/path/to/samples:/samples:ro \
ghcr.io/kirkderp/rbinmcp:1.0.0
Generic MCP client command:
{
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v",
"/absolute/path/to/samples:/samples:ro",
"-v",
"rbinmcp-cache:/cache/rbinmcp",
"ghcr.io/kirkderp/rbinmcp:1.0.0"
]
}
The image includes the rbm-server binary, bundled Ghidra postScripts, Ghidra, radare2, radiff2, file, strings, objdump, Rust-native analysis, and the cache defaults needed by the MCP tools.
Configuration
Environment variables:
RBINMCP_CACHE_DIR- override the cache rootGHIDRA_INSTALL_DIR- Ghidra install rootRBINMCP_GHIDRA_SCRIPTS_DIR- override bundled script directoryRBINMCP_GHIDRA_TIMEOUT- standard Ghidra call timeout in seconds, default60RBINMCP_GHIDRA_IMPORT_TIMEOUT- Ghidra import timeout in seconds, default900RBINMCP_R2_OPEN_TIMEOUT- radare2 open timeout in seconds, default120RBINMCP_NATIVE_TIMEOUT- native tool timeout in seconds, default60
Default cache root is the platform user cache directory plus rbinmcp, unless RBINMCP_CACHE_DIR is set.
Cache contents:
overflow/for large MCP responses written by the output guardghidra/for per-SHA-256 Ghidra projectsr2_sessions/for r2 session statetmp/for temporary tool files
Recommended Workflows
Quick triage:
get_backend_statusfile_identifytriage_binarystatic_viewwithmode=infobinary_security_propertiesstatic_callgraphbinary_capabilitiesfuzzable_functionsbinary_component_profilestrings_extract
Quick binary posture:
file_identifystatic_viewwithmode=infobinary_security_propertiesentropy_profilecompiler_packer_detectbinary_component_profile
Callgraph-first triage:
static_viewwithmode=infostatic_callgraphwith default pagingbinary_capabilitiesto rank API families and source functions- Pick a high-signal function from
top_connected_functions,external_api_fanout, or capability evidence r2_function_viewwithmode=analyzeghidra_decompiler_callsonly after narrowing the function
Capability triage:
static_viewwithmode=importsbinary_capabilities- Pivot from a ranked capability source function into
r2_function_view - Use
ghidra_decompiler_callsorghidra_callsite_factsonly for the narrowed function
Fuzz target discovery:
static_callgraphwith bounded pagingbinary_capabilitiesto identify input-facing API familiesfuzzable_functionsto rank parser, decoder, unpacking, and input-handling candidatesr2_function_viewon a candidate address before drafting a harnessghidra_callsite_factsfor exact argument setup at selected input API callsites
Component inventory:
static_viewwithmode=infobinary_component_profile- Review
identified_components,imported_libraries, andlow_confidence_hintsseparately - Use
strings_extractonly when a low-confidence runtime hint needs manual confirmation
r2 function analysis:
r2_openr2_metadatawithmode=functionsr2_function_viewwithmode=analyzer2_function_viewwithmode=cfgormode=refsr2_disassembleorr2_decompileonly after narrowing the target
Ghidra decompiler workflow:
ghidra_checkghidra_importghidra_project_binariesghidra_inventorywithmode=functionsghidra_decompiler_callsghidra_callsite_factsfor exact listing-grounded call setupghidra_cfgwhen decompiler CFG is invalid, timed out, or too transformed
Packed or staged binary workflow:
entropy_profilebinwalk_scancompiler_packer_detectr2_path_digestorghidra_path_digestghidra_dynamic_dispatch_tablewhen a hash/API dispatcher is suspected
Binary comparison workflow:
file_identifyfor both filesbinary_diffwithmode=codebinary_diffwithmode=graphbinary_diffwithmode=bytes
Security And License
- Security reporting: see SECURITY.md
- License: MIT