Skip to content

Error initializing MCP server: Connection closed #822

Open
@gns-pkulkarni

Description

@gns-pkulkarni

I was trying to connect to openbnb MCP server from https://github.com/openbnb-org/mcp-server-airbnb. I'm new to both. While my filesystem MCP example works but this one doesn't

My versions are

  • Python 3.12.3
  • npx 10.9.2
  • pip show openai-agentsis
    Name: openai-agents
    Version: 0.0.17
    Summary: OpenAI Agents SDK
    Home-page: https://github.com/openai/openai-agents-python
    Author:
    Author-email: OpenAI support@openai.com
    License-Expression: MIT
    Location: d:\cursor\openai_mcp.venv\Lib\site-packages
    Requires: griffe, mcp, openai, pydantic, requests, types-requests, typing-extensions
    Required-by:

Traceback

Error initializing MCP server: Connection closed
Traceback (most recent call last):
  File "D:\cursor\openai_mcp\mcp_openbnb_example.py", line 32, in <module>
    asyncio.run(main())
  File "C:\Users\GNS132\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Users\GNS132\AppData\Local\Programs\Python\Python312\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\GNS132\AppData\Local\Programs\Python\Python312\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "D:\cursor\openai_mcp\mcp_openbnb_example.py", line 21, in main
    async with openbnb_server as openbnb:
  File "d:\cursor\openai_mcp\.venv\Lib\site-packages\agents\mcp\server.py", line 98, in __aenter__  
    await self.connect()
  File "d:\cursor\openai_mcp\.venv\Lib\site-packages\agents\mcp\server.py", line 126, in connect    
    server_result = await session.initialize()
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\cursor\openai_mcp\.venv\Lib\site-packages\mcp\client\session.py", line 133, in initialize
    result = await self.send_request(
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "d:\cursor\openai_mcp\.venv\Lib\site-packages\mcp\shared\session.py", line 297, in send_request
    raise McpError(response_or_error.error)
mcp.shared.exceptions.McpError: Connection closed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions