[GH-ISSUE #240] issue: anyio.ClosedResourceError for connecting streamable_http MCP server #111

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

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

Check Existing Issues

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

mcpo Version

v0.0.17

Open WebUI Version (if applicable)

No response

Operating System

Ubuntu

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

I think it should re-establish a new session

Actual Behavior

It cannot connect to my MCP server anymore and keep return HTTP Response code 500 but actually my MCP server is still running and able to receive request.

Steps to Reproduce

The MCP server is customized and maybe handle some requests take longer time than mcpo expected

Logs & Screenshots

INFO: 10.224.33.204:51454 - "POST /custom_kubectl_mcp/scan_unhealthy_pods_by_namespace HTTP/1.1" 500 Internal Server Error
2025-08-27 01:46:10,138 - INFO - Calling endpoint: scan_unhealthy_pods_by_namespace, with args: {'cluster_name': 'rke2-sle-micro-elemental', 'namespace': 'cattle-monitoring-system', 'min_restart_count': 1, 'restart_time_window_minutes': 60}
2025-08-27 01:46:10,139 - INFO - Unexpected error calling scan_unhealthy_pods_by_namespace: Traceback (most recent call last):
File "/app/.venv/lib/python3.11/site-packages/mcpo/utils/main.py", line 289, in tool
result = await session.call_tool(endpoint_name, arguments=args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/mcp/client/session.py", line 293, in call_tool
result = await self.send_request(
^^^^^^^^^^^^^^^^^^^^^^^^
File "/app/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 261, in send_request
await self._write_stream.send(SessionMessage(message=JSONRPCMessage(jsonrpc_request), metadata=metadata))
File "/app/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 242, in send
self.send_nowait(item)
File "/app/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 211, in send_nowait
raise ClosedResourceError
anyio.ClosedResourceError

Additional Information

No response

Originally created by @nghe4 on GitHub (Aug 27, 2025). Original GitHub issue: https://github.com/open-webui/mcpo/issues/240 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of mcpo. ### mcpo Version v0.0.17 ### Open WebUI Version (if applicable) _No response_ ### Operating System Ubuntu ### 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 I think it should re-establish a new session ### Actual Behavior It cannot connect to my MCP server anymore and keep return HTTP Response code 500 but actually my MCP server is still running and able to receive request. ### Steps to Reproduce The MCP server is customized and maybe handle some requests take longer time than mcpo expected ### Logs & Screenshots INFO: 10.224.33.204:51454 - "POST /custom_kubectl_mcp/scan_unhealthy_pods_by_namespace HTTP/1.1" 500 Internal Server Error 2025-08-27 01:46:10,138 - INFO - Calling endpoint: scan_unhealthy_pods_by_namespace, with args: {'cluster_name': 'rke2-sle-micro-elemental', 'namespace': 'cattle-monitoring-system', 'min_restart_count': 1, 'restart_time_window_minutes': 60} 2025-08-27 01:46:10,139 - INFO - Unexpected error calling scan_unhealthy_pods_by_namespace: Traceback (most recent call last): File "/app/.venv/lib/python3.11/site-packages/mcpo/utils/main.py", line 289, in tool result = await session.call_tool(endpoint_name, arguments=args) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/mcp/client/session.py", line 293, in call_tool result = await self.send_request( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/app/.venv/lib/python3.11/site-packages/mcp/shared/session.py", line 261, in send_request await self._write_stream.send(SessionMessage(message=JSONRPCMessage(jsonrpc_request), metadata=metadata)) File "/app/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 242, in send self.send_nowait(item) File "/app/.venv/lib/python3.11/site-packages/anyio/streams/memory.py", line 211, in send_nowait raise ClosedResourceError anyio.ClosedResourceError ### Additional Information _No response_
bsakaguchi 2026-10-18 21:11:51 +00:00
  • closed this issue
  • added the
    bug
    label
Author
Owner

@vlameiras commented on GitHub (Oct 13, 2025):

I'm having the same issue, using latest

<!-- gh-comment-id:3397563835 --> @vlameiras commented on GitHub (Oct 13, 2025): I'm having the same issue, using `latest`
Author
Owner

@taylorwilsdon commented on GitHub (Oct 18, 2025):

https://github.com/open-webui/mcpo/compare/issues/240?expand=1

<!-- gh-comment-id:3418760023 --> @taylorwilsdon commented on GitHub (Oct 18, 2025): https://github.com/open-webui/mcpo/compare/issues/240?expand=1
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#111
No description provided.