[GH-ISSUE #186] issue: fastapi exception - "Input should be a dictionary or object to extract fields from' #86

Closed
opened 2026-10-18 21:11:31 +00:00 by bsakaguchi · 17 comments
Owner

Originally created by @joswr1ght on GitHub (Jun 27, 2025).
Original GitHub issue: https://github.com/open-webui/mcpo/issues/186

Check Existing Issues

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

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

  • 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

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.

Image

Actual Behavior

I'm using MCPO to integrate the MetasploitMCP project with OpenWebUI. MCPO raises an exception when it gets a response from MetasploitMCP:

INFO:     127.0.0.1:53648 - "OPTIONS /list_exploits HTTP/1.1" 200 OK
Calling endpoint: list_exploits, with args: {'search_term': 'ssh_erlangotp_rce'}
2025-06-27 18:01:14,231 - INFO - HTTP Request: POST http://127.0.0.1:8085/messages/?session_id=1d6b1d027769486bb4782a72dd80f5bf "HTTP/1.1 202 Accepted"
INFO:     127.0.0.1:53648 - "POST /list_exploits HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  File "/app/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
  File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 327, in app
    content = await serialize_response(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 176, in serialize_response
    raise ResponseValidationError(
fastapi.exceptions.ResponseValidationError: 1 validation errors:
  {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': 'linux/ssh/ssh_erlangotp_rce'}

MetasploitMCPreturns a list using the Python FastMCP in a normal way.

I'm running MCPO using the supplied Dockerfile with python:3.12-slim-bookworm. I can see the prompt hit OpenWebUI, get forwarded to MCPO, then sent to MetasploitMCP:

INFO:     127.0.0.1:52306 - "POST /messages/?session_id=1d6b1d027769486bb4782a72dd80f5bf HTTP/1.1" 202 Accepted
2025-06-27 18:01:14,231 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest
2025-06-27 18:01:14,231 - metasploit_mcp_server - INFO - Listing exploits (search term: 'ssh_erlangotp_rce')
2025-06-27 18:01:14,235 - metasploit_mcp_server - INFO - Found 1 exploits matching 'ssh_erlangotp_rce'. Returning max 200.
2025-06-27 18:01:31,163 - metasploit_mcp_server - INFO - SSE connection closed from 127.0.0.1:52270

I'm not sure why MCPO isn't handling the response and returns a 500 error to OpenWebUI.

Browser console:

API Request Error: HTTP error! Status: 500. Message: {"detail":{"message":"Unexpected error","error":""}} index.ts:477:10
    Ns index.ts:477

Steps to Reproduce

Start MetasploitMCP:

$ msfrpcd -P password -S -a 127.0.0.1 55553 -f
$ cat Dockerfile
FROM alpine:3.20

# Install dependencies
RUN apk add --no-cache python3 py3-pip git

# Create a working directory
WORKDIR /opt

# Clone the vibehacker_metasploit_mcp repository
RUN git clone https://github.com/foolsec/vibehacker_metasploit_mcp.git

WORKDIR /opt/vibehacker_metasploit_mcp

# Install Python dependencies (the repo does not provide requirements.txt; install msfrpc and colorama)
RUN pip install --no-cache-dir msfrpc colorama

# By default, launch an interactive shell to run the script manually
CMD ["python3", "MetasploitMCP.py"]
$ docker build -t metasploitmcp
$ docker run --network=host --rm -it -h metasploitmcp -e MSF_PASSWORD=password -e MSF_SERVER=127.0.0.1 -e MSF_PORT=55553 -e MSF_SSL=false -e PAYLOAD_SAVE_DIR=/tmp metasploitmcp

Start MCPO:

$ git clone https://github.com/open-webui/mcpo
$ docker build -t mcpo .
$ docker run --network=host -it -h mcpo --rm mcpo --port 8000 --server-type "sse" -- http://127.0.0.1:8085/sse

Add tool to OpenWebUI:

Image

Observe tool request in MetasploitMCP:

025-06-27 18:01:14,230 - metasploit_mcp_server - INFO - Received POST message from 127.0.0.1:52306
INFO:     127.0.0.1:52306 - "POST /messages/?session_id=1d6b1d027769486bb4782a72dd80f5bf HTTP/1.1" 202 Accepted
2025-06-27 18:01:14,231 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest
2025-06-27 18:01:14,231 - metasploit_mcp_server - INFO - Listing exploits (search term: 'ssh_erlangotp_rce')
2025-06-27 18:01:14,235 - metasploit_mcp_server - INFO - Found 1 exploits matching 'ssh_erlangotp_rce'. Returning max 200.
2025-06-27 18:01:31,163 - metasploit_mcp_server - INFO - SSE connection closed from 127.0.0.1:52270

Observe exception in MCPO:

  File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
    await app(scope, receive, sender)
  File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 73, in app
    response = await f(request)
               ^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 327, in app
    content = await serialize_response(
              ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 176, in serialize_response
    raise ResponseValidationError(
fastapi.exceptions.ResponseValidationError: 1 validation errors:
  {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': []}

Logs & Screenshots

full-mcpo-exception.txt

Additional Information

No response

Originally created by @joswr1ght on GitHub (Jun 27, 2025). Original GitHub issue: https://github.com/open-webui/mcpo/issues/186 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of mcpo. ### 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 - [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 I'm using MCPO to integrate the [MetasploitMCP](https://github.com/GH05TCREW/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. ![Image](https://github.com/user-attachments/assets/85326889-1bba-48a9-8043-e74ee351c6fa) ### Actual Behavior I'm using MCPO to integrate the [MetasploitMCP](https://github.com/GH05TCREW/MetasploitMCP) project with OpenWebUI. MCPO raises an exception when it gets a response from MetasploitMCP: ``` INFO: 127.0.0.1:53648 - "OPTIONS /list_exploits HTTP/1.1" 200 OK Calling endpoint: list_exploits, with args: {'search_term': 'ssh_erlangotp_rce'} 2025-06-27 18:01:14,231 - INFO - HTTP Request: POST http://127.0.0.1:8085/messages/?session_id=1d6b1d027769486bb4782a72dd80f5bf "HTTP/1.1 202 Accepted" INFO: 127.0.0.1:53648 - "POST /list_exploits HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 403, in run_asgi result = await app( # type: ignore[func-returns-value] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ... File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 327, in app content = await serialize_response( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 176, in serialize_response raise ResponseValidationError( fastapi.exceptions.ResponseValidationError: 1 validation errors: {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': 'linux/ssh/ssh_erlangotp_rce'} ``` MetasploitMCPreturns a list using the Python FastMCP in a [normal way](https://github.com/GH05TCREW/MetasploitMCP/blob/c24a645195f69e7f03d0de461f8984b284faf2cf/MetasploitMCP.py#L579). I'm running MCPO using the supplied `Dockerfile` with `python:3.12-slim-bookworm`. I can see the prompt hit OpenWebUI, get forwarded to MCPO, then sent to MetasploitMCP: ``` INFO: 127.0.0.1:52306 - "POST /messages/?session_id=1d6b1d027769486bb4782a72dd80f5bf HTTP/1.1" 202 Accepted 2025-06-27 18:01:14,231 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest 2025-06-27 18:01:14,231 - metasploit_mcp_server - INFO - Listing exploits (search term: 'ssh_erlangotp_rce') 2025-06-27 18:01:14,235 - metasploit_mcp_server - INFO - Found 1 exploits matching 'ssh_erlangotp_rce'. Returning max 200. 2025-06-27 18:01:31,163 - metasploit_mcp_server - INFO - SSE connection closed from 127.0.0.1:52270 ``` I'm not sure why MCPO isn't handling the response and returns a 500 error to OpenWebUI. Browser console: ``` API Request Error: HTTP error! Status: 500. Message: {"detail":{"message":"Unexpected error","error":""}} index.ts:477:10 Ns index.ts:477 ``` ### Steps to Reproduce Start MetasploitMCP: ``` $ msfrpcd -P password -S -a 127.0.0.1 55553 -f $ cat Dockerfile FROM alpine:3.20 # Install dependencies RUN apk add --no-cache python3 py3-pip git # Create a working directory WORKDIR /opt # Clone the vibehacker_metasploit_mcp repository RUN git clone https://github.com/foolsec/vibehacker_metasploit_mcp.git WORKDIR /opt/vibehacker_metasploit_mcp # Install Python dependencies (the repo does not provide requirements.txt; install msfrpc and colorama) RUN pip install --no-cache-dir msfrpc colorama # By default, launch an interactive shell to run the script manually CMD ["python3", "MetasploitMCP.py"] $ docker build -t metasploitmcp $ docker run --network=host --rm -it -h metasploitmcp -e MSF_PASSWORD=password -e MSF_SERVER=127.0.0.1 -e MSF_PORT=55553 -e MSF_SSL=false -e PAYLOAD_SAVE_DIR=/tmp metasploitmcp ``` Start MCPO: ``` $ git clone https://github.com/open-webui/mcpo $ docker build -t mcpo . $ docker run --network=host -it -h mcpo --rm mcpo --port 8000 --server-type "sse" -- http://127.0.0.1:8085/sse ``` Add tool to OpenWebUI: ![Image](https://github.com/user-attachments/assets/67d1a982-937d-4f6c-8b7b-bd35c5942522) Observe tool request in MetasploitMCP: ``` 025-06-27 18:01:14,230 - metasploit_mcp_server - INFO - Received POST message from 127.0.0.1:52306 INFO: 127.0.0.1:52306 - "POST /messages/?session_id=1d6b1d027769486bb4782a72dd80f5bf HTTP/1.1" 202 Accepted 2025-06-27 18:01:14,231 - mcp.server.lowlevel.server - INFO - Processing request of type CallToolRequest 2025-06-27 18:01:14,231 - metasploit_mcp_server - INFO - Listing exploits (search term: 'ssh_erlangotp_rce') 2025-06-27 18:01:14,235 - metasploit_mcp_server - INFO - Found 1 exploits matching 'ssh_erlangotp_rce'. Returning max 200. 2025-06-27 18:01:31,163 - metasploit_mcp_server - INFO - SSE connection closed from 127.0.0.1:52270 ``` Observe exception in MCPO: ``` File "/app/.venv/lib/python3.11/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app await app(scope, receive, sender) File "/app/.venv/lib/python3.11/site-packages/starlette/routing.py", line 73, in app response = await f(request) ^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 327, in app content = await serialize_response( ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/fastapi/routing.py", line 176, in serialize_response raise ResponseValidationError( fastapi.exceptions.ResponseValidationError: 1 validation errors: {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': []} ``` ### Logs & Screenshots [full-mcpo-exception.txt](https://github.com/user-attachments/files/20953704/full-mcpo-exception.txt) ### Additional Information _No response_
bsakaguchi 2026-10-18 21:11:31 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@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.

<!-- gh-comment-id:3015226181 --> @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.
Author
Owner

@eagle705 commented on GitHub (Jun 30, 2025):

I encountered the same issue. Is there a workaround?

<!-- gh-comment-id:3017806327 --> @eagle705 commented on GitHub (Jun 30, 2025): I encountered the same issue. Is there a workaround?
Author
Owner

@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?

<!-- gh-comment-id:3018481128 --> @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?
Author
Owner

@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.

<!-- gh-comment-id:3018524751 --> @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.
Author
Owner

@joswr1ght 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?

@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):

Starting new HTTP connection (1): 127.0.0.1:55553
2025-06-30 17:15:39,800 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 127.0.0.1:55553
send: b'POST /api/ HTTP/1.1\r\nHost: 127.0.0.1:55553\r\nUser-Agent: python-requests/2.32.4\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-type: binary/message-pack\r\nContent-Length: 55\r\n\r\n'
send: b'\x92\xafmodule.exploits\xd9$1409da92-f2da-4461-a979-75a434ccc642'
reply: 'HTTP/1.1 200 OK\r\n'
header: Content-Type: binary/message-pack
header: Connection: Keep-Alive
header: Server: Rex
header: Content-Length: 93527
http://127.0.0.1:55553 "POST /api/ HTTP/1.1" 200 93527
2025-06-30 17:15:39,805 - urllib3.connectionpool - DEBUG - http://127.0.0.1:55553 "POST /api/ HTTP/1.1" 200 93527
2025-06-30 17:15:39,806 - metasploit_mcp_server - INFO - Found 3 exploits matching 'erlang'. Returning max 200.

MCPO:

astapi.exceptions.ResponseValidationError: 1 validation errors:
  {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': ['linux/ssh/ssh_erlangotp_rce', 'multi/http/apache_couchdb_erlang_rce', 'multi/misc/erlang_cookie_rce']}

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!

Image
Image

<!-- gh-comment-id:3020081919 --> @joswr1ght 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? @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): ``` Starting new HTTP connection (1): 127.0.0.1:55553 2025-06-30 17:15:39,800 - urllib3.connectionpool - DEBUG - Starting new HTTP connection (1): 127.0.0.1:55553 send: b'POST /api/ HTTP/1.1\r\nHost: 127.0.0.1:55553\r\nUser-Agent: python-requests/2.32.4\r\nAccept-Encoding: gzip, deflate\r\nAccept: */*\r\nConnection: keep-alive\r\nContent-type: binary/message-pack\r\nContent-Length: 55\r\n\r\n' send: b'\x92\xafmodule.exploits\xd9$1409da92-f2da-4461-a979-75a434ccc642' reply: 'HTTP/1.1 200 OK\r\n' header: Content-Type: binary/message-pack header: Connection: Keep-Alive header: Server: Rex header: Content-Length: 93527 http://127.0.0.1:55553 "POST /api/ HTTP/1.1" 200 93527 2025-06-30 17:15:39,805 - urllib3.connectionpool - DEBUG - http://127.0.0.1:55553 "POST /api/ HTTP/1.1" 200 93527 2025-06-30 17:15:39,806 - metasploit_mcp_server - INFO - Found 3 exploits matching 'erlang'. Returning max 200. ``` MCPO: ``` astapi.exceptions.ResponseValidationError: 1 validation errors: {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': ['linux/ssh/ssh_erlangotp_rce', 'multi/http/apache_couchdb_erlang_rce', 'multi/misc/erlang_cookie_rce']} ``` 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! ![Image](https://github.com/user-attachments/assets/2c235bac-78f2-4ef8-ab5a-dff89f0abafd) ![Image](https://github.com/user-attachments/assets/d62fff74-acc2-431d-9b33-82cdbbb7d6d1)
Author
Owner

@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.

Image

<!-- gh-comment-id:3020288097 --> @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. ![Image](https://github.com/user-attachments/assets/8cd8c409-8ab2-491e-92ef-b4a747493cb4)
Author
Owner

@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’.

<!-- gh-comment-id:3021342631 --> @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’.
Author
Owner

@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).

<!-- gh-comment-id:3021348404 --> @tpdns90321 commented on GitHub (Jul 1, 2025): I tested this solution by [mcp-youtube-transcript](https://github.com/jkawamoto/mcp-youtube-transcript)(this is error like metasploit mcp above case) and puppeteer-server(normal).
Author
Owner

@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.

<!-- gh-comment-id:3021636979 --> @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.
Author
Owner

@tpdns90321 commented on GitHub (Jul 1, 2025):

    raise ResponseValidationError(
fastapi.exceptions.ResponseValidationError: 1 validation errors:
  {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': "Some Youtube Transcript, censored, because avoid copyright problem."}

^CINFO:     Shutting down
INFO:     Waiting for application shutdown.
INFO:     Application shutdown complete.
INFO:     Finished server process [13064]
(mcpo) ➜  mcpo git:(main) ✗ vi src/mcpo/utils/main.py
(mcpo) ➜  mcpo git:(main) ✗ grep "response_data\[0\]" src/mcpo/utils/main.py
                        {"result": response_data[0]}
                        response_data[0] if len(response_data) == 1 else response_data
(mcpo) ➜  mcpo git:(main) ✗ uv run mcpo -- uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript
Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript
2025-07-01 13:32:13,472 - INFO - Starting MCPO Server...
2025-07-01 13:32:13,472 - INFO -   Name: MCP OpenAPI Proxy
2025-07-01 13:32:13,472 - INFO -   Version: 1.0
2025-07-01 13:32:13,472 - INFO -   Description: Automatically generated API from MCP Tool Schemas
2025-07-01 13:32:13,472 - INFO -   Hostname: kang-macbook-air.local
2025-07-01 13:32:13,472 - INFO -   Port: 8000
2025-07-01 13:32:13,472 - INFO -   API Key: Not Provided
2025-07-01 13:32:13,472 - INFO -   CORS Allowed Origins: ['*']
2025-07-01 13:32:13,473 - INFO -   Path Prefix: /
2025-07-01 13:32:13,473 - INFO - Configuring for a single Stdio MCP Server with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript
2025-07-01 13:32:13,473 - INFO - Uvicorn server starting...
INFO:     Started server process [13330]
INFO:     Waiting for application startup.
    Updated https://github.com/jkawamoto/mcp-youtube-transcript/ (b45d58acb47d3a5a6c578d04a93c9b5fc627e7f0)
INFO:mcp_youtube_transcript.cli:starting Youtube Transcript MCP server
INFO:mcp.server.lowlevel.server:Processing request of type ListToolsRequest
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Calling endpoint: get_transcript, with args: {'url': 'https://youtu.be/m4-HM_sCvtQ?si=HN1apv6MYmQDRPxG', 'lang': 'en'}
INFO:mcp.server.lowlevel.server:Processing request of type CallToolRequest
INFO:     127.0.0.1:59117 - "POST /get_transcript HTTP/1.1" 200 OK
<!-- gh-comment-id:3021724856 --> @tpdns90321 commented on GitHub (Jul 1, 2025): ```log raise ResponseValidationError( fastapi.exceptions.ResponseValidationError: 1 validation errors: {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': "Some Youtube Transcript, censored, because avoid copyright problem."} ^CINFO: Shutting down INFO: Waiting for application shutdown. INFO: Application shutdown complete. INFO: Finished server process [13064] (mcpo) ➜ mcpo git:(main) ✗ vi src/mcpo/utils/main.py (mcpo) ➜ mcpo git:(main) ✗ grep "response_data\[0\]" src/mcpo/utils/main.py {"result": response_data[0]} response_data[0] if len(response_data) == 1 else response_data (mcpo) ➜ mcpo git:(main) ✗ uv run mcpo -- uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript 2025-07-01 13:32:13,472 - INFO - Starting MCPO Server... 2025-07-01 13:32:13,472 - INFO - Name: MCP OpenAPI Proxy 2025-07-01 13:32:13,472 - INFO - Version: 1.0 2025-07-01 13:32:13,472 - INFO - Description: Automatically generated API from MCP Tool Schemas 2025-07-01 13:32:13,472 - INFO - Hostname: kang-macbook-air.local 2025-07-01 13:32:13,472 - INFO - Port: 8000 2025-07-01 13:32:13,472 - INFO - API Key: Not Provided 2025-07-01 13:32:13,472 - INFO - CORS Allowed Origins: ['*'] 2025-07-01 13:32:13,473 - INFO - Path Prefix: / 2025-07-01 13:32:13,473 - INFO - Configuring for a single Stdio MCP Server with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript 2025-07-01 13:32:13,473 - INFO - Uvicorn server starting... INFO: Started server process [13330] INFO: Waiting for application startup. Updated https://github.com/jkawamoto/mcp-youtube-transcript/ (b45d58acb47d3a5a6c578d04a93c9b5fc627e7f0) INFO:mcp_youtube_transcript.cli:starting Youtube Transcript MCP server INFO:mcp.server.lowlevel.server:Processing request of type ListToolsRequest INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) Calling endpoint: get_transcript, with args: {'url': 'https://youtu.be/m4-HM_sCvtQ?si=HN1apv6MYmQDRPxG', 'lang': 'en'} INFO:mcp.server.lowlevel.server:Processing request of type CallToolRequest INFO: 127.0.0.1:59117 - "POST /get_transcript HTTP/1.1" 200 OK ```
Author
Owner

@tpdns90321 commented on GitHub (Jul 1, 2025):

(mcpo) ➜  mcpo git:(main) ✗ vi src/mcpo/utils/main.py
(mcpo) ➜  mcpo git:(main) ✗ grep "response_data\[0\]" src/mcpo/utils/main.py
                        {"response": response_data[0]}
                        response_data[0] if len(response_data) == 1 else response_data
(mcpo) ➜  mcpo git:(main) ✗ uv run mcpo -- uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript
Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript
2025-07-01 13:36:11,300 - INFO - Starting MCPO Server...
2025-07-01 13:36:11,300 - INFO -   Name: MCP OpenAPI Proxy
2025-07-01 13:36:11,300 - INFO -   Version: 1.0
2025-07-01 13:36:11,300 - INFO -   Description: Automatically generated API from MCP Tool Schemas
2025-07-01 13:36:11,300 - INFO -   Hostname: kang-macbook-air.local
2025-07-01 13:36:11,300 - INFO -   Port: 8000
2025-07-01 13:36:11,300 - INFO -   API Key: Not Provided
2025-07-01 13:36:11,300 - INFO -   CORS Allowed Origins: ['*']
2025-07-01 13:36:11,300 - INFO -   Path Prefix: /
2025-07-01 13:36:11,301 - INFO - Configuring for a single Stdio MCP Server with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript
2025-07-01 13:36:11,301 - INFO - Uvicorn server starting...
INFO:     Started server process [13506]
INFO:     Waiting for application startup.
    Updated https://github.com/jkawamoto/mcp-youtube-transcript/ (b45d58acb47d3a5a6c578d04a93c9b5fc627e7f0)
INFO:mcp_youtube_transcript.cli:starting Youtube Transcript MCP server
INFO:mcp.server.lowlevel.server:Processing request of type ListToolsRequest
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
Calling endpoint: get_transcript, with args: {'url': 'https://youtu.be/m4-HM_sCvtQ?si=HN1apv6MYmQDRPxG', 'lang': 'en'}
INFO:mcp.server.lowlevel.server:Processing request of type CallToolRequest
INFO:     127.0.0.1:59334 - "POST /get_transcript HTTP/1.1" 500 Internal Server Error
ERROR:    Exception in ASGI application
Traceback (most recent call last):
  # same error traceback, but censored due to privacy.
    raise ResponseValidationError(
fastapi.exceptions.ResponseValidationError: 1 validation errors:
  {'type': 'missing', 'loc': ('response', 'result'), 'msg': 'Field required', 'input': {'response': 

Add log when using other member name.
PS. I don't know why MCPO or FastAPI need dictionary that contain "result" member parameter.

<!-- gh-comment-id:3021735888 --> @tpdns90321 commented on GitHub (Jul 1, 2025): ```log (mcpo) ➜ mcpo git:(main) ✗ vi src/mcpo/utils/main.py (mcpo) ➜ mcpo git:(main) ✗ grep "response_data\[0\]" src/mcpo/utils/main.py {"response": response_data[0]} response_data[0] if len(response_data) == 1 else response_data (mcpo) ➜ mcpo git:(main) ✗ uv run mcpo -- uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript Starting MCP OpenAPI Proxy on 0.0.0.0:8000 with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript 2025-07-01 13:36:11,300 - INFO - Starting MCPO Server... 2025-07-01 13:36:11,300 - INFO - Name: MCP OpenAPI Proxy 2025-07-01 13:36:11,300 - INFO - Version: 1.0 2025-07-01 13:36:11,300 - INFO - Description: Automatically generated API from MCP Tool Schemas 2025-07-01 13:36:11,300 - INFO - Hostname: kang-macbook-air.local 2025-07-01 13:36:11,300 - INFO - Port: 8000 2025-07-01 13:36:11,300 - INFO - API Key: Not Provided 2025-07-01 13:36:11,300 - INFO - CORS Allowed Origins: ['*'] 2025-07-01 13:36:11,300 - INFO - Path Prefix: / 2025-07-01 13:36:11,301 - INFO - Configuring for a single Stdio MCP Server with command: uvx --from git+https://github.com/jkawamoto/mcp-youtube-transcript/ mcp-youtube-transcript 2025-07-01 13:36:11,301 - INFO - Uvicorn server starting... INFO: Started server process [13506] INFO: Waiting for application startup. Updated https://github.com/jkawamoto/mcp-youtube-transcript/ (b45d58acb47d3a5a6c578d04a93c9b5fc627e7f0) INFO:mcp_youtube_transcript.cli:starting Youtube Transcript MCP server INFO:mcp.server.lowlevel.server:Processing request of type ListToolsRequest INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit) Calling endpoint: get_transcript, with args: {'url': 'https://youtu.be/m4-HM_sCvtQ?si=HN1apv6MYmQDRPxG', 'lang': 'en'} INFO:mcp.server.lowlevel.server:Processing request of type CallToolRequest INFO: 127.0.0.1:59334 - "POST /get_transcript HTTP/1.1" 500 Internal Server Error ERROR: Exception in ASGI application Traceback (most recent call last): # same error traceback, but censored due to privacy. raise ResponseValidationError( fastapi.exceptions.ResponseValidationError: 1 validation errors: {'type': 'missing', 'loc': ('response', 'result'), 'msg': 'Field required', 'input': {'response': ``` Add log when using other member name. PS. I don't know why MCPO or FastAPI need dictionary that contain "result" member parameter.
Author
Owner

@joswr1ght 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 I'm still getting an error when I use your fork and branch:

$ git config --get remote.origin.url
https://github.com/tpdns90321/mcpo
$ git branch
* fix/singleResponse
  main
$ docker build -t mcpo .
$ docker run --network=host -it -h mcpo --rm mcpo --port 8000 --server-type "sse" -- http://127.0.0.1:8085/sse
...
fastapi.exceptions.ResponseValidationError: 1 validation errors:
  {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': ['linux/ssh/ssh_erlangotp_rce', 'multi/http/apache_couchdb_erlang_rce', 'multi/misc/erlang_cookie_rce']}

Is this a problem with fastapi and not mcpo? Thanks for taking a look!

<!-- gh-comment-id:3024868116 --> @joswr1ght 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 I'm still getting an error when I use your fork and branch: ``` $ git config --get remote.origin.url https://github.com/tpdns90321/mcpo $ git branch * fix/singleResponse main $ docker build -t mcpo . $ docker run --network=host -it -h mcpo --rm mcpo --port 8000 --server-type "sse" -- http://127.0.0.1:8085/sse ... fastapi.exceptions.ResponseValidationError: 1 validation errors: {'type': 'model_attributes_type', 'loc': ('response',), 'msg': 'Input should be a valid dictionary or object to extract fields from', 'input': ['linux/ssh/ssh_erlangotp_rce', 'multi/http/apache_couchdb_erlang_rce', 'multi/misc/erlang_cookie_rce']} ``` Is this a problem with fastapi and not mcpo? Thanks for taking a look!
Author
Owner

@tpdns90321 commented on GitHub (Jul 2, 2025):

Image

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:

  1. FastMCP
  2. etc
<!-- gh-comment-id:3025966875 --> @tpdns90321 commented on GitHub (Jul 2, 2025): ![Image](https://github.com/user-attachments/assets/a62fcca5-2639-4f2c-9b88-14460637053b) 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: 1. FastMCP 2. etc
Author
Owner

@tpdns90321 commented on GitHub (Jul 2, 2025):

I push commit that modified entire final_response to wrapped dictionary, to my fork repository.

<!-- gh-comment-id:3026137158 --> @tpdns90321 commented on GitHub (Jul 2, 2025): I push commit that modified entire final_response to wrapped dictionary, to my fork repository.
Author
Owner

@tjbck commented on GitHub (Jul 2, 2025):

@tpdns90321 might've been addressed with a5f62225fd in dev, testing wanted here!

<!-- gh-comment-id:3026715437 --> @tjbck commented on GitHub (Jul 2, 2025): @tpdns90321 might've been addressed with a5f62225fd9a48b5b7f5d3cd018a5b75b02128bf in dev, testing wanted here!
Author
Owner

@tpdns90321 commented on GitHub (Jul 2, 2025):

Image

Image

Working well! Thanks! Good method for non-modifying response data.

@tpdns90321 might've been addressed with a5f6222 in dev, testing wanted here!

<!-- gh-comment-id:3027458487 --> @tpdns90321 commented on GitHub (Jul 2, 2025): ![Image](https://github.com/user-attachments/assets/60c42fac-adfb-4a19-8e12-6870a9c762a1) ![Image](https://github.com/user-attachments/assets/d6a9c55a-8c3c-43ca-a2b5-9be609905515) Working well! Thanks! Good method for non-modifying response data. > [@tpdns90321](https://github.com/tpdns90321) might've been addressed with [a5f6222](https://github.com/open-webui/mcpo/commit/a5f62225fd9a48b5b7f5d3cd018a5b75b02128bf) in dev, testing wanted here!
Author
Owner

@tjbck commented on GitHub (Jul 2, 2025):

Thanks for the confirmation, 0.0.16 will be released shortly!

<!-- gh-comment-id:3027556883 --> @tjbck commented on GitHub (Jul 2, 2025): Thanks for the confirmation, 0.0.16 will be released shortly!
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#86
No description provided.