mrexodia/ida-pro-mcp

HTTP requests hang indefinitely due to IDA main thread synchronization deadlock

Open

#217 opened on Dec 15, 2025

 (10 comments) (0 reactions) (0 assignees)Python (1,121 forks)auto 404
bughelp wanted

Repository metrics

Stars
 (9,376 stars)
PR merge metrics
 (PR metrics pending)

Description

Summary

MCP tool calls hang forever when IDA's main thread is blocked by a dialog, auto-analysis, or other blocking operation. The HTTP server becomes unresponsive and never returns a response to the client.

Observed Behavior

  1. First few MCP requests complete successfully
  2. At some point, a request hangs indefinitely
  3. All subsequent requests also hang
  4. The process must be forcefully terminated

Call Stack When Hung

ntdll.dll!00007ffffd581e54()
mswsock.dll!00007ffff98368ea()
mswsock.dll!00007ffff98365c4()
ws2_32.dll!00007ffffb569781()
select.pyd!00007fff9548243b()
select.pyd!00007fff9548224f()
python311.dll!00007ffe152ab98e()
python311.dll!00007ffe152a2264()
python311.dll!00007ffe152c6c97()
...

Root Cause Analysis

The @idaread and @idawrite decorators in ida_mcp/sync.py use idaapi.execute_sync() to marshal calls to IDA's main thread. The worker thread then blocks indefinitely waiting for the result:

# ida_mcp/sync.py, line 66-70
idaapi.execute_sync(runned, safety_mode)
res = res_container.get()  # Blocks forever if main thread never executes runned()

Deadlock sequence:

HTTP Worker Thread                    IDA Main Thread
─────────────────                    ───────────────
1. Receive HTTP request
2. Call @idaread decorated function
3. execute_sync() queues task
4. Block on res_container.get()
        │                            Main thread is blocked by:
        │                            - Modal dialog (Open/Save/etc.)
        │                            - Auto-analysis in progress
        │                            - Debugger breakpoint
        │                            - IDAPython script running
        ▼
   Waiting forever...                Task never gets executed

Steps to Reproduce

  1. Start IDA Pro and load a binary
  2. Enable the MCP plugin (Edit -> Plugins -> MCP or Ctrl+Alt+M)
  3. Connect an MCP client (e.g., Claude Desktop)
  4. Make a few successful tool calls
  5. While a request is pending, trigger any of these in IDA:
    • Open File -> Open dialog
    • Start analyzing a new binary segment
    • Hit a breakpoint while debugging
  6. Result: The pending request hangs forever, server becomes unresponsive

Environment

  • OS: Windows 10/11
  • Python: 3.11
  • IDA Pro: 8.x / 9.x
  • MCP Client: Claude Desktop / Cursor / Other

Contributor guide