[GH-ISSUE #303] issue: mcpo errors while starting (maybe dependency-issues with mcp2?) #134

Open
opened 2026-10-18 21:12:04 +00:00 by bsakaguchi · 5 comments
Owner

Originally created by @lineg-it on GitHub (Jul 29, 2026).
Original GitHub issue: https://github.com/open-webui/mcpo/issues/303

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of mcpo.

mcpo Version

0.0.20

Open WebUI Version (if applicable)

Operating System

Debian 13

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both MCPO and Open WebUI.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

Mcpo starts, installs dependencies and starts a listener.

Actual Behavior

mcpo doesnt start in the first place.

Steps to Reproduce

  1. start mcpo via:
uvx mcpo --port 18000 --api-key "<redacted>" --config ./config.json --hot-reload

Logs & Screenshots

╭───────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────╮
│ /home/loginuser/.cache/uv/archive-v0/ev7leLIhOjDiG_9T/lib/python3.13/site-packages/mcpo/__init__.py:93 in main            │
│                                                                                                                           │
│    90 │   │   │   typer.echo("Error: You must specify the MCP server command after '--'")									│
│    91 │   │   │   return									 																│
│    92 │																													│
│ ❱  93 │   from mcpo.main import run									 													│
│    94 │									 																				│
│    95 │   if config_path:									 																│
│    96 │   │   print("Starting MCP OpenAPI Proxy with config file:", config_path)									 		│
│									 																						│
│ /home/loginuser/.cache/uv/archive-v0/ev7leLIhOjDiG_9T/lib/python3.13/site-packages/mcpo/main.py:20 in <module>			│
│									 																						│
│    17 from mcp import ClientSession, StdioServerParameters																│
│    18 from mcp.client.sse import sse_client																				│
│    19 from mcp.client.stdio import stdio_client																			│
│ ❱  20 from mcp.client.streamable_http import streamablehttp_client									 						│
│    21									 																					│
│    22 from mcpo.utils.auth import APIKeyMiddleware, get_verify_api_key									 				│
│    23 from mcpo.utils.main import (									 													│
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http' (/home/loginuser/.cache/uv/archive-v0/ev7leLIhOjDiG_9T/lib/python3.13/site-packages/mcp/client/streamable_http.py)

Additional Information

EDIT: The docker image of mcpo starts perfectly, but refuses to load and start several mcp-servers, which more or less correlates to the fact that mcp v2 changed many things

Workaround for failing mcp-servers within mcpo on Docker:

Add --with mcp<2 to your uvx arguments for any affected mcp-server:

For example to fix (affected) @modelcontextprotocol/fetch, open config.json and add two lines as follows:

"fetch": {
      "command": "uvx",
      "args": [
        "--with",                      #<- 1.
        "mcp<2",                     # <- 2.
        "mcp-server-fetch"
      ]
    },

Source: https://github.com/modelcontextprotocol/servers/issues/4560

Originally created by @lineg-it on GitHub (Jul 29, 2026). Original GitHub issue: https://github.com/open-webui/mcpo/issues/303 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of mcpo. ### mcpo Version 0.0.20 ### Open WebUI Version (if applicable) - ### Operating System Debian 13 ### 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** MCPO and Open WebUI. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior Mcpo starts, installs dependencies and starts a listener. ### Actual Behavior mcpo doesnt start in the first place. ### Steps to Reproduce 1. start mcpo via: ``` uvx mcpo --port 18000 --api-key "<redacted>" --config ./config.json --hot-reload ``` ### Logs & Screenshots ``` ╭───────────────────────────────────────────────────────────── Traceback (most recent call last) ───────────────────────────╮ │ /home/loginuser/.cache/uv/archive-v0/ev7leLIhOjDiG_9T/lib/python3.13/site-packages/mcpo/__init__.py:93 in main │ │ │ │ 90 │ │ │ typer.echo("Error: You must specify the MCP server command after '--'") │ │ 91 │ │ │ return │ │ 92 │ │ │ ❱ 93 │ from mcpo.main import run │ │ 94 │ │ │ 95 │ if config_path: │ │ 96 │ │ print("Starting MCP OpenAPI Proxy with config file:", config_path) │ │ │ │ /home/loginuser/.cache/uv/archive-v0/ev7leLIhOjDiG_9T/lib/python3.13/site-packages/mcpo/main.py:20 in <module> │ │ │ │ 17 from mcp import ClientSession, StdioServerParameters │ │ 18 from mcp.client.sse import sse_client │ │ 19 from mcp.client.stdio import stdio_client │ │ ❱ 20 from mcp.client.streamable_http import streamablehttp_client │ │ 21 │ │ 22 from mcpo.utils.auth import APIKeyMiddleware, get_verify_api_key │ │ 23 from mcpo.utils.main import ( │ ╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯ ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http' (/home/loginuser/.cache/uv/archive-v0/ev7leLIhOjDiG_9T/lib/python3.13/site-packages/mcp/client/streamable_http.py) ``` ### Additional Information **EDIT**: The docker image of mcpo starts perfectly, but refuses to load and start several mcp-servers, which more or less correlates to the fact that `mcp v2` changed many things **Workaround for failing mcp-servers within `mcpo` on Docker**: Add `--with mcp<2` to your `uvx` arguments for any affected mcp-server: For example to fix (affected) `@modelcontextprotocol/fetch`, open `config.json` and add two lines as follows: ``` "fetch": { "command": "uvx", "args": [ "--with", #<- 1. "mcp<2", # <- 2. "mcp-server-fetch" ] }, ``` Source: https://github.com/modelcontextprotocol/servers/issues/4560
Author
Owner

@aciapetti commented on GitHub (Jul 29, 2026):

It happens to me, too!

<!-- gh-comment-id:5118872907 --> @aciapetti commented on GitHub (Jul 29, 2026): It happens to me, too!
Author
Owner

@freerainboxbox commented on GitHub (Jul 30, 2026):

Temporary fix before a PR is merged:

uvx --with "mcp<2" mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command

That should pin a previous version without having to change any code.

<!-- gh-comment-id:5126976669 --> @freerainboxbox commented on GitHub (Jul 30, 2026): Temporary fix before a PR is merged: `uvx --with "mcp<2" mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command` That should pin a previous version without having to change any code.
Author
Owner

@av commented on GitHub (Aug 2, 2026):

Independently reproduced while integrating mcpo into Harbor (https://github.com/av/harbor): fresh uvx mcpo resolves mcp 2.0.0 (mcpo 0.0.20 declares mcp>=1.17.0) and crashes at startup with ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http' — the import was removed in the mcp 2.x major.

Reliable workaround at the mcpo level (no per-server pins needed): uvx --with 'mcp<2' mcpo ... (resolves mcp 1.29.0, everything works) — that's what Harbor ships now (github.com/av/harbor@5b90147).

Proper fix would be an upper bound in mcpo's dependency metadata (mcp>=1.17.0,<2) until mcpo is ported to the 2.x API.

<!-- gh-comment-id:5159745707 --> @av commented on GitHub (Aug 2, 2026): Independently reproduced while integrating mcpo into Harbor (https://github.com/av/harbor): fresh `uvx mcpo` resolves `mcp 2.0.0` (mcpo 0.0.20 declares `mcp>=1.17.0`) and crashes at startup with `ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http'` — the import was removed in the mcp 2.x major. Reliable workaround at the mcpo level (no per-server pins needed): `uvx --with 'mcp<2' mcpo ...` (resolves mcp 1.29.0, everything works) — that's what Harbor ships now (https://github.com/av/harbor/commit/5b90147). Proper fix would be an upper bound in mcpo's dependency metadata (`mcp>=1.17.0,<2`) until mcpo is ported to the 2.x API.
Author
Owner

@ashtonomy commented on GitHub (Aug 11, 2026):

Independently reproduced while integrating mcpo into Harbor (https://github.com/av/harbor): fresh uvx mcpo resolves mcp 2.0.0 (mcpo 0.0.20 declares mcp>=1.17.0) and crashes at startup with ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http' — the import was removed in the mcp 2.x major.

Reliable workaround at the mcpo level (no per-server pins needed): uvx --with 'mcp<2' mcpo ... (resolves mcp 1.29.0, everything works) — that's what Harbor ships now (av/harbor@5b90147).

Proper fix would be an upper bound in mcpo's dependency metadata (mcp>=1.17.0,<2) until mcpo is ported to the 2.x API.

Fixed in #304, waiting to be merged. In the meantime, another option for circumventing the mcp dependency in cases with regular mcpo calls is to install the tool with uv, then just call the tool directly:

uv tool install --with 'mcp<2' mcpo
mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command
<!-- gh-comment-id:5256796528 --> @ashtonomy commented on GitHub (Aug 11, 2026): > Independently reproduced while integrating mcpo into Harbor (https://github.com/av/harbor): fresh `uvx mcpo` resolves `mcp 2.0.0` (mcpo 0.0.20 declares `mcp>=1.17.0`) and crashes at startup with `ImportError: cannot import name 'streamablehttp_client' from 'mcp.client.streamable_http'` — the import was removed in the mcp 2.x major. > > Reliable workaround at the mcpo level (no per-server pins needed): `uvx --with 'mcp<2' mcpo ...` (resolves mcp 1.29.0, everything works) — that's what Harbor ships now ([av/harbor@5b90147](https://github.com/av/harbor/commit/5b90147)). > > Proper fix would be an upper bound in mcpo's dependency metadata (`mcp>=1.17.0,<2`) until mcpo is ported to the 2.x API. Fixed in #304, waiting to be merged. In the meantime, another option for circumventing the mcp dependency in cases with regular mcpo calls is to install the tool with uv, then just call the tool directly: ```bash uv tool install --with 'mcp<2' mcpo mcpo --port 8000 --api-key "top-secret" -- your_mcp_server_command ```
Author
Owner

@albin-george-kurian commented on GitHub (Sep 4, 2026):

Hi @tjbck, could you assign this issue to me? I’d like to work on it.

I’ve reviewed the issue and the discussion, and I believe the root cause is the mcp 2.x compatibility issue with mcpo 0.0.20. The existing workaround is to pin mcp<2, while the proper fix appears to be the dependency upper bound described in #304.

I’d be happy to work on the fix and submit a PR.

<!-- gh-comment-id:5544754861 --> @albin-george-kurian commented on GitHub (Sep 4, 2026): Hi @tjbck, could you assign this issue to me? I’d like to work on it. I’ve reviewed the issue and the discussion, and I believe the root cause is the `mcp` 2.x compatibility issue with `mcpo` 0.0.20. The existing workaround is to pin `mcp<2`, while the proper fix appears to be the dependency upper bound described in #304. I’d be happy to work on the fix and submit a PR.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
open-webui/mcpo#134
No description provided.