8000 SSE not working with 'https' endpoint · Issue #617 · modelcontextprotocol/python-sdk · GitHub
[go: up one dir, main page]

Skip to content
SSE not working with 'https' endpoint #617
Open
@g4ur4vs

Description

@g4ur4vs

below is the stacktrace:

  • Exception Group Traceback (most recent call last):
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/sse.py", line 38, in
    | asyncio.run(main())
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/nest_asyncio.py", line 30, in run
    | return loop.run_until_complete(task)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/nest_asyncio.py", line 98, in run_until_complete
    | return f.result()
    | File "/opt/homebrew/Cellar/python@3.10/3.10.17/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/futures.py", line 201, in result
    | raise self._exception.with_traceback(self._exception_tb)
    | File "/opt/homebrew/Cellar/python@3.10/3.10.17/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/tasks.py", line 232, in __step
    | result = coro.send(None)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/sse.py", line 21, in main
    | async with sse_client("https://xyz.com/sse") as (read_stream, write_stream):
    | File "/opt/homebrew/Cellar/python@3.10/3.10.17/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 199, in aenter
    | return await anext(self.gen)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/mcp/client/sse.py", line 43, in sse_client
    | async with anyio.create_task_group() as tg:
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/anyio/_backends/_asyncio.py", line 772, in aexit
    | raise BaseExceptionGroup(
    | exceptiongroup.ExceptionGroup: unhandled errors in a TaskGroup (1 sub-exception)
    +-+---------------- 1 ----------------
    | Traceback (most recent call last):
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 101, in map_httpcore_exceptions
    | yield
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 394, in handle_async_request
    | resp = await self._pool.handle_async_request(req)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 256, in handle_async_request
    | raise exc from None
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpcore/_async/connection_pool.py", line 236, in handle_async_request
    | response = await connection.handle_async_request(
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpcore/_async/connection.py", line 101, in handle_async_request
    | raise exc
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpcore/_async/connection.py", line 78, in handle_async_request
    | stream = await self._connect(request)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpcore/_async/connection.py", line 156, in _connect
    | stream = await stream.start_tls(**kwargs)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpcore/_backends/anyio.py", line 67, in start_tls
    | with map_exceptions(exc_map):
    | File "/opt/homebrew/Cellar/python@3.10/3.10.17/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 153, in exit
    | self.gen.throw(typ, value, traceback)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpcore/_exceptions.py", line 14, in map_exceptions
    | raise to_exc(exc) from exc
    | httpcore.ConnectError: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1017)
    |
    | The above exception was the direct cause of the following exception:
    |
    | Traceback (most recent call last):
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/mcp/client/sse.py", line 47, in sse_client
    | async with aconnect_sse(
    | File "/opt/homebrew/Cellar/python@3.10/3.10.17/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 199, in aenter
    | return await anext(self.gen)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx_sse/_api.py", line 69, in aconnect_sse
    | async with client.stream(method, url, headers=headers, **kwargs) as response:
    | File "/opt/homebrew/Cellar/python@3.10/3.10.17/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 199, in aenter
    | return await anext(self.gen)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_client.py", line 1583, in stream
    | response = await self.send(
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_client.py", line 1629, in send
    | response = await self._send_handling_auth(
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_client.py", line 1657, in _send_handling_auth
    | response = await self._send_handling_redirects(
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_client.py", line 1694, in _send_handling_redirects
    | response = await self._send_single_request(request)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_client.py", line 1730, in _send_single_request
    | response = await transport.handle_async_request(request)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 393, in handle_async_request
    | with map_httpcore_exceptions():
    | File "/opt/homebrew/Cellar/python@3.10/3.10.17/Frameworks/Python.framework/Versions/3.10/lib/python3.10/contextlib.py", line 153, in exit
    | self.gen.throw(typ, value, traceback)
    | File "/Users/gaurav13.singh/Library/CloudStorage/OneDrive-MyCompany/Documents/Projects/OneSource/onboard-ai-assist/backend/mcp_venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 118, in map_httpcore_exceptions
    | raise mapped_exc(message) from exc
    | httpx.ConnectError: [SSL: UNSAFE_LEGACY_RENEGOTIATION_DISABLED] unsafe legacy renegotiation disabled (_ssl.c:1017)
    +------------------------------------

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0