Local MCP server ๐“๐จ๐จ๐ฅ-๐‚๐š๐ฅ๐ฅ ๐‹๐จ๐จ๐ฉ ๐๐ฎ๐ 

The hanging behavior is a known technical issue in the integration between the local client application (the chat interface or terminal wrapper) and the LLM API. It is called a Tool-Call Loop Hang.

Here is the step-by-step sequence that causes the freeze:

  1. AI Initiates Tool: The user requests a file modification or read. The AI generates a tool call (e.g., mcp_edit_file_6lpu9l) and stops generating text, as required by the API protocol.

  2. MCP Server Executes: The local MCP server successfully executes the file edit and returns the result (the diff or file contents) to the client application.

  3. The Integration Gap (The Hang): In a fully automated integration, the client application is supposed to immediately feed the tool's output back to the LLM to trigger the next text generation turn. However, in this specific client setup, the application fails to auto-trigger the next turn. It pauses and waits.

  4. The Wake-Up: Because the client is waiting for the AI, and the AI is waiting for the client to send the tool results, the interface hangs. When the user types any message (e.g., "are you stuck again?"), it forces the client application to package the entire conversation historyโ€”including the pending tool resultsโ€”and send it to the LLM. This instantly wakes the AI up, resulting in the immediate "AI-OK" response.


๐‡๐จ๐ฐ ๐ญ๐จ ๐…๐ข๐ฑ ๐จ๐ซ ๐Œ๐ข๐ญ๐ข๐ ๐š๐ญ๐ž ๐ญ๐ก๐ž ๐ˆ๐ฌ๐ฌ๐ฎ๐ž

  1. Client-Side Configuration (Permanent Fix):
    The developer of the client application or terminal wrapper must update the execution logic. The client must automatically post the tool output back to the LLM API endpoint to request the next completion turn without waiting for manual user input.

  2. User Workaround (Immediate Fix):
    Whenever a tool call completes (you will see the green tool response block in the interface) and the interface pauses for more than 3 seconds, type a single character (such as a period . or go) and press Enter. This forces the client to send the tool results to the LLM and resumes execution instantly.

  3. AI Mitigation (Combining Steps):
    The AI will minimize sequential tool calls where possible, combining reads or edits into single multi-file operations to reduce the number of turn transitions.

Please authenticate to join the conversation.

Upvoters
Status

In Review

Board
๐Ÿ›

Bug Reports

Date

13 days ago

Author

Nigel Protter

Subscribe to post

Get notified by email when there are changes.