problems when trying to connect Open Web UI, MCPO and MCP #190
Replies: 3 comments
-
|
thank you very much for your answer. i had to do that and a few other things and i was able to get it working. |
Beta Was this translation helpful? Give feedback.
-
|
This is really a pain point for me. Most of my MCP tool calls fall apart on schema failures or missing/malformed arguments. I can get them to work with Goose and Continue when I use them directly, but there seems to be too much signal loss going from MCP to OpenAPI to OpenWebUI. I got around the return type by just returning markdown blobs and let the LLM figure it out. Arguments are proving more difficult. Is there a way to improve this without having it pass in a single string? Most off the shelf servers don't work, but I do have the luxury of this being my own so I can make changes. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi everyone!
I'm getting an error when I want to connect a MCP to Open Web UI.
The MCPO package expects a "perfect" schema, but some MCPs (especially modern ones) may have complex references or types, or not comply with MCPO checks.
Is it possible for MCPO to correct your code to not look for $def or, in general, to support the way the SDK creates the schema ?
Example of how mcpo probably wants it:
{
"type": "object",
"properties": {
"to": {
"$ref": "#/$defs/EmailAddress"
},
"from": {
"$ref": "#/$defs/EmailAddress"
}
},
"$defs": {
"emailAddress": {
"type": "object",
"properties": {
"address": { "type": "string" },
"name": { "type": "string" }
}
}
}
}
What the MCP SDK does:
{
"properties": { {
"ccRecipients": { {
"items": {
"$ref": "#/properties/body/anyOf/1/properties/Message/properties/bccRecipients/items"
}
},
"bccRecipients": {
"items": {
"type": "object",
"properties": { /* actual definition here */ }
}
}
}
}
I share with you the code with error:
metis@metis:~/openwebui-stack/ms-365-mcp-server$ mcpo --host 0.0.0.0 --port 8002 -- node /home/metis/openwebui-stack/ms-365-mcp-server/dist/index.js
Starting MCP OpenAPI Proxy on 0.0.0.0:8002 with command: node /home/metis/openwebui-stack/ms-365-mcp-server/dist/index.js
2025-07-03 03:58:55,256 - INFO - Starting MCPO Server...
2025-07-03 03:58:55,257 - INFO - Name: MCP OpenAPI Proxy
2025-07-03 03:58:55,257 - INFO - Version: 1.0
2025-07-03 03:58:55,258 - INFO - Description: Automatically generated API from MCP Tool Schemas
2025-07-03 03:58:55,258 - INFO - Hostname: metis
2025-07-03 03:58:55,258 - INFO - Port: 8002
2025-07-03 03:58:55,259 - INFO - API Key: Not Provided
2025-07-03 03:58:55,259 - INFO - CORS Allowed Origins: ['*']
2025-07-03 03:58:55,259 - INFO - Path Prefix: /
2025-07-03 03:58:55,264 - INFO - Configuring for a single Stdio MCP Server with command: node /home/metis/openwebui-stack/ms-365-mcp-server/dist/index.js
2025-07-03 03:58:55,264 - INFO - Uvicorn server starting...
INFO: Started server process [3242265]
INFO: Waiting for application startup.
ERROR: + Exception Group Traceback (most recent call last):
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/starlette/routing.py", line 692, in lifespan
| async with self.lifespan_context(app) as maybe_state:
| File "/usr/lib/python3.12/contextlib.py", line 210, in aenter
| return await anext(self.gen)
| ^^^^^^^^^^^^^^^^^^^^^
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/main.py", line 113, in lifespan
| async with stdio_client(server_params) as (reader, writer):
| File "/usr/lib/python3.12/contextlib.py", line 231, in aexit
| await self.gen.athrow(value)
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcp/client/stdio/init.py", line 172, in stdio_client
| async with (
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 772, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Exception Group Traceback (most recent call last):
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcp/client/stdio/init.py", line 179, in stdio_client
| yield read_stream, write_stream
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/main.py", line 114, in lifespan
| async with ClientSession(reader, writer) as session:
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcp/shared/session.py", line 218, in aexit
| return await self._task_group.aexit(exc_type, exc_val, exc_tb)
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 772, in aexit
| raise BaseExceptionGroup(
| ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
+-+---------------- 1 ----------------
| Traceback (most recent call last):
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/main.py", line 116, in lifespan
| await create_dynamic_endpoints(app, api_dependency=api_dependency)
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/main.py", line 52, in create_dynamic_endpoints
| form_model_fields = get_model_fields(
| ^^^^^^^^^^^^^^^^^
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/utils/main.py", line 236, in get_model_fields
| python_type_hint, pydantic_field_info = _process_schema_property(
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/utils/main.py", line 126, in _process_schema_property
| type_hint, _ = _process_schema_property(
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/utils/main.py", line 166, in _process_schema_property
| nested_type_hint, nested_pydantic_field = _process_schema_property(
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/utils/main.py", line 166, in _process_schema_property
| nested_type_hint, nested_pydantic_field = _process_schema_property(
| ^^^^^^^^^^^^^^^^^^^^^^^^^
| File "/home/metis/venv-mcpo/lib/python3.12/site-packages/mcpo/utils/main.py", line 112, in _process_schema_property
| assert ref in schema_defs, "Custom field not found"
| ^^^^^^^^^^^^^^^^^^
| TypeError: argument of type 'NoneType' is not iterable
+------------------------------------
ERROR: Application startup failed. Exiting.
Beta Was this translation helpful? Give feedback.
All reactions