Skip to content

Commit 9f3d724

Browse files
committed
fix ruff
1 parent c502663 commit 9f3d724

File tree

4 files changed

+9
-7
lines changed

4 files changed

+9
-7
lines changed

src/mcp/server/lowlevel/server.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,9 @@ async def main():
102102
CombinationContent: TypeAlias = tuple[UnstructuredContent, StructuredContent]
103103

104104
# This will be properly typed in each Server instance's context
105-
request_ctx: contextvars.ContextVar[RequestContext[ServerTransportSession, Any, Any]] = contextvars.ContextVar("request_ctx")
105+
request_ctx: contextvars.ContextVar[RequestContext[ServerTransportSession, Any, Any]] = contextvars.ContextVar(
106+
"request_ctx"
107+
)
106108

107109

108110
class NotificationOptions:

src/mcp/shared/context.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,9 @@
88
from mcp.shared.session import BaseSession
99
from mcp.types import RequestId, RequestParams
1010

11-
SessionT = TypeVar("SessionT",
12-
bound=BaseSession[Any, Any, Any, Any, Any] |
13-
ClientTransportSession |
14-
ServerTransportSession)
11+
SessionT = TypeVar(
12+
"SessionT", bound=BaseSession[Any, Any, Any, Any, Any] | ClientTransportSession | ServerTransportSession
13+
)
1514
LifespanContextT = TypeVar("LifespanContextT")
1615
RequestT = TypeVar("RequestT", default=Any)
1716

tests/client/test_sampling_callback.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1+
from typing import cast
2+
13
import pytest
24

35
from mcp.client.session import ClientTransportSession
46
from mcp.server.session import ServerSession
5-
from typing import cast
67
from mcp.shared.context import RequestContext
78
from mcp.shared.memory import (
89
create_connected_server_and_client_session as create_session,

tests/shared/test_streamable_http.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323
import mcp.types as types
2424
from mcp.client.session import ClientSession, ClientTransportSession
25-
from mcp.server.session import ServerSession
2625
from mcp.client.streamable_http import streamablehttp_client
2726
from mcp.server import Server
27+
from mcp.server.session import ServerSession
2828
from mcp.server.streamable_http import (
2929
MCP_PROTOCOL_VERSION_HEADER,
3030
MCP_SESSION_ID_HEADER,

0 commit comments

Comments
 (0)