mirror of
https://github.com/open-webui/mcpo.git
synced 2026-11-05 01:27:39 +00:00
[GH-ISSUE #186] issue: fastapi exception - "Input should be a dictionary or object to extract fields from' #86
Labels
No labels
bug
can't reproduce
documentation
enhancement
good first issue
help wanted
invalid
pull-request
question
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
open-webui/mcpo#86
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @joswr1ght on GitHub (Jun 27, 2025).
Original GitHub issue: https://github.com/open-webui/mcpo/issues/186
Check Existing Issues
mcpo Version
GitHub HEAD 2025-06-27
Open WebUI Version (if applicable)
0.6.15
Operating System
Docker python3.12-slim-bookworm
Browser (if applicable)
Ubuntu Firefox 139.0.4
Confirmation
README.md.Expected Behavior
I'm using MCPO to integrate the MetasploitMCP project with OpenWebUI. MCPO raises an exception when it gets a response from MetasploitMCP. I expected OpenWebUI to use the response from MCPO in the response prompt.
Actual Behavior
I'm using MCPO to integrate the MetasploitMCP project with OpenWebUI. MCPO raises an exception when it gets a response from MetasploitMCP:
MetasploitMCPreturns a list using the Python FastMCP in a normal way.
I'm running MCPO using the supplied
Dockerfilewithpython:3.12-slim-bookworm. I can see the prompt hit OpenWebUI, get forwarded to MCPO, then sent to MetasploitMCP:I'm not sure why MCPO isn't handling the response and returns a 500 error to OpenWebUI.
Browser console:
Steps to Reproduce
Start MetasploitMCP:
Start MCPO:
Add tool to OpenWebUI:
Observe tool request in MetasploitMCP:
Observe exception in MCPO:
Logs & Screenshots
full-mcpo-exception.txt
Additional Information
No response
@evcharger commented on GitHub (Jun 28, 2025):
I have exactly the same error when running excel-mcp-server . I have tried both sse and stdio and it produces the same error, but this error did not appear last week, so some recent changes might be causing it.
@eagle705 commented on GitHub (Jun 30, 2025):
I encountered the same issue. Is there a workaround?
@tjbck commented on GitHub (Jun 30, 2025):
Were you able to make sure everything works as intended by directly interacting with the endpoints via swagger docs?
@evcharger commented on GitHub (Jun 30, 2025):
This issue happens with some mcp servers, not all. In my case it is one out of 8.
@joswr1ght commented on GitHub (Jun 30, 2025):
@tjbck When I navigate to the mcpo server /docs/ page I get the endpoint list. When I execute one of the endpoints, the FastMCP server (MetasploitMCP) console indicates that it received the request and responds with data, but mcpo raises an exception error (detailed above and summarized here). The /docs page shows the HTTP/500 error (see screenshots).
MetasploitMCP (with some extra debugging I added):
MCPO:
The error from MCPO indicates that it is expecting a dictionary but it's getting a list. Is this not a valid response from MetasploitMPC?
Thanks!
@joswr1ght commented on GitHub (Jun 30, 2025):
I know this isn't a magic confirmation of where the issue is between the OpenWebUI client, the MCPO proxy, and the MCP server, but the MetasploitMCP server works fine with Claude Desktop.
@tpdns90321 commented on GitHub (Jul 1, 2025):
I found cause of this error. But, this is not problem of mcp servers. This is just mcpo's type handling problem.
When MCPO get single response from mcp server, mcpo translate to single string object. But, MCPO or FastAPI Type want it is dictionary. So, simple solution is that code modifying every “final_response” in ‘src/mcpo/utils/main.py’.
@tpdns90321 commented on GitHub (Jul 1, 2025):
I tested this solution by mcp-youtube-transcript(this is error like metasploit mcp above case) and puppeteer-server(normal).
@DeltaWhy commented on GitHub (Jul 1, 2025):
I am seeing this issue on an MCP server I'm developing, but only on some tools. What's odd is all my tools return strings (not JSON), but some work while others don't.
@tpdns90321 commented on GitHub (Jul 1, 2025):
@tpdns90321 commented on GitHub (Jul 1, 2025):
Add log when using other member name.
PS. I don't know why MCPO or FastAPI need dictionary that contain "result" member parameter.
@joswr1ght commented on GitHub (Jul 1, 2025):
@tpdns90321 I'm still getting an error when I use your fork and branch:
Is this a problem with fastapi and not mcpo? Thanks for taking a look!
@tpdns90321 commented on GitHub (Jul 2, 2025):
This problem not just affected to single string object, maybe this problem caused between MCPO and server implement of Python's FastMCP?
Same things between mcp-youtube-transcript(i used) and MetasploitMCP are:
@tpdns90321 commented on GitHub (Jul 2, 2025):
I push commit that modified entire final_response to wrapped dictionary, to my fork repository.
@tjbck commented on GitHub (Jul 2, 2025):
@tpdns90321 might've been addressed with
a5f62225fdin dev, testing wanted here!@tpdns90321 commented on GitHub (Jul 2, 2025):
Working well! Thanks! Good method for non-modifying response data.
@tjbck commented on GitHub (Jul 2, 2025):
Thanks for the confirmation, 0.0.16 will be released shortly!