Skip to content

Commit 1d2b626

Browse files
committed
fix circular import
1 parent fc17b95 commit 1d2b626

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/mcp/shared/context.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
from dataclasses import dataclass
2-
from typing import Any, Generic
2+
from typing import TYPE_CHECKING, Any, Generic
33

44
from typing_extensions import TypeVar
55

6-
from mcp import ClientTransportSession, ServerTransportSession
76
from mcp.shared.session import BaseSession
87
from mcp.types import RequestId, RequestParams
98

9+
if TYPE_CHECKING:
10+
from mcp import ClientTransportSession, ServerTransportSession
11+
1012
SessionT = TypeVar(
11-
"SessionT", bound=BaseSession[Any, Any, Any, Any, Any] | ClientTransportSession | ServerTransportSession
13+
"SessionT", bound=BaseSession[Any, Any, Any, Any, Any] | "ClientTransportSession" | "ServerTransportSession"
1214
)
1315
LifespanContextT = TypeVar("LifespanContextT")
1416
RequestT = TypeVar("RequestT", default=Any)

0 commit comments

Comments
 (0)