Skip to content

MCP tool calls not executed in UI chat (stops after thinking phase) #544

@xian-zh

Description

@xian-zh

Bug Description

When using MCP tools in the UI chat, the conversation stops after the
thinking phase without actually executing the tool call.

Environment

  • oMLX version: 0.3.1
  • Model: Qwen3.5-35B-A3B-oQ3e
  • MCP Server: brave-search (2 tools available)
  • OS: macOS (Apple Silicon)

Steps to Reproduce

  1. Configure MCP server in ~/.omlx/mcp.json
  2. Start oMLX service
  3. Open UI chat
  4. Send a message requiring tool use (e.g. "请使用搜索工具查询北京今天天气")

Expected Behavior

  1. Model generates tool_calls ✅
  2. UI executes the MCP tool call
  3. Tool result is passed back to model
  4. Model generates final answer based on real search results

Actual Behavior

  1. Model generates tool_calls ✅
  2. UI stops after thinking phase ❌
  3. No tool is executed
  4. No final answer generated

Evidence

MCP connects successfully at startup:
Connected to MCP server 'brave-search' (2 tools available)
MCP manager started: 1/1 servers, 2 tools available
MCP initialized with 2 tools
GrammarCompiler initialized

API call works correctly and returns proper tool_calls:

{
  "choices": [{
    "message": {
      "tool_calls": [{
        "function": {
          "name": "brave_search__brave_web_search",
          "arguments": "{\"query\": \"北京今天天气\", \"count\": 5}"
        }
      }]
    },
    "finish_reason": "tool_calls"
  }]
}

But UI shows only the thinking content and stops,
no tool execution happens, no final response generated.
##Logs
No logs are generated in server.log when the UI stops after thinking.
The server.log only updates during initial startup and model loading.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions