I'm trying to implement a dynamic REST API interface to convert to an MCP service, but I've encountered this problem. I think this shouldn't be happening, because I've installed all the dependencies exactly as specified in the documentation. Are there any dependencies that need updating? I've only encountered this problem when there were version incompatibilities or outdated versions. How can I solve this?
The SSE mode also has the same exceptions.
🚀 启动 REST API 转 MCP 服务...
INFO - Loaded local OpenAPI spec from: D:\Projects\test_projects\OpenAPI-MCP\my_test\api_spec.yaml
INFO - Parsed 2 operations from OpenAPI spec
INFO - Initialized OpenAPI proxy for My API Service
INFO - Registered 2 API operations as tools
✅ MCP 服务 'myapi' 已初始化
📍 服务地址: http://0.0.0.0:8005
🔧 可用工具数量: 2
启动 HTTP 传输...
Traceback (most recent call last):
File "D:\Projects\test_projects\OpenAPI-MCP\my_test\test_fastmcp_live.py", line 51, in
main()
File "D:\Projects\test_projects\OpenAPI-MCP\my_test\test_fastmcp_live.py", line 48, in main
asyncio.run(start_service(service_config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\asyncio\runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\asyncio\base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\Projects\test_projects\OpenAPI-MCP\my_test\test_fastmcp_live.py", line 30, in start_service
server.run_http(host=config.mcp_http_host, port=config.mcp_http_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\site-packages\openapi_mcp\fastmcp_server.py", line 580, in run_http
app = self.mcp.streamable_http_app()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FastMCP' object has no attribute 'streamable_http_app'
I'm trying to implement a dynamic REST API interface to convert to an MCP service, but I've encountered this problem. I think this shouldn't be happening, because I've installed all the dependencies exactly as specified in the documentation. Are there any dependencies that need updating? I've only encountered this problem when there were version incompatibilities or outdated versions. How can I solve this?
The SSE mode also has the same exceptions.
🚀 启动 REST API 转 MCP 服务...
INFO - Loaded local OpenAPI spec from: D:\Projects\test_projects\OpenAPI-MCP\my_test\api_spec.yaml
INFO - Parsed 2 operations from OpenAPI spec
INFO - Initialized OpenAPI proxy for My API Service
INFO - Registered 2 API operations as tools
✅ MCP 服务 'myapi' 已初始化
📍 服务地址: http://0.0.0.0:8005
🔧 可用工具数量: 2
启动 HTTP 传输...
Traceback (most recent call last):
File "D:\Projects\test_projects\OpenAPI-MCP\my_test\test_fastmcp_live.py", line 51, in
main()
File "D:\Projects\test_projects\OpenAPI-MCP\my_test\test_fastmcp_live.py", line 48, in main
asyncio.run(start_service(service_config))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\asyncio\runners.py", line 195, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\asyncio\runners.py", line 118, in run
return self._loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\asyncio\base_events.py", line 691, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "D:\Projects\test_projects\OpenAPI-MCP\my_test\test_fastmcp_live.py", line 30, in start_service
server.run_http(host=config.mcp_http_host, port=config.mcp_http_port)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\liupen7x.conda\envs\api_to_mcp\Lib\site-packages\openapi_mcp\fastmcp_server.py", line 580, in run_http
app = self.mcp.streamable_http_app()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'FastMCP' object has no attribute 'streamable_http_app'