[GH-ISSUE #239] issue: Inexplicable intermittent crash on startup #106

Open
opened 2026-10-18 21:11:48 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @mekhami on GitHub (Aug 26, 2025).
Original GitHub issue: https://github.com/open-webui/mcpo/issues/239

Originally assigned to: @taylorwilsdon on GitHub.

Check Existing Issues

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

mcpo Version

0.0.17

Open WebUI Version (if applicable)

No response

Operating System

MacOS Sonoma

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

Proxy should launch

Actual Behavior

Proxy crashes with this error message:

Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:37,191 - INFO - Starting MCPO Server...
2025-08-26 15:14:37,191 - INFO -   Name: MCP OpenAPI Proxy
2025-08-26 15:14:37,191 - INFO -   Version: 1.0
2025-08-26 15:14:37,191 - INFO -   Description: Automatically generated API from MCP Tool Schemas
2025-08-26 15:14:37,191 - INFO -   Hostname: ML-MT9GRQ22XT
2025-08-26 15:14:37,191 - INFO -   Port: 8000
2025-08-26 15:14:37,191 - INFO -   API Key: Not Provided
2025-08-26 15:14:37,191 - INFO -   CORS Allowed Origins: ['*']
2025-08-26 15:14:37,191 - INFO -   Path Prefix: /
2025-08-26 15:14:37,191 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:37,191 - INFO - Uvicorn server starting...
INFO:     Started server process [65504]
INFO:     Waiting for application startup.
[65523] Using automatically selected callback port: 19598
[65523] [65523] Connecting to remote server: http://127.0.0.1:5000/mcp
[65523] Using transport strategy: http-first
[65523] Connected to remote server using StreamableHTTPClientTransport
[65523] Local STDIO server running
[65523] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport
[65523] Press Ctrl+C to exit
[65523] [Local→Remote] initialize
[65523] {
  "jsonrpc": "2.0",
  "id": 0,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": {
      "name": "mcp (via mcp-remote 0.1.18)",
      "version": "0.1.0"
    }
  }
}
[65523] [Remote→Local] 0
[65523] [Local→Remote] notifications/initialized
[65523] [Local→Remote] tools/list
[65523] [Remote→Local] 1
[65523]
Shutting down...
2025-08-26 15:14:37,736 - ERROR - Failed to connect to MCP server 'Apollo MCP Server': ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  + Exception Group Traceback (most recent call last):
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan
  |     async with client_context as (reader, writer, *_):
  |                ^^^^^^^^^^^^^^
  |   File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__
  |     await self.gen.athrow(value)
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client
  |     anyio.create_task_group() as tg,
  |     ~~~~~~~~~~~~~~~~~~~~~~~^^
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  |         "unhandled errors in a TaskGroup", self._exceptions
  |     ) from None
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client
    |     yield read_stream, write_stream
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan
    |     async with ClientSession(reader, writer) as session:
    |                ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__
    |     return await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
    |     raise BaseExceptionGroup(
    |         "unhandled errors in a TaskGroup", self._exceptions
    |     ) from None
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan
      |     await create_dynamic_endpoints(app, api_dependency=api_dependency)
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints
      |     form_model_fields = get_model_fields(
      |         f"{endpoint_name}_form_model",
      |     ...<2 lines>...
      |         inputSchema.get("$defs", {}),
      |     )
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields
      |     python_type_hint, pydantic_field_info = _process_schema_property(
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~~^
      |         _model_cache,
      |         ^^^^^^^^^^^^^
      |     ...<4 lines>...
      |         schema_defs,
      |         ^^^^^^^^^^^^
      |     )
      |     ^
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property
      |     assert ref in schema_defs, "Custom field not found"
      |            ^^^^^^^^^^^^^^^^^^
      | AssertionError: Custom field not found
      +------------------------------------
ERROR:      + Exception Group Traceback (most recent call last):
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/starlette/routing.py", line 694, in lifespan
  |     async with self.lifespan_context(app) as maybe_state:
  |                ~~~~~~~~~~~~~~~~~~~~~^^^^^
  |   File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 214, in __aenter__
  |     return await anext(self.gen)
  |            ^^^^^^^^^^^^^^^^^^^^^
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan
  |     async with client_context as (reader, writer, *_):
  |                ^^^^^^^^^^^^^^
  |   File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__
  |     await self.gen.athrow(value)
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client
  |     anyio.create_task_group() as tg,
  |     ~~~~~~~~~~~~~~~~~~~~~~~^^
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  |         "unhandled errors in a TaskGroup", self._exceptions
  |     ) from None
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client
    |     yield read_stream, write_stream
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan
    |     async with ClientSession(reader, writer) as session:
    |                ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__
    |     return await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
    |     raise BaseExceptionGroup(
    |         "unhandled errors in a TaskGroup", self._exceptions
    |     ) from None
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan
      |     await create_dynamic_endpoints(app, api_dependency=api_dependency)
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints
      |     form_model_fields = get_model_fields(
      |         f"{endpoint_name}_form_model",
      |     ...<2 lines>...
      |         inputSchema.get("$defs", {}),
      |     )
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields
      |     python_type_hint, pydantic_field_info = _process_schema_property(
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~~^
      |         _model_cache,
      |         ^^^^^^^^^^^^^
      |     ...<4 lines>...
      |         schema_defs,
      |         ^^^^^^^^^^^^
      |     )
      |     ^
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property
      |     assert ref in schema_defs, "Custom field not found"
      |            ^^^^^^^^^^^^^^^^^^
      | AssertionError: Custom field not found
      +------------------------------------

ERROR:    Application startup failed. Exiting.
2025-08-26 15:14:37,740 - WARNING - Server task exited unexpectedly. Initiating shutdown.
2025-08-26 15:14:37,740 - INFO - Initiating server shutdown...
2025-08-26 15:14:37,740 - INFO - Server shutdown complete```

### Steps to Reproduce

Running `mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp`

Apollo MCP server is running on 127.0.0.1:5000/mcp. It does not receive an initialization request.

### Logs & Screenshots

Proxy crashes with this error message:

```mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp
Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:37,191 - INFO - Starting MCPO Server...
2025-08-26 15:14:37,191 - INFO -   Name: MCP OpenAPI Proxy
2025-08-26 15:14:37,191 - INFO -   Version: 1.0
2025-08-26 15:14:37,191 - INFO -   Description: Automatically generated API from MCP Tool Schemas
2025-08-26 15:14:37,191 - INFO -   Hostname: ML-MT9GRQ22XT
2025-08-26 15:14:37,191 - INFO -   Port: 8000
2025-08-26 15:14:37,191 - INFO -   API Key: Not Provided
2025-08-26 15:14:37,191 - INFO -   CORS Allowed Origins: ['*']
2025-08-26 15:14:37,191 - INFO -   Path Prefix: /
2025-08-26 15:14:37,191 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:37,191 - INFO - Uvicorn server starting...
INFO:     Started server process [65504]
INFO:     Waiting for application startup.
[65523] Using automatically selected callback port: 19598
[65523] [65523] Connecting to remote server: http://127.0.0.1:5000/mcp
[65523] Using transport strategy: http-first
[65523] Connected to remote server using StreamableHTTPClientTransport
[65523] Local STDIO server running
[65523] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport
[65523] Press Ctrl+C to exit
[65523] [Local→Remote] initialize
[65523] {
  "jsonrpc": "2.0",
  "id": 0,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": {
      "name": "mcp (via mcp-remote 0.1.18)",
      "version": "0.1.0"
    }
  }
}
[65523] [Remote→Local] 0
[65523] [Local→Remote] notifications/initialized
[65523] [Local→Remote] tools/list
[65523] [Remote→Local] 1
[65523]
Shutting down...
2025-08-26 15:14:37,736 - ERROR - Failed to connect to MCP server 'Apollo MCP Server': ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  + Exception Group Traceback (most recent call last):
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan
  |     async with client_context as (reader, writer, *_):
  |                ^^^^^^^^^^^^^^
  |   File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__
  |     await self.gen.athrow(value)
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client
  |     anyio.create_task_group() as tg,
  |     ~~~~~~~~~~~~~~~~~~~~~~~^^
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  |         "unhandled errors in a TaskGroup", self._exceptions
  |     ) from None
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client
    |     yield read_stream, write_stream
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan
    |     async with ClientSession(reader, writer) as session:
    |                ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__
    |     return await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
    |     raise BaseExceptionGroup(
    |         "unhandled errors in a TaskGroup", self._exceptions
    |     ) from None
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan
      |     await create_dynamic_endpoints(app, api_dependency=api_dependency)
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints
      |     form_model_fields = get_model_fields(
      |         f"{endpoint_name}_form_model",
      |     ...<2 lines>...
      |         inputSchema.get("$defs", {}),
      |     )
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields
      |     python_type_hint, pydantic_field_info = _process_schema_property(
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~~^
      |         _model_cache,
      |         ^^^^^^^^^^^^^
      |     ...<4 lines>...
      |         schema_defs,
      |         ^^^^^^^^^^^^
      |     )
      |     ^
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property
      |     assert ref in schema_defs, "Custom field not found"
      |            ^^^^^^^^^^^^^^^^^^
      | AssertionError: Custom field not found
      +------------------------------------
ERROR:      + Exception Group Traceback (most recent call last):
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/starlette/routing.py", line 694, in lifespan
  |     async with self.lifespan_context(app) as maybe_state:
  |                ~~~~~~~~~~~~~~~~~~~~~^^^^^
  |   File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 214, in __aenter__
  |     return await anext(self.gen)
  |            ^^^^^^^^^^^^^^^^^^^^^
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan
  |     async with client_context as (reader, writer, *_):
  |                ^^^^^^^^^^^^^^
  |   File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__
  |     await self.gen.athrow(value)
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client
  |     anyio.create_task_group() as tg,
  |     ~~~~~~~~~~~~~~~~~~~~~~~^^
  |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
  |     raise BaseExceptionGroup(
  |         "unhandled errors in a TaskGroup", self._exceptions
  |     ) from None
  | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
  +-+---------------- 1 ----------------
    | Exception Group Traceback (most recent call last):
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client
    |     yield read_stream, write_stream
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan
    |     async with ClientSession(reader, writer) as session:
    |                ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__
    |     return await self._task_group.__aexit__(exc_type, exc_val, exc_tb)
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__
    |     raise BaseExceptionGroup(
    |         "unhandled errors in a TaskGroup", self._exceptions
    |     ) from None
    | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
      | Traceback (most recent call last):
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan
      |     await create_dynamic_endpoints(app, api_dependency=api_dependency)
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints
      |     form_model_fields = get_model_fields(
      |         f"{endpoint_name}_form_model",
      |     ...<2 lines>...
      |         inputSchema.get("$defs", {}),
      |     )
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields
      |     python_type_hint, pydantic_field_info = _process_schema_property(
      |                                             ~~~~~~~~~~~~~~~~~~~~~~~~^
      |         _model_cache,
      |         ^^^^^^^^^^^^^
      |     ...<4 lines>...
      |         schema_defs,
      |         ^^^^^^^^^^^^
      |     )
      |     ^
      |   File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property
      |     assert ref in schema_defs, "Custom field not found"
      |            ^^^^^^^^^^^^^^^^^^
      | AssertionError: Custom field not found
      +------------------------------------

ERROR:    Application startup failed. Exiting.
2025-08-26 15:14:37,740 - WARNING - Server task exited unexpectedly. Initiating shutdown.
2025-08-26 15:14:37,740 - INFO - Initiating server shutdown...
2025-08-26 15:14:37,740 - INFO - Server shutdown complete```

alternatively..

mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp
Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:41,672 - INFO - Starting MCPO Server...
2025-08-26 15:14:41,672 - INFO -   Name: MCP OpenAPI Proxy
2025-08-26 15:14:41,672 - INFO -   Version: 1.0
2025-08-26 15:14:41,672 - INFO -   Description: Automatically generated API from MCP Tool Schemas
2025-08-26 15:14:41,672 - INFO -   Hostname: ML-MT9GRQ22XT
2025-08-26 15:14:41,672 - INFO -   Port: 8000
2025-08-26 15:14:41,672 - INFO -   API Key: Not Provided
2025-08-26 15:14:41,672 - INFO -   CORS Allowed Origins: ['*']
2025-08-26 15:14:41,672 - INFO -   Path Prefix: /
2025-08-26 15:14:41,672 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:41,672 - INFO - Uvicorn server starting...
INFO:     Started server process [66446]
INFO:     Waiting for application startup.
[66465] Using automatically selected callback port: 19598
[66465] [66465] Connecting to remote server: http://127.0.0.1:5000/mcp
[66465] Using transport strategy: http-first
[66465] Connected to remote server using StreamableHTTPClientTransport
[66465] Local STDIO server running
[66465] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport
[66465] Press Ctrl+C to exit
[66465] [Local→Remote] initialize
[66465] {
  "jsonrpc": "2.0",
  "id": 0,
  "method": "initialize",
  "params": {
    "protocolVersion": "2025-06-18",
    "capabilities": {},
    "clientInfo": {
      "name": "mcp (via mcp-remote 0.1.18)",
      "version": "0.1.0"
    }
  }
}
[66465] [Remote→Local] 0
[66465] [Local→Remote] notifications/initialized
[66465] [Local→Remote] tools/list
[66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
    at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11)
    at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29)
    at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12)
    at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) {
  errorUri: undefined
}
[66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
    at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11)
    at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29)
    at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12)
    at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) {
  errorUri: undefined
}




### Additional Information

I get this error any time i try to restart mcpo. After that, occasionally I'll get this issue instead:

mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp
Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:41,672 - INFO - Starting MCPO Server...
2025-08-26 15:14:41,672 - INFO - Name: MCP OpenAPI Proxy
2025-08-26 15:14:41,672 - INFO - Version: 1.0
2025-08-26 15:14:41,672 - INFO - Description: Automatically generated API from MCP Tool Schemas
2025-08-26 15:14:41,672 - INFO - Hostname: ML-MT9GRQ22XT
2025-08-26 15:14:41,672 - INFO - Port: 8000
2025-08-26 15:14:41,672 - INFO - API Key: Not Provided
2025-08-26 15:14:41,672 - INFO - CORS Allowed Origins: ['*']
2025-08-26 15:14:41,672 - INFO - Path Prefix: /
2025-08-26 15:14:41,672 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp
2025-08-26 15:14:41,672 - INFO - Uvicorn server starting...
INFO: Started server process [66446]
INFO: Waiting for application startup.
[66465] Using automatically selected callback port: 19598
[66465] [66465] Connecting to remote server: http://127.0.0.1:5000/mcp
[66465] Using transport strategy: http-first
[66465] Connected to remote server using StreamableHTTPClientTransport
[66465] Local STDIO server running
[66465] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport
[66465] Press Ctrl+C to exit
[66465] [Local→Remote] initialize
[66465] {
"jsonrpc": "2.0",
"id": 0,
"method": "initialize",
"params": {
"protocolVersion": "2025-06-18",
"capabilities": {},
"clientInfo": {
"name": "mcp (via mcp-remote 0.1.18)",
"version": "0.1.0"
}
}
}
[66465] [Remote→Local] 0
[66465] [Local→Remote] notifications/initialized
[66465] [Local→Remote] tools/list
[66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11)
at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29)
at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12)
at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) {
errorUri: undefined
}
[66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body:
at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12)
at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11)
at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29)
at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12)
at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) {
errorUri: undefined
}


During which, the Apollo MCP server does receive an initialization request but fails to process it.
Originally created by @mekhami on GitHub (Aug 26, 2025). Original GitHub issue: https://github.com/open-webui/mcpo/issues/239 Originally assigned to: @taylorwilsdon on GitHub. ### 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.17 ### Open WebUI Version (if applicable) _No response_ ### Operating System MacOS Sonoma ### 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 Proxy should launch ### Actual Behavior Proxy crashes with this error message: ```mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:37,191 - INFO - Starting MCPO Server... 2025-08-26 15:14:37,191 - INFO - Name: MCP OpenAPI Proxy 2025-08-26 15:14:37,191 - INFO - Version: 1.0 2025-08-26 15:14:37,191 - INFO - Description: Automatically generated API from MCP Tool Schemas 2025-08-26 15:14:37,191 - INFO - Hostname: ML-MT9GRQ22XT 2025-08-26 15:14:37,191 - INFO - Port: 8000 2025-08-26 15:14:37,191 - INFO - API Key: Not Provided 2025-08-26 15:14:37,191 - INFO - CORS Allowed Origins: ['*'] 2025-08-26 15:14:37,191 - INFO - Path Prefix: / 2025-08-26 15:14:37,191 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:37,191 - INFO - Uvicorn server starting... INFO: Started server process [65504] INFO: Waiting for application startup. [65523] Using automatically selected callback port: 19598 [65523] [65523] Connecting to remote server: http://127.0.0.1:5000/mcp [65523] Using transport strategy: http-first [65523] Connected to remote server using StreamableHTTPClientTransport [65523] Local STDIO server running [65523] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport [65523] Press Ctrl+C to exit [65523] [Local→Remote] initialize [65523] { "jsonrpc": "2.0", "id": 0, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": { "name": "mcp (via mcp-remote 0.1.18)", "version": "0.1.0" } } } [65523] [Remote→Local] 0 [65523] [Local→Remote] notifications/initialized [65523] [Local→Remote] tools/list [65523] [Remote→Local] 1 [65523] Shutting down... 2025-08-26 15:14:37,736 - ERROR - Failed to connect to MCP server 'Apollo MCP Server': ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan | async with client_context as (reader, writer, *_): | ^^^^^^^^^^^^^^ | File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__ | await self.gen.athrow(value) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client | anyio.create_task_group() as tg, | ~~~~~~~~~~~~~~~~~~~~~~~^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client | yield read_stream, write_stream | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan | async with ClientSession(reader, writer) as session: | ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__ | return await self._task_group.__aexit__(exc_type, exc_val, exc_tb) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan | await create_dynamic_endpoints(app, api_dependency=api_dependency) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints | form_model_fields = get_model_fields( | f"{endpoint_name}_form_model", | ...<2 lines>... | inputSchema.get("$defs", {}), | ) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields | python_type_hint, pydantic_field_info = _process_schema_property( | ~~~~~~~~~~~~~~~~~~~~~~~~^ | _model_cache, | ^^^^^^^^^^^^^ | ...<4 lines>... | schema_defs, | ^^^^^^^^^^^^ | ) | ^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property | assert ref in schema_defs, "Custom field not found" | ^^^^^^^^^^^^^^^^^^ | AssertionError: Custom field not found +------------------------------------ ERROR: + Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/starlette/routing.py", line 694, in lifespan | async with self.lifespan_context(app) as maybe_state: | ~~~~~~~~~~~~~~~~~~~~~^^^^^ | File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 214, in __aenter__ | return await anext(self.gen) | ^^^^^^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan | async with client_context as (reader, writer, *_): | ^^^^^^^^^^^^^^ | File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__ | await self.gen.athrow(value) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client | anyio.create_task_group() as tg, | ~~~~~~~~~~~~~~~~~~~~~~~^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client | yield read_stream, write_stream | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan | async with ClientSession(reader, writer) as session: | ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__ | return await self._task_group.__aexit__(exc_type, exc_val, exc_tb) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan | await create_dynamic_endpoints(app, api_dependency=api_dependency) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints | form_model_fields = get_model_fields( | f"{endpoint_name}_form_model", | ...<2 lines>... | inputSchema.get("$defs", {}), | ) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields | python_type_hint, pydantic_field_info = _process_schema_property( | ~~~~~~~~~~~~~~~~~~~~~~~~^ | _model_cache, | ^^^^^^^^^^^^^ | ...<4 lines>... | schema_defs, | ^^^^^^^^^^^^ | ) | ^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property | assert ref in schema_defs, "Custom field not found" | ^^^^^^^^^^^^^^^^^^ | AssertionError: Custom field not found +------------------------------------ ERROR: Application startup failed. Exiting. 2025-08-26 15:14:37,740 - WARNING - Server task exited unexpectedly. Initiating shutdown. 2025-08-26 15:14:37,740 - INFO - Initiating server shutdown... 2025-08-26 15:14:37,740 - INFO - Server shutdown complete``` ### Steps to Reproduce Running `mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp` Apollo MCP server is running on 127.0.0.1:5000/mcp. It does not receive an initialization request. ### Logs & Screenshots Proxy crashes with this error message: ```mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:37,191 - INFO - Starting MCPO Server... 2025-08-26 15:14:37,191 - INFO - Name: MCP OpenAPI Proxy 2025-08-26 15:14:37,191 - INFO - Version: 1.0 2025-08-26 15:14:37,191 - INFO - Description: Automatically generated API from MCP Tool Schemas 2025-08-26 15:14:37,191 - INFO - Hostname: ML-MT9GRQ22XT 2025-08-26 15:14:37,191 - INFO - Port: 8000 2025-08-26 15:14:37,191 - INFO - API Key: Not Provided 2025-08-26 15:14:37,191 - INFO - CORS Allowed Origins: ['*'] 2025-08-26 15:14:37,191 - INFO - Path Prefix: / 2025-08-26 15:14:37,191 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:37,191 - INFO - Uvicorn server starting... INFO: Started server process [65504] INFO: Waiting for application startup. [65523] Using automatically selected callback port: 19598 [65523] [65523] Connecting to remote server: http://127.0.0.1:5000/mcp [65523] Using transport strategy: http-first [65523] Connected to remote server using StreamableHTTPClientTransport [65523] Local STDIO server running [65523] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport [65523] Press Ctrl+C to exit [65523] [Local→Remote] initialize [65523] { "jsonrpc": "2.0", "id": 0, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": { "name": "mcp (via mcp-remote 0.1.18)", "version": "0.1.0" } } } [65523] [Remote→Local] 0 [65523] [Local→Remote] notifications/initialized [65523] [Local→Remote] tools/list [65523] [Remote→Local] 1 [65523] Shutting down... 2025-08-26 15:14:37,736 - ERROR - Failed to connect to MCP server 'Apollo MCP Server': ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) + Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan | async with client_context as (reader, writer, *_): | ^^^^^^^^^^^^^^ | File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__ | await self.gen.athrow(value) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client | anyio.create_task_group() as tg, | ~~~~~~~~~~~~~~~~~~~~~~~^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client | yield read_stream, write_stream | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan | async with ClientSession(reader, writer) as session: | ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__ | return await self._task_group.__aexit__(exc_type, exc_val, exc_tb) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan | await create_dynamic_endpoints(app, api_dependency=api_dependency) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints | form_model_fields = get_model_fields( | f"{endpoint_name}_form_model", | ...<2 lines>... | inputSchema.get("$defs", {}), | ) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields | python_type_hint, pydantic_field_info = _process_schema_property( | ~~~~~~~~~~~~~~~~~~~~~~~~^ | _model_cache, | ^^^^^^^^^^^^^ | ...<4 lines>... | schema_defs, | ^^^^^^^^^^^^ | ) | ^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property | assert ref in schema_defs, "Custom field not found" | ^^^^^^^^^^^^^^^^^^ | AssertionError: Custom field not found +------------------------------------ ERROR: + Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/starlette/routing.py", line 694, in lifespan | async with self.lifespan_context(app) as maybe_state: | ~~~~~~~~~~~~~~~~~~~~~^^^^^ | File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 214, in __aenter__ | return await anext(self.gen) | ^^^^^^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 422, in lifespan | async with client_context as (reader, writer, *_): | ^^^^^^^^^^^^^^ | File "/opt/homebrew/Cellar/python@3.13/3.13.3/Frameworks/Python.framework/Versions/3.13/lib/python3.13/contextlib.py", line 235, in __aexit__ | await self.gen.athrow(value) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 181, in stdio_client | anyio.create_task_group() as tg, | ~~~~~~~~~~~~~~~~~~~~~~~^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Exception Group Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/client/stdio/__init__.py", line 187, in stdio_client | yield read_stream, write_stream | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 423, in lifespan | async with ClientSession(reader, writer) as session: | ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcp/shared/session.py", line 218, in __aexit__ | return await self._task_group.__aexit__(exc_type, exc_val, exc_tb) | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/anyio/_backends/_asyncio.py", line 772, in __aexit__ | raise BaseExceptionGroup( | "unhandled errors in a TaskGroup", self._exceptions | ) from None | ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception) +-+---------------- 1 ---------------- | Traceback (most recent call last): | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 425, in lifespan | await create_dynamic_endpoints(app, api_dependency=api_dependency) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/main.py", line 281, in create_dynamic_endpoints | form_model_fields = get_model_fields( | f"{endpoint_name}_form_model", | ...<2 lines>... | inputSchema.get("$defs", {}), | ) | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 242, in get_model_fields | python_type_hint, pydantic_field_info = _process_schema_property( | ~~~~~~~~~~~~~~~~~~~~~~~~^ | _model_cache, | ^^^^^^^^^^^^^ | ...<4 lines>... | schema_defs, | ^^^^^^^^^^^^ | ) | ^ | File "/Users/v507614/.local/pipx/venvs/mcpo/lib/python3.13/site-packages/mcpo/utils/main.py", line 117, in _process_schema_property | assert ref in schema_defs, "Custom field not found" | ^^^^^^^^^^^^^^^^^^ | AssertionError: Custom field not found +------------------------------------ ERROR: Application startup failed. Exiting. 2025-08-26 15:14:37,740 - WARNING - Server task exited unexpectedly. Initiating shutdown. 2025-08-26 15:14:37,740 - INFO - Initiating server shutdown... 2025-08-26 15:14:37,740 - INFO - Server shutdown complete``` alternatively.. mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:41,672 - INFO - Starting MCPO Server... 2025-08-26 15:14:41,672 - INFO - Name: MCP OpenAPI Proxy 2025-08-26 15:14:41,672 - INFO - Version: 1.0 2025-08-26 15:14:41,672 - INFO - Description: Automatically generated API from MCP Tool Schemas 2025-08-26 15:14:41,672 - INFO - Hostname: ML-MT9GRQ22XT 2025-08-26 15:14:41,672 - INFO - Port: 8000 2025-08-26 15:14:41,672 - INFO - API Key: Not Provided 2025-08-26 15:14:41,672 - INFO - CORS Allowed Origins: ['*'] 2025-08-26 15:14:41,672 - INFO - Path Prefix: / 2025-08-26 15:14:41,672 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:41,672 - INFO - Uvicorn server starting... INFO: Started server process [66446] INFO: Waiting for application startup. [66465] Using automatically selected callback port: 19598 [66465] [66465] Connecting to remote server: http://127.0.0.1:5000/mcp [66465] Using transport strategy: http-first [66465] Connected to remote server using StreamableHTTPClientTransport [66465] Local STDIO server running [66465] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport [66465] Press Ctrl+C to exit [66465] [Local→Remote] initialize [66465] { "jsonrpc": "2.0", "id": 0, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": { "name": "mcp (via mcp-remote 0.1.18)", "version": "0.1.0" } } } [66465] [Remote→Local] 0 [66465] [Local→Remote] notifications/initialized [66465] [Local→Remote] tools/list [66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body: at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11) at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29) at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12) at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) { errorUri: undefined } [66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body: at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11) at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29) at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12) at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) { errorUri: undefined } ### Additional Information I get this error any time i try to restart mcpo. After that, occasionally I'll get this issue instead: ``` mcpo --port 8000 -- npx mcp-remote http://127.0.0.1:5000/mcp Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:41,672 - INFO - Starting MCPO Server... 2025-08-26 15:14:41,672 - INFO - Name: MCP OpenAPI Proxy 2025-08-26 15:14:41,672 - INFO - Version: 1.0 2025-08-26 15:14:41,672 - INFO - Description: Automatically generated API from MCP Tool Schemas 2025-08-26 15:14:41,672 - INFO - Hostname: ML-MT9GRQ22XT 2025-08-26 15:14:41,672 - INFO - Port: 8000 2025-08-26 15:14:41,672 - INFO - API Key: Not Provided 2025-08-26 15:14:41,672 - INFO - CORS Allowed Origins: ['*'] 2025-08-26 15:14:41,672 - INFO - Path Prefix: / 2025-08-26 15:14:41,672 - INFO - Configuring for a single Stdio MCP Server with command: npx mcp-remote http://127.0.0.1:5000/mcp 2025-08-26 15:14:41,672 - INFO - Uvicorn server starting... INFO: Started server process [66446] INFO: Waiting for application startup. [66465] Using automatically selected callback port: 19598 [66465] [66465] Connecting to remote server: http://127.0.0.1:5000/mcp [66465] Using transport strategy: http-first [66465] Connected to remote server using StreamableHTTPClientTransport [66465] Local STDIO server running [66465] Proxy established successfully between local STDIO and remote StreamableHTTPClientTransport [66465] Press Ctrl+C to exit [66465] [Local→Remote] initialize [66465] { "jsonrpc": "2.0", "id": 0, "method": "initialize", "params": { "protocolVersion": "2025-06-18", "capabilities": {}, "clientInfo": { "name": "mcp (via mcp-remote 0.1.18)", "version": "0.1.0" } } } [66465] [Remote→Local] 0 [66465] [Local→Remote] notifications/initialized [66465] [Local→Remote] tools/list [66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body: at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11) at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29) at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12) at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) { errorUri: undefined } [66465] Error from remote server: ServerError: HTTP 404: Invalid OAuth error response: SyntaxError: Unexpected end of JSON input. Raw body: at parseErrorResponse (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12094:12) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async registerClient (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12417:11) at async authInternal (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12132:29) at async auth (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:12100:12) at async StreamableHTTPClientTransport.send (file:///Users/v507614/.npm/_npx/705d23756ff7dacc/node_modules/mcp-remote/dist/chunk-OXNXVROF.js:13259:26) { errorUri: undefined } ``` During which, the Apollo MCP server does receive an initialization request but fails to process it.
Author
Owner

@mekhami commented on GitHub (Aug 26, 2025):

I should also mention that the command npx mcp-remote 127.0.0.1:5000/mcp run independently is successful, and MCP Inspector is able to connect to that tool server and works correctly.

<!-- gh-comment-id:3225611443 --> @mekhami commented on GitHub (Aug 26, 2025): I should also mention that the command `npx mcp-remote 127.0.0.1:5000/mcp` run independently is successful, and MCP Inspector is able to connect to that tool server and works correctly.
Author
Owner

@mekhami commented on GitHub (Aug 28, 2025):

This may be a duplicate of https://github.com/open-webui/mcpo/issues/117

Downgrading to 0.0.12 as suggested did resolve the issue

<!-- gh-comment-id:3234887785 --> @mekhami commented on GitHub (Aug 28, 2025): This may be a duplicate of https://github.com/open-webui/mcpo/issues/117 Downgrading to 0.0.12 as suggested did resolve the issue
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#106
No description provided.