Skip to main content
Glama
x64dbg MCP Server

x64dbg MCP Server

by ouonet

x64dbg MCP 서버

x64dbg 리버스 엔지니어링 및 디버깅 기능을 AI 어시스턴트(Claude, Windsurf Cascade, Cursor 등)에 노출하는 프로덕션 수준의 Model Context Protocol 서버입니다.

아키텍처

┌─────────────────┐  STDIO/JSON-RPC   ┌──────────────────┐  TCP (JSON)  ┌──────────────┐
│  AI Assistant    │ ◄───────────────► │  MCP Server      │ ◄──────────► │  x64dbg      │
│  (Claude, etc.)  │                   │  (Node.js / TS)  │   port 27042 │  + Bridge    │
└─────────────────┘                    └──────────────────┘              │    Plugin    │
                                                                         └──────────────┘

두 가지 구성 요소:

  1. MCP 서버 (src/) — TypeScript Node.js 프로세스. AI 호스트와 STDIO를 통해 MCP로 통신하며 TCP를 통해 브리지에 연결합니다.

  2. 브리지 플러그인 (plugin/) — x64dbg 내부에 Python 3.10+를 임베드하는 경량 C 로더 플러그인입니다. Python 브리지 스크립트가 ctypes를 통해 x64bridge.dll을 직접 호출하므로 x64dbgpy 의존성이 없습니다. MCP 요청을 x64dbg Bridge SDK 호출로 변환하는 로컬 TCP 서버를 노출합니다.

Related MCP server: Binary MCP Server

기능

자동 실행 및 PE 탐지

  • PE 헤더를 읽어 PE 아키텍처(x86 / x64)를 자동으로 탐지합니다.

  • 대상 실행 파일에 맞는 올바른 디버거 변형(x32dbg 또는 x64dbg)을 실행합니다.

  • 브리지 플러그인 TCP 포트에 연결 가능해질 때까지 대기한 후 연결합니다 — 수동 설정 불필요

  • x32dbg 플러그인 지원을 위한 32비트 Python 임베드 번들 포함

핵심 디버깅 (12개 도구)

  • load_executable — PE 파일 로드, x86/x64 자동 탐지, 디버거 자동 실행, 진입점에서 중단

  • continue_execution / step_into / step_over / step_out

  • run_to_address — 특정 주소까지 실행

  • set_breakpoint — 소프트웨어, 하드웨어(실행/읽기/쓰기/액세스) 및 조건과 로그 텍스트가 포함된 메모리 BP

  • remove_breakpoint / list_breakpoints

  • terminate_session / list_sessions

  • execute_command — 원시 x64dbg 명령 실행

메모리 및 레지스터 (9개 도구)

  • read_memory / write_memory / search_memory — 와일드카드를 포함한 16진수 패턴, ASCII/Unicode 텍스트

  • get_memory_map — 보호 및 모듈 정보가 포함된 전체 가상 메모리 레이아웃

  • get_registers / set_register — GP, 플래그, 세그먼트, 디버그, FPU/SSE 레지스터

  • get_call_stack — 반환 주소, 모듈 이름 및 심볼이 포함된 백트레이스

  • get_threads / switch_thread — 스레드 열거 및 컨텍스트 전환

정적 및 동적 분석 (10개 도구)

  • disassemble — 메타데이터 포함(is_call, is_jump, 참조 대상, 주석)

  • analyze_function — 경계, 크기, 호출 그래프(호출자 + 피호출자), 리프 탐지

  • get_cross_references — 코드 및 데이터 xrefs (to/from/both)

  • list_functions — 모듈 필터링, 이름 검색 및 페이지 매기기 포함

  • get_modules / get_imports / get_exports — DLL 및 함수 이름 필터 포함

  • find_strings — 콘텐츠 필터링 및 최소 길이 제어가 포함된 ASCII + Unicode

  • get_pe_header — 전체 PE 구조: DOS/NT 헤더, 섹션, 데이터 디렉토리, 엔트로피

  • trace_execution — 선택적 레지스터 스냅샷과 함께 명령어 추적 기록

보안 분석 (5개 도구)

  • detect_packing — 엔트로피 분석, 알려진 패커 서명, 임포트 개수 휴리스틱, 신뢰도 점수

  • analyze_suspicious_apis — 10개 카테고리의 100개 이상의 악성코드 관련 API와 임포트 교차 참조

  • detect_anti_debug — IsDebuggerPresent, 타이밍 체크, PEB 플래그, TLS 콜백, int 2D/3 및 우회 제안

  • check_section_anomalies — W+X 섹션, 비정상적인 이름, 원시 크기 0, 높은 엔트로피 탐지

  • generate_security_report — 전체 위험 수준을 포함한 모든 보안 검사의 통합 1차 분류 보고서

총: 36개 도구

사전 요구 사항

  • Node.js ≥ 20

  • Windows에 설치된 x64dbg (또는 x64dbg/ 아래의 번들 복사본 사용)

  • x64dbg용으로 설치된 Python 3.10+, 또는 x32dbg용 32비트 Python 임베드 번들 사용

  • 로더 플러그인을 빌드하기 위한 CMake 3.15+ 및 C 컴파일러(MSVC / MinGW)

설치

# Clone and install
cd x64dbg-mcp
npm install
npm run build

# Build the loader plugin (64-bit)
cd plugin\loader
cmake -B build64 -A x64
cmake --build build64 --config Release
cd ..\..\n
# Copy plugin files into x64dbg
copy plugin\loader\build64\Release\x64dbg_mcp_loader.dp64  C:\x64dbg\plugins\
copy plugin\x64dbg_bridge_sdk.py  C:\x64dbg\plugins\
copy plugin\x64dbg_mcp_bridge.py  C:\x64dbg\plugins\

구성

.env.example을 .env로 복사하고 조정하십시오:

X64DBG_PATH=C:\x64dbg
BRIDGE_HOST=127.0.0.1
BRIDGE_PORT=27042
LOG_LEVEL=info
MAX_SESSIONS=5
SESSION_TIMEOUT_MS=3600000

사용법

1. AI 호스트 구성

참고: 더 이상 x64dbg를 수동으로 시작할 필요가 없습니다. MCP 서버는 load_executable을 호출할 때 올바른 디버거(x32dbg 또는 x64dbg)를 자동으로 실행합니다. 로더 플러그인은 자동으로 Python 3을 초기화하고, 브리지 스크립트를 실행하며, 27042 포트에서 TCP 리스너를 시작합니다.

Windsurf / Cascade

MCP 설정에 추가:

{
  "mcpServers": {
    "x64dbg-mcp": {
      "command": "node",
      "args": ["C:\\path\\to\\x64dbg-mcp\\dist\\server.js"],
      "env": {
        "BRIDGE_PORT": "27042"
      }
    }
  }
}

Claude Desktop

claude_desktop_config.json에 추가:

{
  "mcpServers": {
    "x64dbg-mcp": {
      "command": "node",
      "args": ["C:\\path\\to\\x64dbg-mcp\\dist\\server.js"]
    }
  }
}

2. 디버깅 시작

AI 어시스턴트에게 요청하세요:

"Load C:\samples\target.exe and analyze it for suspicious behavior"

AI는 MCP 도구를 사용하여 다음을 수행합니다:

  1. load_executable → 바이너리 로드

  2. generate_security_report → 모든 보안 검사 실행

  3. disassemble → 의심스러운 코드 검사

  4. set_breakpoint + continue_execution → 동적 분석

예시 워크플로우

크래시 분석

User: "My program crashes at startup, help me debug it"
AI:   load_executable → continue_execution → get_call_stack → 
      read_memory → get_registers → disassemble

악성코드 분류

User: "Analyze this suspicious binary"
AI:   load_executable → generate_security_report →
      analyze_suspicious_apis → detect_anti_debug →
      find_strings → get_imports

리버스 엔지니어링

User: "Find the license check function"
AI:   load_executable → find_strings (filter: "license") →
      get_cross_references → analyze_function →
      disassemble → trace_execution

테스트

# Test with MCP Inspector
npm run inspector

# Development mode (no build step)
npm run dev

프로젝트 구조

x64dbg-mcp/
├── src/
│   ├── server.ts          # Entry point
│   ├── bridge.ts          # TCP client to x64dbg bridge
│   ├── launcher.ts        # Auto-detect PE arch & spawn debugger
│   ├── session.ts         # Session lifecycle management
│   ├── config.ts          # Configuration from env
│   ├── logger.ts          # Winston logger (stderr only)
│   ├── types.ts           # TypeScript type definitions
│   └── tools/
│       ├── index.ts       # Tool registration barrel
│       ├── debug.ts       # Core debugging tools
│       ├── memory.ts      # Memory & register tools
│       ├── analysis.ts    # Analysis tools
│       └── security.ts    # Security analysis tools
├── plugin/
│   ├── x64dbg_mcp_bridge.py   # TCP server + handler dispatch (Python 3)
│   ├── x64dbg_bridge_sdk.py   # ctypes bindings to x64bridge.dll
│   ├── loader/
│   │   ├── x64dbg_mcp_loader.c # C plugin that embeds Python 3
│   │   └── CMakeLists.txt      # Build system for the loader
│   └── README.md
├── package.json
├── tsconfig.json
├── .env.example
└── README.md

라이선스

MIT

Available Tools

39 tools
analyze_functionA

Analyse the function that contains the given address. Returns boundaries, size, call graph (callers + callees), and whether the function is a leaf.

Inputs: sessionId (required), address (required).

analyze_suspicious_apisA

Cross-reference the executable's import table against a database of Windows APIs commonly used by malware, grouped by category (process injection, network, crypto, anti-debug, etc.). Returns per-category findings and an overall risk level.

Inputs: sessionId (required), module, includeAll.

check_section_anomaliesA

Check PE sections for anomalies that may indicate packing, code injection, or tampering: writable+executable sections, unusual names, zero raw-size with non-zero virtual-size, high entropy.

Inputs: sessionId (required), module.

close_debuggerA

Kill the x64dbg or x32dbg process. Works even if the bridge is not connected. Use this to cleanly shut down the debugger before deploying updated plugins or when you need to restart the debugger.

Inputs: force.

collect_bp_argsA

Continue execution in a loop, collecting a memory expression at each breakpoint hit. Use this to trace repeated calls (e.g. AddMoudle, GetClassObject). The default expr 'ptr_utf16@[esp+4]' reads a wchar_t* arg from the x86 stack.

Inputs: sessionId (required), expr, maxHits, timeoutSec.

continue_executionA

Resume execution of a paused debuggee. Runs until the next breakpoint, exception, or program exit. REQUIRES: session state must be 'paused' (check with get_status). Returns stopReason ('breakpoint', 'paused', or 'exited') and the address where execution stopped. If stopReason is 'exited', the process has terminated.

Inputs: sessionId (required).

detect_anti_debugB

Scan the loaded executable for common anti-debugging techniques: API checks (IsDebuggerPresent, NtQueryInformationProcess), timing checks, PEB flags, int 2d / int 3, TLS callbacks, etc.

Inputs: sessionId (required), module.

detect_packingA

Analyse the loaded executable for signs of packing or obfuscation. Checks section entropy, section name anomalies, import table size, entry-point location, and known packer signatures. Returns a confidence score and list of indicators.

Inputs: sessionId (required), module.

disassembleA

Disassemble instructions starting at a given address in the loaded module. Returns address, raw bytes, mnemonic, operands, and metadata (is_call, is_jump, reference target) for each instruction. Safe to call while paused. Address may be a hex value ('0x401000') or a symbol name ('main', 'kernel32.CreateFileW'). Tip: after load_executable with breakOnEntry=true, disassemble the entry point returned in the load result to see where execution begins.

Inputs: sessionId (required), address (required), count.

execute_commandA

Execute a raw x64dbg command string. Use this for advanced operations not covered by other tools. Returns the command output.

Inputs: sessionId (required), command (required).

find_stringsB

Search for ASCII and Unicode strings in the debuggee's memory. Optionally filter by content substring or module.

Inputs: sessionId (required), module, filter, minLength, +1 more.

generate_security_reportA

Run all security analysis tools and produce a consolidated report: packing detection, suspicious API analysis, anti-debug detection, and section anomaly checks. Useful as a first-pass triage.

Inputs: sessionId (required), module.

get_call_stackA

Get the call stack (backtrace) of the current thread. Shows return addresses, module names, and function names where available.

Inputs: sessionId (required), maxFrames.

get_cross_referencesA

Find all cross-references (xrefs) to or from the given address. Returns code references (calls/jumps) and data references (reads/writes).

Inputs: sessionId (required), address (required), direction.

get_exportsB

List all exported functions/symbols for a specific module.

Inputs: sessionId (required), module (required), nameFilter.

get_importsB

List all imported functions for a specific module. Shows DLL name, function name, ordinal, and IAT address.

Inputs: sessionId (required), module, dllFilter, functionFilter.

get_memory_mapA

Return the virtual memory map of the debuggee process: all regions with base address, size, protection, type, and associated module.

Inputs: sessionId (required), filterModule, filterProtection.

get_modulesA

List all modules (DLLs and the main EXE) loaded in the debuggee with base address, size, entry point, and file path.

Inputs: sessionId (required).

get_pe_headerA

Parse and return the PE header information for a module: DOS header, NT headers, section table, data directories, timestamp, subsystem, characteristics, etc.

Inputs: sessionId (required), module.

get_registersA

Read the current CPU register values of the active thread. Includes general-purpose registers, instruction pointer (RIP/EIP), flags, and optionally segment and debug registers. REQUIRES: session must be paused (call get_status to check). On x64: returns RAX, RBX, RCX, RDX, RSI, RDI, RSP, RBP, RIP, R8-R15. On x86: returns EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP, EIP.

Inputs: sessionId (required), includeSegment, includeDebug, includeFpu.

get_statusA

Query the current state of the debugger and active session. Returns bridge connectivity, session state (idle/paused/running/stepping/terminated), current instruction pointer, active thread, and a next-step hint. Call this whenever you are unsure what state the debugger is in before issuing step/continue/breakpoint operations. This is always safe to call — it does not change any debugger state.

Inputs: sessionId.

get_threadsB

List all threads in the debuggee process with their current state.

Inputs: sessionId (required).

list_breakpointsA

List all breakpoints in the session, including hit counts and conditions.

Inputs: sessionId (required).

list_functionsA

List recognised functions in the debuggee. Can filter by module name and/or name substring.

Inputs: sessionId (required), module, nameFilter, offset, +1 more.

list_sessionsA

List all active debugging sessions with their state and metadata.

Inputs: no named parameters.

load_executableA

START HERE — load a PE executable into x64dbg and create a debugging session. Returns a sessionId that ALL other tools require as their first parameter. Auto-detects 32-bit vs 64-bit PE and launches x32dbg or x64dbg accordingly. With breakOnEntry=true (default): execution stops at the entry point and the session state becomes 'paused' — you can immediately call step_into, get_registers, or disassemble. With breakOnEntry=false: the debuggee starts running; use set_breakpoint then continue_execution to pause it later. Only one session can be active at a time. Call terminate_session first if one exists.

Inputs: executablePath (required), commandLineArgs, breakOnEntry, autoAnalyze.

read_memoryA

Read raw bytes from the debuggee's virtual address space. Returns a hex+ASCII dump. Address must be in the debuggee's mapped memory (see get_memory_map for valid ranges). REQUIRES: session must be paused.

Inputs: sessionId (required), address (required), size.

remove_breakpointB

Remove a previously set breakpoint at the given address.

Inputs: sessionId (required), address (required).

run_to_addressA

Set a one-shot breakpoint at the given address and continue execution. Stops when the address is reached or another breakpoint/exception fires first.

Inputs: sessionId (required), address (required).

search_memoryA

Search the debuggee's memory for a byte pattern or string. Supports hex patterns with wildcards (e.g. '4D 5A ?? ??') and text strings.

Inputs: sessionId (required), pattern (required), searchType, startAddress, +2 more.

set_breakpointB

Set a breakpoint. Supports software BPs, hardware BPs (execute/read/write), and memory BPs. Optionally supply a condition expression or log text.

Inputs: sessionId (required), address (required), type, condition, +2 more.

set_registerC

Set the value of a single CPU register.

Inputs: sessionId (required), register (required), value (required).

step_intoA

Execute one or more instructions, stepping INTO function calls. REQUIRES: session state must be 'paused'. Returns the new address, disassembly, module, and key register values after stepping. Use step_over instead if you want to skip over CALL instructions.

Inputs: sessionId (required), count.

step_outA

Run until the current function returns (execute until RET). REQUIRES: session state must be 'paused'. Useful for quickly leaving a called function and returning to the caller without stepping through every instruction.

Inputs: sessionId (required).

step_overA

Execute one or more instructions, stepping OVER function calls. REQUIRES: session state must be 'paused'. If the current instruction is a CALL, the entire called function executes and control returns to the instruction after the CALL. Use step_into if you want to trace inside the called function.

Inputs: sessionId (required), count.

switch_threadA

Switch the active thread. Subsequent register/stack/step operations will apply to this thread.

Inputs: sessionId (required), threadId (required).

terminate_sessionA

Stop the debuggee process and close the debugging session. x64dbg itself stays open and ready for the next load_executable call. Call this before loading a new executable, or when analysis is complete.

Inputs: sessionId (required).

trace_executionB

Record an execution trace from the current position. Steps through instructions and records address + disassembly at each step. Stops after maxInstructions or a breakpoint.

Inputs: sessionId (required), maxInstructions, traceInto, recordRegisters, +1 more.

write_memoryA

Write bytes to the debuggee's virtual memory. Use with caution — writing to wrong addresses can crash the debuggee.

Inputs: sessionId (required), address (required), hexBytes (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.8/5.0

    Scored across 39 tools

    Disambiguation4/5

    Most tools have distinct, well-defined purposes (e.g., step_into vs step_over, disassemble vs read_memory). However, tools like analyze_function and analyze_suspicious_apis could be confused if descriptions are not read carefully, and execute_command overlaps with other tools' capabilities.

    Naming Consistency5/5

    All tool names use a consistent verb_noun pattern in snake_case (e.g., analyze_function, load_executable, continue_execution). No mixed conventions or vague verbs.

    Tool Count4/5

    39 tools is on the higher end but justified by the breadth of debugger functionality. The tool set covers execution control, memory inspection, analysis, and session management without being excessive.

    Completeness5/5

    The tool set provides comprehensive coverage for a debugger/analysis server: loading, stepping, breakpoints, memory, registers, modules, security analysis, session management. No obvious gaps for typical reverse engineering tasks.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables AI-assisted reverse engineering and debugging through x64dbg integration. Provides 40+ tools for breakpoint management, memory operations, register manipulation, code analysis, process control, and advanced debugging features.
      22
      -
    • A
      license
      Not graded
      quality
      F
      maintenance
      Enables AI-driven reverse engineering with x64dbg via 71+ MCP tools for breakpoints, memory, disassembly, tracing, debug control, PE analysis, and anti-anti-debugging, supporting HTTP, SSE, and stdio transports.
      2
      MIT