Skip to content

uvicorn got eagerly imported via sse-starlette #1770

@CNSeniorious000

Description

@CNSeniorious000

Initial Checks

Description

I noticed that you intend to lazy-import uvicorn because it's only used for HTTP/SSE transports. However, I found that it's still being imported immediately, as sse-starlette imports it eagerly, and sse-starlette is imported here:

https://github.com/search?q=repo%3Amodelcontextprotocol%2Fpython-sdk+sse_starlette+language%3APython&type=code

Example Code

import sys, mcp

assert "uvicorn" in sys.modules

Python & MCP Python SDK

1.23.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions