MCPEmulate
MCPEmulate is an MCP server that provides CPU emulation, disassembly, and assembly capabilities for LLM agents, supporting x86 (32/64-bit), ARM (32/64-bit), MIPS32 (LE/BE), and RISC-V (32/64-bit).
Session Management: Create/destroy isolated emulation sessions per architecture; export/import full session state (memory, registers, breakpoints, symbols) as JSON.
Memory Operations: Map regions with configurable permissions; read/write memory (hex/base64); list mapped regions with a /proc/self/maps-style view; hex dump (up to 4KB); search for byte patterns; snapshot and diff memory between two points in time.
Register Control: Read/write registers individually or all at once; inspect the stack with symbol resolution; save/restore named register context snapshots.
Execution Control: Run emulation bounded by stop address, instruction count, or timeout; single-step with disassembly output; manage conditional breakpoints with expression support (e.g., eax == 42, rax > 0x1000 and rcx != 0).
Watchpoints: Add/remove/list watchpoints on memory addresses for read, write, or both access types.
Syscall Hooking: Hook syscalls in skip (log and continue) or stop mode; retrieve paginated logs with syscall number, arguments, and PC. Supported instructions: int 0x80 (x86_32), syscall (x86_64, MIPS), svc 0 (ARM/AArch64), ecall (RISC-V).
Execution Tracing: Enable/disable instruction tracing; retrieve paginated trace logs; save and diff two execution traces instruction-by-instruction.
Symbol Management: Add/remove/list symbolic names for addresses; symbols appear in stack views, traces, and memory maps.
Binary Loading: Load raw machine code at a specified address, or load full ELF/PE/Mach-O executables with automatic segment mapping, permissions, entry point setup, and symbol registration.
Standalone Assembly/Disassembly: Assemble instructions to machine code for x86, ARM, and MIPS (no RISC-V assembly); disassemble machine code for all supported architectures — no session required.
Provides CPU emulation, disassembly, and assembly tools for ARM (32-bit) and AArch64 architectures, allowing agents to execute code, manage breakpoints, and hook syscalls within isolated sessions.
Exposes CPU emulation and disassembly capabilities for RISC-V 32 and RISC-V 64 architectures, supporting memory mapping, register inspection, and instruction-by-instruction execution tracing.
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., "@MCPEmulate Emulate this x86-64 shellcode and show me the register state."
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.
MCPEmulate
This project was vibecoded.
An MCP server that exposes CPU emulation, disassembly, and assembly as tools for LLM agents. Built on Unicorn (emulation), Capstone (disassembly), Keystone (assembly), and LIEF (binary parsing).
Agents can create isolated emulation sessions, load code or full executables, set breakpoints, hook syscalls, step through instructions, inspect memory and registers, and diff execution traces -- all through the standard MCP tool interface.
Supported Architectures
Architecture | Emulation | Disassembly | Assembly | Syscall Hooking |
x86 (32-bit) | Yes | Yes | Yes |
|
x86-64 | Yes | Yes | Yes |
|
ARM (32-bit) | Yes | Yes | Yes |
|
AArch64 | Yes | Yes | Yes |
|
MIPS32 (LE) | Yes | Yes | Yes |
|
MIPS32 (BE) | Yes | Yes | Yes |
|
RISC-V 32 | Yes | Yes | No |
|
RISC-V 64 | Yes | Yes | No |
|
RISC-V architectures lack a Keystone backend, so the assemble tool returns an error for them. Disassembly and emulation work normally.
Related MCP server: ghidraMCP
Install
Requires Python 3.10+.
# Run directly (no install needed)
uvx mcp-emulate
# Or install globally
uv pip install mcp-emulateUsage
Claude Desktop / MCP Client
Add to your MCP client configuration:
{
"mcpServers": {
"mcp-emulate": {
"command": "uvx",
"args": ["mcp-emulate"]
}
}
}CLI
# Default: stdio transport (for MCP clients)
mcp-emulate
# SSE transport (network, for web-based clients)
mcp-emulate --transport sse
# Streamable HTTP transport (newer MCP protocol)
mcp-emulate --transport streamable-httpTools (41)
Session Management
Tool | Description |
| Create a new emulation session for a given architecture |
| Destroy a session and free resources |
| Export full session state (memory, registers, breakpoints, symbols) to JSON |
| Create a new session and restore state from a previous export |
Memory
Tool | Description |
| Map a memory region with specified permissions (r/w/x) |
| Write hex or base64 data to memory |
| Read memory as hex or base64 |
| List all mapped regions |
| Formatted hex dump (up to 4KB) with ASCII sidebar |
| Search for byte patterns across mapped memory |
| Capture all memory content under a named label |
| Compare two snapshots and return changed byte ranges |
|
|
Registers
Tool | Description |
| Write one or more registers |
| Read registers (specific or all) |
| Read stack entries from SP, resolving values against symbols |
Execution
Tool | Description |
| Run emulation with stop address, instruction count, or timeout |
| Execute a single instruction with full disassembly |
| Set a breakpoint, optionally with a register condition |
| Remove a breakpoint |
| List all breakpoints with their conditions |
| Save a register snapshot under a label |
| Restore registers from a saved snapshot |
Breakpoint Conditions
Conditional breakpoints accept expressions like:
eax == 42
rax > 0x1000 and rcx != 0
r0 == 0 or r1 & 0xffSupported operators: ==, !=, >, <, >=, <=, &. Connectives: and, or.
Syscall Hooking
Tool | Description |
| Install a syscall hook ( |
| Remove the syscall hook |
| Retrieve logged syscall invocations with pagination |
Each logged entry includes the syscall number, argument register values, and PC. The hook is architecture-aware -- it intercepts int 0x80 on x86_32, syscall on x86_64, svc 0 on ARM/AArch64, syscall on MIPS, and ecall on RISC-V.
Watchpoints
Tool | Description |
| Watch a memory address for read, write, or both |
| Remove a watchpoint |
| List all active watchpoints |
Tracing
Tool | Description |
| Start recording executed instructions |
| Stop recording (log is preserved) |
| Retrieve trace entries with disassembly and pagination |
| Save the current trace log under a named label |
| Compare two saved traces instruction-by-instruction |
Trace diff reports the common prefix length, the divergence point, and up to 50 differing entries with full disassembly.
Symbols
Tool | Description |
| Associate a name with an address |
| Remove a symbol |
| List all symbols |
Symbols are used to annotate stack entries, trace output, memory maps, and step results.
Loading
Tool | Description |
| Load raw machine code at an address, auto-mapping memory |
| Load an ELF, PE, or Mach-O binary with correct segment permissions, entry point, and symbols |
| Assemble instructions to machine code (standalone, no session) |
| Disassemble machine code to instructions (standalone, no session) |
load_executable uses LIEF for format detection. It maps each loadable segment with the correct permissions, sets PC to the entry point, and registers exported symbols automatically.
Example Workflow
A typical agent interaction:
create_emulator(arch="x86_64")-- start a sessionassemble(arch="x86_64", code="mov rax, 60; syscall")-- assemble exit syscallload_binary(session_id=..., data=..., address=0x1000, entry_point=0x1000)-- load codehook_syscall(session_id=..., mode="stop")-- intercept syscallsenable_trace(session_id=...)-- start recordingemulate(session_id=..., address=0x1000, count=100)-- runget_trace(session_id=...)-- inspect what executedget_syscall_log(session_id=...)-- see what syscalls were attemptedexport_session(session_id=...)-- save state for later
Architecture
src/mcp_emulate/
architectures.py Architecture configs, register maps, syscall conventions
session.py EmulationSession (Unicorn wrapper), SessionManager
server.py 41 MCP tool handlers via FastMCP
tests/
test_emulate.py 132 pytest unit tests
test_server_integration.py 112 checks over JSON-RPC (23 phases)Key Design Decisions
EmulationSessionuses__slots__for memory efficiency and to catch typos. Every new attribute must be declared.Breakpoints are
dict[int, str | None](address to optional condition), not a set. This supports conditional breakpoints while keeping the same lookup semantics.Syscall conventions are data, not code. A frozen dataclass per architecture describes the hook type, interrupt number filter, register names for nr/args/return. The hooking logic is generic.
ks_arch/ks_modeareOptionalonArchConfigso architectures without Keystone (RISC-V) can exist without a dummy value. Theassembletool checks this and returns a clear error.load_executablewrites viauc.mem_write()directly, bypassing the permission check onwrite_memory. This is intentional -- binary loaders need to populate read-only segments.Session serialization is versioned (
"version": 1) for forward compatibility.
Development
git clone https://github.com/LabGuy94/MCPEmulate.git
cd MCPEmulate
uv venv .venv
uv pip install -e ".[dev]"Tests
# Unit tests (132 tests, ~1s)
uv run pytest tests/test_emulate.py -v
# Integration tests (112 checks over JSON-RPC subprocess, ~30s)
uv run python tests/test_server_integration.py
# Both
uv run pytest tests/ -v && uv run python tests/test_server_integration.pyDependencies
Package | Purpose |
mcp >= 1.18.0 | MCP protocol / FastMCP server framework |
unicorn >= 2.0.0 | CPU emulation engine |
capstone >= 5.0.0 | Disassembly engine |
keystone-engine >= 0.9.2 | Assembly engine |
lief >= 0.14.0 | ELF/PE/Mach-O binary parsing |
License
GPL-2.0-only
Available Tools
41 toolsadd_breakpointA
Add a breakpoint at the given address.
Idempotent — adding the same address twice is a no-op.
Args: session_id: The session ID. address: The address to break at. condition: Optional condition expression (e.g. "eax == 42", "rax > 0x1000 and rcx != 0").
Inputs: session_id (required), address (required), condition.
add_symbolA
Associate a symbolic name with a memory address.
Overwrites if the name already exists.
Args: session_id: The session ID. name: Symbol name. address: Memory address.
Inputs: session_id (required), name (required), address (required).
add_watchpointA
Add a memory watchpoint.
Idempotent -- same address replaces the existing watchpoint.
Args: session_id: The session ID. address: Memory address to watch. size: Number of bytes to watch (default 1). access: Access type -- "r" (read), "w" (write), or "rw" (both). Default "w".
Inputs: session_id (required), address (required), size, access.
assembleB
Assemble instructions into machine code using Keystone.
Args: arch: Architecture name (x86_32, x86_64, arm, arm64). code: Assembly source code (e.g. "mov eax, 42; ret"). address: Base address for assembly (affects relative offsets). Default 0.
Inputs: arch (required), code (required), address.
create_emulatorA
Create a new CPU emulation session.
Args: arch: Architecture name. One of: x86_32, x86_64, arm, arm64.
Returns a dict with session_id and arch.
Inputs: arch (required).
destroy_emulatorB
Destroy an emulation session and free its resources.
Args: session_id: The session ID returned by create_emulator.
Inputs: session_id (required).
diff_memoryB
Compare two memory snapshots and return changed byte ranges.
Args: session_id: The session ID. label_a: First snapshot label. label_b: Second snapshot label.
Inputs: session_id (required), label_a (required), label_b (required).
diff_traceB
Compare two saved traces instruction-by-instruction.
Returns the common prefix length, divergence point, and up to 50 differing entries.
Args: session_id: The session ID. label_a: First trace label. label_b: Second trace label.
Inputs: session_id (required), label_a (required), label_b (required).
disable_traceB
Disable execution tracing.
The trace log is preserved for inspection via get_trace.
Args: session_id: The session ID.
Inputs: session_id (required).
disassembleA
Disassemble machine code into instructions using Capstone.
Args: arch: Architecture name (x86_32, x86_64, arm, arm64). data: Machine code as hex string or base64. address: Base address for disassembly. Default 0. encoding: "hex" (default) or "base64". count: Max instructions to disassemble. 0 = all.
Inputs: arch (required), data (required), address, encoding, +1 more.
emulateA
Run CPU emulation.
Must provide stop_address, count, or both to bound execution.
Args: session_id: The session ID. address: Address to begin execution. stop_address: Address to stop at (exclusive). count: Maximum instructions to execute (capped at 100,000). timeout_ms: Timeout in milliseconds (capped at 60,000).
Inputs: session_id (required), address (required), stop_address, count, +1 more.
enable_traceB
Enable execution tracing.
Clears any existing trace log and starts recording.
Args: session_id: The session ID. max_entries: Maximum trace entries to record (default 10000).
Inputs: session_id (required), max_entries.
export_sessionB
Export full session state (memory, registers, breakpoints, symbols) to JSON.
Args: session_id: The session ID.
Inputs: session_id (required).
get_registersB
Read one or more registers.
Args: session_id: The session ID. names: List of register names. Omit or pass null for all registers.
Inputs: session_id (required), names.
get_stackB
Read stack entries from the current stack pointer.
Resolves values against registered symbols.
Args: session_id: The session ID. count: Number of stack entries to read (default 16, max 256).
Inputs: session_id (required), count.
get_syscall_logB
Get recorded syscall invocations with pagination.
Args: session_id: The session ID. offset: Start index (default 0). limit: Max entries to return (default 100).
Inputs: session_id (required), offset, limit.
get_traceC
Get trace entries with pagination.
Each entry includes disassembled instruction details.
Args: session_id: The session ID. offset: Start index (default 0). limit: Max entries to return (default 100).
Inputs: session_id (required), offset, limit.
hexdumpA
Formatted hex dump of memory.
Standard format: ADDR | 16 hex bytes (8+8) | ASCII. Max 4096 bytes.
Args: session_id: The session ID. address: Start address. size: Number of bytes to dump (default 256, max 4096).
Inputs: session_id (required), address (required), size.
hook_syscallA
Install a syscall hook to intercept system calls.
Modes: skip: Log the syscall and return default_return (continue execution). stop: Log the syscall and stop emulation.
Idempotent — replaces existing hook.
Args: session_id: The session ID. mode: Hook mode — "skip" (default) or "stop". default_return: Return value for skip mode (default 0).
Inputs: session_id (required), mode, default_return.
import_sessionA
Import session state into a new session.
Creates a new session for the given architecture and restores state from export.
Args: arch: Architecture name (must match the exported state's arch). state: The state dict from export_session.
Inputs: arch (required), state (required).
list_breakpointsC
List all breakpoints in the session.
Args: session_id: The session ID.
Inputs: session_id (required).
list_regionsC
List all mapped memory regions.
Args: session_id: The session ID.
Inputs: session_id (required).
list_symbolsC
List all symbols.
Args: session_id: The session ID.
Inputs: session_id (required).
list_watchpointsC
List all memory watchpoints.
Args: session_id: The session ID.
Inputs: session_id (required).
load_binaryA
Load binary data into the emulator.
Auto-maps memory, writes data, and optionally sets the program counter.
Args: session_id: The session ID. data: Binary data as hex string or base64. address: Destination address. entry_point: Optional address to set the PC to. encoding: "hex" (default) or "base64".
Inputs: session_id (required), data (required), address (required), entry_point, +1 more.
load_executableA
Load an executable binary (ELF, PE, or Mach-O) into the emulator.
Auto-detects format. Maps segments with correct permissions, sets PC to entry point, registers symbols.
Args: session_id: The session ID. data: Binary data as hex string or base64. base_address: Optional base address offset. Default 0. encoding: "hex" (default) or "base64".
Inputs: session_id (required), data (required), base_address, encoding.
map_memoryB
Map a memory region in the emulator.
Size is rounded up to 4KB page alignment.
Args: session_id: The session ID. address: Start address (must be page-aligned, i.e. multiple of 0x1000). size: Region size in bytes. perms: Permission string combining 'r', 'w', 'x'. Default "rwx".
Inputs: session_id (required), address (required), size (required), perms.
memory_mapC
Produce a /proc/self/maps-style layout of the address space.
Shows regions with permissions, gaps, and symbol annotations.
Args: session_id: The session ID.
Inputs: session_id (required).
read_memoryC
Read data from emulator memory.
Args: session_id: The session ID. address: Source address. size: Number of bytes to read. encoding: "hex" (default) or "base64".
Inputs: session_id (required), address (required), size (required), encoding.
remove_breakpointC
Remove a breakpoint.
Args: session_id: The session ID. address: The breakpoint address to remove.
Inputs: session_id (required), address (required).
remove_symbolC
Remove a symbol.
Args: session_id: The session ID. name: The symbol name to remove.
Inputs: session_id (required), name (required).
remove_watchpointB
Remove a memory watchpoint.
Args: session_id: The session ID. address: The watchpoint address to remove.
Inputs: session_id (required), address (required).
restore_contextC
Restore registers from a previously saved snapshot.
Args: session_id: The session ID. label: The snapshot label to restore.
Inputs: session_id (required), label (required).
save_contextB
Save a register snapshot under a label.
Overwrites if the label already exists.
Args: session_id: The session ID. label: A name for this snapshot.
Inputs: session_id (required), label (required).
save_traceB
Save the current trace log under a label.
Overwrites if the label already exists.
Args: session_id: The session ID. label: A name for this saved trace.
Inputs: session_id (required), label (required).
search_memoryB
Search for a byte pattern in memory.
If address is None, searches all mapped regions.
Args: session_id: The session ID. pattern: Hex string of bytes to search for (e.g. "deadbeef"). address: Optional start address to limit search. size: Optional size of search range (required if address is set). max_results: Maximum matches to return (default 100).
Inputs: session_id (required), pattern (required), address, size, +1 more.
set_registersC
Write one or more registers.
Args: session_id: The session ID. values: Dict mapping register names to integer values.
Inputs: session_id (required), values (required).
snapshot_memoryB
Save a snapshot of all mapped memory under a label.
Overwrites if the label already exists.
Args: session_id: The session ID. label: A name for this memory snapshot.
Inputs: session_id (required), label (required).
stepC
Execute a single instruction.
If address is omitted, execution starts at the current program counter.
Args: session_id: The session ID. address: Optional start address. Defaults to current PC.
Inputs: session_id (required), address.
unhook_syscallC
Remove the syscall hook.
Args: session_id: The session ID.
Inputs: session_id (required).
write_memoryC
Write data to emulator memory.
Args: session_id: The session ID. address: Destination address. data: Data as hex string (e.g. "90c3") or base64. encoding: "hex" (default) or "base64".
Inputs: session_id (required), address (required), data (required), encoding.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 41 tools
Most tools have distinct purposes, but some overlap exists: 'hexdump' and 'read_memory' both retrieve memory data, and 'list_breakpoints'/'list_watchpoints'/'list_symbols' are similar listing operations. Descriptions help clarify differences, but an agent might occasionally misselect between closely related tools.
Tool names follow a highly consistent verb_noun pattern throughout (e.g., 'add_breakpoint', 'create_emulator', 'get_registers'). All names use snake_case with clear, descriptive verbs, making the set predictable and easy to navigate.
With 41 tools, the count is excessive for a CPU emulation server. While the domain is complex, many tools could be consolidated (e.g., multiple listing tools) or omitted without losing core functionality, leading to potential confusion and inefficiency for agents.
The toolset provides comprehensive coverage for CPU emulation, including session management, memory operations, debugging (breakpoints/watchpoints), tracing, syscall handling, and state import/export. All essential CRUD and lifecycle operations are present, with no obvious gaps in the domain.
Maintenance
Related MCP Connectors
MCP server for building and testing AI agents with multi-model experimentation and insights.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
The Remote MCP server acts as a standardized bridge between LLM applications (like Claude, ChatGPT, and Cursor) and external services, enabling AI agents to access external tools and resources. Its primary capability is providing a centralized search tool to discover other MCP servers and their respective tools. Unlike local implementations, it runs remotely with OAuth authentication and permission controls for security.
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
Related MCP Servers
- 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
- AlicenseAqualityCmaintenanceA multi-backend MCP server that exposes binary analysis capabilities from IDA Pro and Ghidra, allowing LLMs to directly drive reverse-engineering tools via natural language.11181Apache 2.0
- AlicenseBqualityDmaintenanceA lightweight MCP server that enables LLM agents to interact with GDB for debugging native programs, supporting spawning sessions, executing commands, interrupting hangs, and closing sessions.410 npmMIT