x64dbg MCP Server with Domain-Driven Design (DDD) architecture for LLM-assisted debugging and reverse engineering.
Based on wasdubya/x64dbgmcp, restructured with DDD architecture for better maintainability, testability, and extensibility.
This project follows Domain-Driven Design principles with a layered architecture:
src/x64dbg_mcp/
domain/ # Business logic: entities, value objects
application/ # Services, DTOs
infrastructure/ # HTTP client, debugger adapter
interface/ # MCP tools (6 modules)
zeromcp/ # Custom MCP protocol implementation
27 MCP tools across 6 interface modules:
- Debug Control: IsDebugging, Run, Pause, Stop, StepIn, StepOver, StepOut
- Breakpoints: SetBreakpoint, DeleteBreakpoint
- Registers: RegisterGet, RegisterSet, FlagGet, FlagSet
- Memory: MemoryRead, MemoryWrite, MemoryCheck, PatternFind
- Disassembly: Disassemble, GetCurrentInstruction, Assemble, AssembleToMemory
- Stack: StackPop, StackPush, StackPeek
- Modules: GetModuleList, ParseExpression, ExecCommand
Copy the plugin files to your x64dbg installation:
build/MCPx64dbg.dp32 -> x64dbg/release/x32/plugins/
build/MCPx64dbg.dp64 -> x64dbg/release/x64/plugins/
Or build from source:
mkdir build && cd build
cmake .. -G "Visual Studio 17 2022"
cmake --build . --config Release --target all_pluginspip install https://github.com/JordanRO2/MCP-x64dbg/archive/refs/heads/main.zipOr for development:
git clone https://github.com/JordanRO2/MCP-x64dbg.git
cd MCP-x64dbg
pip install -e .For Claude Code (~/.claude.json):
{
"mcpServers": {
"x64dbg-mcp": {
"type": "http",
"url": "http://127.0.0.1:13339/mcp"
}
}
}For Claude Desktop (claude_desktop_config.json):
{
"mcpServers": {
"x64dbg-mcp": {
"command": "python",
"args": ["-m", "x64dbg_mcp", "--stdio"]
}
}
}- Create
start_mcp.batin the project root:
@echo off
cd /d "C:\path\to\MCP-x64dbg\src"
set PYTHONPATH=C:\path\to\MCP-x64dbg\src
python -m x64dbg_mcp --host 0.0.0.0- Start x64dbg - the plugin automatically starts:
- HTTP server on port 8888 (x64dbg API)
- MCP server on port 13339 (AI interface)
# Start x64dbg first, then:
cd src
python -m x64dbg_mcp --host 0.0.0.0 --port 13339In x64dbg command bar:
httpserver- Toggle HTTP server on/offhttpport <port>- Change HTTP server portmcpserver- Toggle MCP server on/off
Set a breakpoint and analyze:
"Set a breakpoint at the main function and step through the first few instructions"
Memory analysis:
"Read 100 bytes from address 0x401000 and show me what's there"
Register inspection:
"What's the current value of RAX and RIP registers?"
Pattern searching:
"Find the pattern '48 8B 05' in the current module"
For WSL2 access to Windows-hosted x64dbg:
- Find Windows host IP:
cat /etc/resolv.conf | grep nameserver | awk '{print $2}'- Add firewall rule (PowerShell as Admin):
New-NetFirewallRule -DisplayName "MCP x64dbg" -Direction Inbound -LocalPort 13339 -Protocol TCP -Action Allow- Configure Claude (
~/.claude.json):
{
"mcpServers": {
"x64dbg-mcp": {
"type": "http",
"url": "http://<WINDOWS_HOST_IP>:13339/mcp"
}
}
}MCP-x64dbg/
src/
x64dbg_mcp/ # Python MCP server
domain/ # Entities: Register, Memory, Breakpoint, Module, Instruction
application/ # DebuggerService
infrastructure/ # HTTP client, DebuggerAdapter
interface/tools/ # MCP tool implementations
zeromcp/ # MCP protocol
MCPx64dbg.cpp # C++ plugin source
deps/
x64dbg_sdk/ # x64dbg plugin SDK
build/ # Compiled plugins (.dp32, .dp64)
start_mcp.bat # Auto-start batch file
- Original implementation: wasdubya/x64dbgmcp
- DDD restructure: JordanRO2
- x64dbg: x64dbg/x64dbg
MIT License - see LICENSE for details.