Skip to content

Using FastAPI with Streamable HTTP MCP servers #2005

@vietnv1602

Description

@vietnv1602

when I use Streamable HTTP MCP servers inside a FastAPI router, I encounter an issue with an asyncio task.

server = MCPServerStreamableHttp()
await server.connect()
...
await server.cleanup()  --> this line always causes an asyncio error

How can i fix this

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions