Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Traceback (most recent call last):
- File "./openai-agents-python/.venv/lib/python3.13/site-packages/mcp/client/streamable_http.py", line 405, in handle_request_async
- await self._handle_post_request(ctx)
- File "./openai-agents-python/.venv/lib/python3.13/site-packages/mcp/client/streamable_http.py", line 277, in _handle_post_request
- response.raise_for_status()
- ~~~~~~~~~~~~~~~~~~~~~~~~~^^
- File "./openai-agents-python/.venv/lib/python3.13/site-packages/httpx/_models.py", line 829, in raise_for_status
- raise HTTPStatusError(message, request=request, response=self)
- httpx.HTTPStatusError: Client error '401 Unauthorized' for url 'http://localhost:8000/mcp'
- For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/401
- The above exception was the direct cause of the following exception:
- Traceback (most recent call last):
- File "./openai-agents-python/test.py", line 39, in <module>
- asyncio.run(main())
- ~~~~~~~~~~~^^^^^^^^
- File "./.local/share/uv/python/cpython-3.13.9-macos-aarch64-none/lib/python3.13/asyncio/runners.py", line 195, in run
- return runner.run(main)
- ~~~~~~~~~~^^^^^^
- File "./.local/share/uv/python/cpython-3.13.9-macos-aarch64-none/lib/python3.13/asyncio/runners.py", line 118, in run
- return self._loop.run_until_complete(task)
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^
- File "./.local/share/uv/python/cpython-3.13.9-macos-aarch64-none/lib/python3.13/asyncio/base_events.py", line 725, in run_until_complete
- return future.result()
- ~~~~~~~~~~~~~^^
- File "./openai-agents-python/test.py", line 28, in main
- async with MCPServerStreamableHttp(
- ~~~~~~~~~~~~~~~~~~~~~~~^
- name="Streamable HTTP Python Server",
- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- ...<3 lines>...
- },
- ^^
- ) as server:
- ^
- File "./openai-agents-python/src/agents/mcp/server.py", line 278, in __aenter__
- await self.connect()
- File "./openai-agents-python/src/agents/mcp/server.py", line 405, in connect
- await self.cleanup()
- File "./openai-agents-python/src/agents/mcp/server.py", line 528, in cleanup
- raise UserError(
- ...<3 lines>...
- ) from http_error
- agents.exceptions.UserError: Failed to connect to MCP server 'Streamable HTTP Python Server': Authentication failed (401 Unauthorized). Please check your credentials.
Advertisement
Add Comment
Please, Sign In to add comment