issue: MCP tool calls are sent to wrong server when multiple streamable-http MCP servers are enabled, causing 'MCP error -32602: Tool not found' #6520

Closed
opened 2025-11-11 16:58:21 -06:00 by GiteaMirror · 1 comment
Owner

Originally created by @eric2788 on GitHub (Sep 27, 2025).

Check Existing Issues

  • I have searched for any existing and/or related issues.
  • I have searched for any existing and/or related discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

v0.6.31

Ollama Version (if applicable)

No response

Operating System

Debian 11

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have provided every relevant configuration, setting, and environment variable used in my setup.
  • I have clearly listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc).
  • I have documented step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation. My steps:
  • Start with the initial platform/version/OS and dependencies used,
  • Specify exact install/launch/configure commands,
  • List URLs visited, user input (incl. example values/emails/passwords if needed),
  • Describe all options and toggles enabled or changed,
  • Include any files or environmental changes,
  • Identify the expected and actual result at each stage,
  • Ensure any reasonably skilled user can follow and hit the same issue.

Expected Behavior

When multiple streamable-http MCP servers are enabled at the same time in Open WebUI, each tool call should be correctly routed to the MCP server that actually provides the tool. There should never be a situation where the tool call is sent to the wrong MCP server, resulting in an error.

Actual Behavior

When two (or more) streamable-http MCP servers are enabled concurrently, tool calls are sometimes routed to the wrong MCP server. This leads to errors like MCP error -32602: Tool xxxxxxxx not found because the selected MCP server does not provide the tool being called. The tool routing appears to be random or incorrect, instead of being strictly matched by server/tool availability.

Steps to Reproduce

  1. Spin up two or more MCP servers implementing the streamable-http protocol, each providing a different set of tools.
  2. Select both MCP servers (tools) in Chat.
  3. Attempt to use a tool that is only present on one of the MCP servers.
  4. Observe that sometimes the tool call will fail with MCP error -32602: Tool xxxxxxxx not found.
  5. Deselect one MCP server (tool) resolves the issue and tool calls work as expected.

Logs & Screenshots

MCP error -32602: Tool xxxxxxxx not found

with 2 mcp servers:

Image

with 1 mcp server:

Image

Additional Information

  • The bug does NOT occur if only one MCP server is enabled.
  • This makes multi-server MCP usage unreliable.
  • This appears to be a tool routing/dispatch bug in the current implementation.
  • Related code: tool routing for MCP servers, streamable-http integration.
Originally created by @eric2788 on GitHub (Sep 27, 2025). ### Check Existing Issues - [x] I have searched for any existing and/or related issues. - [x] I have searched for any existing and/or related discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version v0.6.31 ### Ollama Version (if applicable) _No response_ ### Operating System Debian 11 ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have **provided every relevant configuration, setting, and environment variable used in my setup.** - [x] I have clearly **listed every relevant configuration, custom setting, environment variable, and command-line option that influences my setup** (such as Docker Compose overrides, .env values, browser settings, authentication configurations, etc). - [x] I have documented **step-by-step reproduction instructions that are precise, sequential, and leave nothing to interpretation**. My steps: - Start with the initial platform/version/OS and dependencies used, - Specify exact install/launch/configure commands, - List URLs visited, user input (incl. example values/emails/passwords if needed), - Describe all options and toggles enabled or changed, - Include any files or environmental changes, - Identify the expected and actual result at each stage, - Ensure any reasonably skilled user can follow and hit the same issue. ### Expected Behavior When multiple streamable-http MCP servers are enabled at the same time in Open WebUI, each tool call should be correctly routed to the MCP server that actually provides the tool. There should never be a situation where the tool call is sent to the wrong MCP server, resulting in an error. ### Actual Behavior When two (or more) streamable-http MCP servers are enabled concurrently, tool calls are sometimes routed to the wrong MCP server. This leads to errors like `MCP error -32602: Tool xxxxxxxx not found` because the selected MCP server does not provide the tool being called. The tool routing appears to be random or incorrect, instead of being strictly matched by server/tool availability. ### Steps to Reproduce 1. Spin up two or more MCP servers implementing the streamable-http protocol, each providing a different set of tools. 2. Select both MCP servers (tools) in Chat. 3. Attempt to use a tool that is only present on one of the MCP servers. 4. Observe that sometimes the tool call will fail with `MCP error -32602: Tool xxxxxxxx not found`. 5. Deselect one MCP server (tool) resolves the issue and tool calls work as expected. ### Logs & Screenshots ``` MCP error -32602: Tool xxxxxxxx not found ``` with 2 mcp servers: <img width="1149" height="1145" alt="Image" src="https://github.com/user-attachments/assets/f563d12d-7b47-4520-a7d6-65f9ecea35a3" /> with 1 mcp server: <img width="1006" height="1173" alt="Image" src="https://github.com/user-attachments/assets/059ebb55-421e-428d-b3ba-a602186dc91e" /> ### Additional Information - The bug does NOT occur if only one MCP server is enabled. - This makes multi-server MCP usage unreliable. - This appears to be a tool routing/dispatch bug in the current implementation. - Related code: tool routing for MCP servers, streamable-http integration.
GiteaMirror added the bug label 2025-11-11 16:58:21 -06:00
Author
Owner

@tjbck commented on GitHub (Sep 28, 2025):

Should be addressed with 742e2ff193

@tjbck commented on GitHub (Sep 28, 2025): Should be addressed with 742e2ff193a153bbb65f909d1296bbcf31f062fa
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#6520