re-mcp
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@re-mcp decompile the function at address 0x401000"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
RE-MCP
A multi-backend reverse-engineering MCP server. Exposes binary analysis capabilities from IDA Pro and Ghidra over the Model Context Protocol, letting LLMs drive reverse-engineering tools directly. Supports multiple simultaneous databases through a supervisor/worker architecture.
Both backends are standalone servers, not plugins. They use headless APIs (idalib for IDA, pyghidra for Ghidra) to run analysis engines without a GUI.
Backends
Backend | Package | Requirements |
IDA Pro | IDA Pro 9+ with a valid license | |
Ghidra | Ghidra 12+, JDK 21+ |
Both backends share a common tool interface — core analysis tools use the same names, parameters, and response shapes — so LLM workflows are portable across backends. Each backend also has tools for platform-specific features (e.g. IDA: file region mapping, executable rebuilding, IDC evaluation, IDAPython scripting; Ghidra: Function ID analysis, data type archives).
Related MCP server: GhidraMCP
Requirements
Python 3.12+
uv package manager (recommended) or pip
macOS, Windows, or Linux
At least one supported backend installed on the same machine
Installation
Install individual backend packages directly, or install re-mcp and select a backend with --backend:
# Individual backend packages (each provides its own CLI)
uv tool install re-mcp-ida
uv tool install re-mcp-ghidra
# Or install the core package and use --backend to select
uv tool install re-mcp --with re-mcp-ida --with re-mcp-ghidraWith pip:
pip install re-mcp-ida # IDA only
pip install re-mcp-ghidra # Ghidra only
pip install re-mcp re-mcp-ida re-mcp-ghidra # Unified CLI with both backendsFrom source
git clone https://github.com/jtsylve/ida-mcp && cd ida-mcp
uv syncOr with pip:
git clone https://github.com/jtsylve/ida-mcp && cd ida-mcp
pip install -e packages/re-mcp-core -e packages/re-mcp-ida -e packages/re-mcp-ghidraFinding IDA Pro
The IDA backend looks for your IDA Pro installation in the following order:
IDADIRenvironment variable — checked first; set this if IDA is in a non-standard location.IDA's own config file —
Paths.ida-install-dirin~/.idapro/ida-config.json(macOS/Linux) or%APPDATA%\Hex-Rays\IDA Pro\ida-config.json(Windows). If theIDAUSRenvironment variable is set, it is used as the config directory instead.Platform-specific default paths:
Platform | Default search paths |
macOS |
|
Windows |
|
Linux |
|
The idapro package is loaded at runtime directly from your local IDA Pro installation — no extra setup steps or environment variables are needed if IDA is installed in a standard location.
Finding Ghidra
The Ghidra backend looks for your Ghidra installation in the following order:
GHIDRA_INSTALL_DIRenvironment variable — checked first; set this if Ghidra is in a non-standard location.Config file —
ghidra-install-dirin~/.ghidra/ghidra-config.json.Platform-specific default paths:
Platform | Default search paths |
macOS |
|
Windows |
|
Linux |
|
Usage
Running the server
Each backend has its own CLI, or use the unified re-mcp command with --backend:
# Individual backend CLIs
uvx re-mcp-ida
uvx re-mcp-ghidra
# Unified CLI (requires backend package installed alongside)
uvx --with re-mcp-ida re-mcp --backend ida
uvx --with re-mcp-ghidra re-mcp --backend ghidraBoth CLIs support the same subcommands:
Command | Description |
| Direct stdio mode — single-session, workers die on disconnect (default) |
| Stdio proxy that auto-spawns a persistent HTTP daemon |
| Start the HTTP daemon directly (for manual daemon management) |
| Gracefully shut down a running daemon |
| List installed backends (most useful with the unified |
The default mode runs a direct stdio server — the simplest transport, widely supported across MCP clients. Workers die when the client disconnects.
For persistent state across reconnections, use <backend> proxy. This mode auto-spawns a persistent HTTP daemon behind the scenes, handling port allocation and authentication transparently. Workers and database state survive client reconnections. The daemon shuts down automatically after 5 minutes of inactivity (configurable via <PREFIX>IDLE_TIMEOUT).
Running without installing
# Individual backend packages
IDADIR=/path/to/ida uvx re-mcp-ida
GHIDRA_INSTALL_DIR=/path/to/ghidra uvx re-mcp-ghidra
# Unified package
IDADIR=/path/to/ida uvx --with re-mcp-ida re-mcp --backend ida
GHIDRA_INSTALL_DIR=/path/to/ghidra uvx --with re-mcp-ghidra re-mcp --backend ghidra# Individual backend packages
$env:IDADIR = "C:\Program Files\IDA Professional 9.3"
uvx re-mcp-ida
$env:GHIDRA_INSTALL_DIR = "C:\ghidra_12.0.3_PUBLIC"
uvx re-mcp-ghidra
# Unified package
$env:IDADIR = "C:\Program Files\IDA Professional 9.3"
uvx --with re-mcp-ida re-mcp --backend idaMCP client configuration
Add to your MCP client config (e.g. Claude Desktop claude_desktop_config.json):
IDA backend:
{
"mcpServers": {
"ida": {
"command": "uvx",
"args": ["re-mcp-ida"]
}
}
}Ghidra backend:
{
"mcpServers": {
"ghidra": {
"command": "uvx",
"args": ["re-mcp-ghidra"]
}
}
}Both backends simultaneously:
{
"mcpServers": {
"ida": {
"command": "uvx",
"args": ["re-mcp-ida"]
},
"ghidra": {
"command": "uvx",
"args": ["re-mcp-ghidra"]
}
}
}Using the unified re-mcp CLI (when installed via uv tool install re-mcp --with re-mcp-ida):
{
"mcpServers": {
"ida": {
"command": "re-mcp",
"args": ["--backend", "ida"]
}
}
}If the backend command is installed on your PATH (e.g. via pip install), use it directly:
{
"mcpServers": {
"ida": {
"command": "re-mcp-ida"
}
}
}If the command isn't on your PATH, use the full path to the executable:
{
"mcpServers": {
"ida": {
"command": "/home/user/.pyenv/versions/<version>/bin/re-mcp-ida"
}
}
}If the backend (IDA or Ghidra) isn't in a default location, add the install directory via the env key:
{
"mcpServers": {
"ida": {
"command": "uvx",
"args": ["re-mcp-ida"],
"env": {
"IDADIR": "/path/to/ida"
}
},
"ghidra": {
"command": "uvx",
"args": ["re-mcp-ghidra"],
"env": {
"GHIDRA_INSTALL_DIR": "/path/to/ghidra"
}
}
}
}Connecting to a running daemon directly:
If you started the daemon manually with <backend> serve, the connection details (host, port, bearer token) are in the state file. Clients that support streamable HTTP can connect directly.
State file locations:
macOS:
~/Library/Application Support/<backend>/daemon.jsonLinux:
$XDG_STATE_HOME/<backend>/daemon.json(defaults to~/.local/state/<backend>/daemon.json)Windows:
%LOCALAPPDATA%\<backend>\daemon.json
Where <backend> is re-mcp-ida or re-mcp-ghidra.
{
"mcpServers": {
"ida": {
"type": "streamable-http",
"url": "http://127.0.0.1:<port>/mcp",
"headers": {
"Authorization": "Bearer <token>"
}
}
}
}Basic workflow
Open a binary — call
open_databasewith the path to a binary (or existing database file), thenwait_for_analysisto block until it is readyAnalyze — use the available tools (list functions, decompile, search strings, read bytes, etc.)
Close — call
close_databasewhen done (auto-saves by default)
Raw binaries must be in a writable directory since both backends create database files alongside them. When opening an existing database, the original binary does not need to be present.
Multi-database mode
Multiple databases can be open at the same time. By default, open_database keeps previously opened databases open. Pass keep_open=False to save and close databases owned by the current session before opening the new one. All tools except management tools (open_database, close_database, save_database, list_databases, wait_for_analysis, list_targets) require the database parameter (the stem ID returned by open_database or list_databases).
open_database("first.bin") # spawns worker (returns immediately)
wait_for_analysis(database="first") # blocks until ready
open_database("second.bin") # spawns second worker
wait_for_analysis(database="second") # blocks until ready
decompile_function(address="main", database="first") # targets first
close_database(database="second") # closes secondEnvironment variables
Each backend uses its own environment variable prefix (IDA_MCP_ or GHIDRA_MCP_). The table below uses <PREFIX> as a placeholder.
Backend installation:
Variable | Backend | Default | Description |
| IDA | (auto-detected) | Path to IDA Pro installation directory |
| Ghidra | (auto-detected) | Path to Ghidra installation directory |
Shared settings (replace <PREFIX> with IDA_MCP_ or GHIDRA_MCP_):
Variable | Default | Description |
| (unlimited) | Maximum simultaneous databases (clamped to 1-8 when set) |
|
| Logging level ( |
| (unset) | Directory for per-run log files. Each component logs to |
|
| Idle auto-shutdown timeout in seconds for auto-spawned daemons. Set to |
| (unset) | Set to |
| (unset) | Set to |
| (unset) | Set to |
IDA-only settings:
Variable | Default | Description |
| (unset) | Set to |
Tools
To keep token usage manageable, only common analysis tools and management tools are directly visible to clients. The rest are discoverable and callable through meta-tools:
search_tools— regex search over non-pinned tool names, descriptions, and tags (pinned tools are already visible).get_schema— parameter schemas and return shapes for tools by name.call— lightweight proxy for calling any tool by name, including hidden tools not in the client tool list.execute— sandboxed Python that chains multipleawait invoke(name, params)calls in a single round trip. Supportsasyncio.gatherfor parallel queries, loops, and conditional logic between calls.batch— sequential multi-tool execution with per-item error collection and progress reporting (up to 50 operations per call).
Management tools (open_database, close_database, save_database, list_databases, wait_for_analysis, list_targets) are always visible. Most must be called directly — save_database and list_databases are the exceptions, also callable through call, execute, and batch for use in multi-step workflows.
The full tool catalog spans these areas:
Database — open/close/save/list databases, file region mapping, metadata
Functions — list, query, decompile, disassemble, rename, prototypes, chunks, stack frames
Decompiler — pseudocode variable renaming/retyping, decompiler comments, microcode
Ctree — AST exploration and pattern matching
Cross-References — xref queries, call graphs, xref creation/deletion
Imports & Exports — imported functions, exported symbols, entry point listing and manipulation
Search — string extraction, byte patterns, text in disassembly, immediate values, string-to-code references, string list rebuilding
Types & Structures — local types, structs, enums, type parsing and application, source declarations
Instructions & Operands — decode instructions, resolve operand values, change operand display format
Control Flow — basic blocks, CFG edges, switch/jump tables
Data — raw byte reading, hex dumps, segment listing, pointer tables
Patching — byte patching, instruction assembly, function/code creation, data loading
Data Definition — define bytes, words, dwords, qwords, floats, doubles, strings, and arrays
Segments — create, modify, and rebase segments
Names & Comments — rename addresses, manage comments (get, set, and append)
Demangling — C++ symbol name demangling
Analysis — auto-analysis, fixups, exception handlers, segment registers
Address Metadata — source line numbers, analysis flags, library item marking
Register Tracking — register and stack pointer value tracking
Register Variables — register-to-name mappings within functions
Signatures — FLIRT signatures/type libraries (IDA), Function ID/data type archives (Ghidra)
Export — batch decompilation/disassembly, output file generation
Snapshots — take, list, and restore database snapshots
Processor — architecture info, register names, instruction classification
Bookmarks — marked-position management
Colors — address/function coloring
Undo — undo/redo operations
Directory Tree — folder organization
Utility — number conversion, expression evaluation, scripting
All tools include MCP annotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) so clients can distinguish safe reads from mutations and prompt for confirmation on destructive operations. Mutation tools return old values alongside new values for change tracking.
See docs/tools.md for the complete tools reference.
Resources
The server exposes MCP resources — read-only, cacheable endpoints for structured database context:
Static binary data — imports, exports, entry points (with regex search variants)
Aggregate snapshot — statistics (function/segment/entry point/string/name counts, code coverage)
Supervisor —
<scheme>://databaseslists all open databases with worker state
The URI scheme is ida:// for the IDA backend and ghidra:// for the Ghidra backend.
Prompts
The server provides MCP prompts — guided workflow templates that instruct the LLM to use tools in a structured sequence. Prompts are currently available for the IDA backend only.
survey_binary— binary triage producing an executive summaryanalyze_function— full single-function analysis with decompilation, data flow, and behavior summarydiff_before_after— preview the effect of renaming/retyping on decompiler outputclassify_functions— categorize functions by behavioral patternfind_crypto_constants— scan for known cryptographic constantsauto_rename_strings— suggest function renames based on string referencesapply_abi— apply known ABI type information to identified functionsexport_idc_script— generate a script that reproduces user annotations
Architecture
The project is a monorepo with three packages:
re-mcp-core— shared supervisor infrastructure, transport, and common utilitiesre-mcp-ida— IDA Pro backendre-mcp-ghidra— Ghidra backend
See docs/architecture.md for detailed architecture documentation.
Development
# With uv (recommended)
uv sync # Install dependencies
uv run ruff check packages/ # Lint
uv run ruff format packages/ # Format
uv run ruff check --fix packages/ # Lint with auto-fix
# With pip
pip install -e packages/re-mcp-core -e packages/re-mcp-ida -e packages/re-mcp-ghidra
pip install pre-commit pytest pytest-asyncio ruff jsonschema
ruff check packages/
ruff format packages/
ruff check --fix packages/Pre-commit hooks run REUSE compliance checks, ruff lint (with --fix --exit-non-zero-on-fix), ruff format, idalib threading lint, and pytest on every commit.
License
This project is dual-licensed under the MIT License and Apache License 2.0.
© 2026 Joe T. Sylve, Ph.D.
This project is REUSE compliant.
IDA Pro and Hex-Rays are trademarks of Hex-Rays SA. Ghidra is developed by the NSA. RE-MCP is an independent project and is not affiliated with or endorsed by Hex-Rays or the NSA.
Available Tools
11 toolsbatchA
Run 2+ independent tool calls in a single request with per-item error collection.
Preferred over execute for independent calls (no sandbox overhead).
Examples: decompile/disassemble N functions, rename N symbols, set N
comments, fetch N xrefs.
Use execute only when chaining one tool's output into another.
database is auto-injected into each operation — omit from params.
Override per-operation with explicit database for cross-DB work.
Inputs: database (required), operations (required), stop_on_error. Returns: Result of a batch execution.
callA
Call any tool by name, including hidden tools not in the client tool list.
Use for single hidden-tool calls. For multiple calls, prefer batch.
Inputs: tool (required), database, arguments. Returns: result
close_databaseClose DatabaseA
Close a database and terminate its worker process.
Specify database when multiple are open. Fails if the DB is not attached to the current session unless force=True. When other sessions still use the DB, detaches this session but keeps the worker alive.
Inputs: save, force, database. Returns: object
executeA
Run Python code that chains tool calls. Use await invoke(name, params) to call tools; use return to produce output.
database is auto-injected into every invoke — omit it from params. Override per-call with explicit database for cross-database work.
When NOT to use execute
Single tool call → use the call meta-tool (or the direct tool if pinned).
N independent calls → use
batch(lower overhead, per-item errors). → Otherwise, use the batch meta-tool for sequential multi-tool execution with per-item error collection and progress reporting.Check if a tool has a built-in batch parameter first (e.g. get_strings
filters=[...]).
When to use execute
Multi-step pipelines — chaining one tool's output into another:
decomp = await invoke("decompile_function", {"address": "0x1234"})
addrs = re.findall(r'sub_([0-9A-Fa-f]+)', decomp["pseudocode"])
xrefs = [await invoke("get_xrefs_to", {"address": f"0x{a}"}) for a in addrs]
return {"decomp": decomp, "xrefs": xrefs}Cross-database parallel queries — use asyncio.gather with explicit database params. Same-database calls are serialized by the worker.
Reference
Blocked tools: open_database, close_database, wait_for_analysis, list_targets, and meta-tools (search_tools, get_schema, execute, batch, call) must be called directly. save_database and list_databases are allowed.
Addresses are strings: "0x401000", "4010a0", or symbol names.
filter_pattern is Python regex — use
re.escape()for literals.Available imports: asyncio, collections, functools, itertools, json, math, operator, re, struct, typing. No FS/network I/O.
Paginated results have
items,total,offset,limit,has_more— always checkhas_more.Use
get_schema(tools=[...])to look up parameter names and types.Return only what you need — filter before returning to save context.
Inputs: code (required), database (required).
get_schemaA
Get parameter schemas for specific tools by name (pinned and hidden).
Use after search_tools or before execute/batch to check parameter
types and return shapes. Pass detail="full" for complete JSON schemas.
Hidden tools must be called via call, batch, or execute — direct calls will fail because they are not in the client tool list.
Inputs: tools (required), detail. Returns: result
list_databasesList DatabasesA
List all open databases with metadata (includes opening/analyzing status).
Inputs: no named parameters. Returns: object
list_targetsList TargetsA
List available targets (processors, loaders, languages, etc.).
Inputs: no named parameters. Returns: object
open_databaseOpen DatabaseA
Open a binary or existing IDA database (.i64/.idb) for analysis.
Returns immediately with "opening": true — call
wait_for_analysis before using other tools on this database.
Re-opening an already-open database returns the existing worker.
Multiple binaries: use a separate subagent per binary. Each agent calls open_database then wait_for_analysis. Do NOT serialize open+wait calls — that blocks parallel loading.
force_new=True is destructive: deletes existing .i64/.idb and all prior analysis. Use only for stale/incompatible DBs.
Fat Mach-O: requires explicit fat_arch (e.g. arm64).
Error lists available slices. Use distinct database_id per
slice for concurrent analysis. fat_arch must be omitted for
non-fat files and existing databases.
Inputs: file_path (required), loader, options, fat_arch, +6 more. Returns: object
save_databaseSave DatabaseA
Save the current database to disk (may take minutes for large DBs).
Specify database when multiple are open. Fails if the DB is not attached to the current session unless force=True. Progress notifications are sent every 5s during long saves.
Inputs: flags, force, outfile, database. Returns: object
search_toolsA
Search hidden tools by regex (pinned tools excluded; use .* for all).
Returns one-line signatures by default. Use detail="detailed"
for parameter schemas, or follow up with get_schema(tools=[...]).
Hidden tools must be called via call, batch, or execute — direct calls will fail because they are not in the client tool list.
Inputs: pattern (required), detail. Returns: result
wait_for_analysisWait for AnalysisA
Block until database(s) finish opening and optional auto-analysis.
Single: pass database to wait for one DB.
Multi: pass databases list — returns when at least one
is ready. Work on the ready one, call again for the rest.
While analysis runs, the backend thread is blocked — tool calls queue.
Inputs: database, databases. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Most tools have clearly distinct roles: database lifecycle, target listing, and tool discovery are well-separated. The main ambiguity is between call, batch, and execute, which all invoke tools, but the descriptions provide enough use-case distinction to guide selection.
The naming mostly follows a clear verb_noun snake_case pattern (open_database, save_database, list_databases, search_tools). The meta-tools deviate with bare verbs (execute, batch, call), and there is minor singular/plural inconsistency, but the pattern is still predictable overall.
11 tools is well within the ideal range for a purpose-built server. Each tool serves a necessary role: database lifecycle management, target discovery, hidden tool access, and execution orchestration. No tool feels redundant or superfluous.
The visible surface covers the full database lifecycle (open, wait, save, close, list) and provides meta-tools to discover and invoke hidden analysis tools. The only minor gap is that direct analysis operations are not visible in the pinned tool list, but this is clearly intentional and workable through search_tools/call/batch/execute.
Maintenance
Related MCP Connectors
Security scanner for MCP servers. Detect vulnerabilities, prompt injection, and tool poisoning.
MCP server unifying ERPs, CRMs, APIs and knowledge base for Claude, ChatGPT and Gemini.
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Related MCP Servers
- AlicenseBqualityCmaintenanceAn MCP server that allows LLMs to autonomously reverse engineer applications by exposing Ghidra functionality, enabling decompilation, analysis, and automatic renaming of methods and data.3011,955Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn MCP server that allows LLMs to autonomously reverse engineer applications by exposing Ghidra's functionality, including decompiling binaries, analyzing code, and renaming methods and data.Apache 2.0
- AlicenseNot gradedqualityDmaintenanceAn Model Context Protocol server that enables LLMs to autonomously reverse engineer applications by exposing Ghidra's decompilation and analysis tools. It allows AI agents to list code structures, rename methods, and analyze binaries directly through MCP-compatible clients.Apache 2.0
- FlicenseNot gradedqualityDmaintenanceA PyGhidra-based MCP server that exposes Ghidra's reverse engineering capabilities to AI agents, enabling binary analysis via tools like overview, search, view, list, edit, script execution, and version control.1-