Skip to content

Commit f979ca9

Browse files
ruff format
1 parent 9e68fa8 commit f979ca9

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/mcp/client/session.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,12 @@ async def send_roots_list_changed(self) -> None:
259259
async def _received_request(
260260
self, responder: RequestResponder["types.ServerRequest", "types.ClientResult"]
261261
) -> None:
262-
263262
if isinstance(responder.request.root, types.CreateMessageRequest):
264263
# handle create message request (sampling)
265264

266265
if self.sampling_callback is None:
267266
raise RuntimeError("Sampling callback is not set")
268-
267+
269268
response = await self.sampling_callback(responder.request.root.params)
270269
client_response = types.ClientResult(**response.model_dump())
271270
await responder.respond(client_response)

tests/client/test_stdio.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
1+
import shutil
2+
13
import pytest
24

35
from mcp.client.stdio import StdioServerParameters, stdio_client
46
from mcp.types import JSONRPCMessage, JSONRPCRequest, JSONRPCResponse
57

8+
tee: str = shutil.which("tee") # type: ignore
9+
assert tee is not None, "could not find tee command"
10+
611

712
@pytest.mark.anyio
813
async def test_stdio_client():
9-
server_parameters = StdioServerParameters(command="/usr/bin/tee")
14+
server_parameters = StdioServerParameters(command=tee)
1015

1116
async with stdio_client(server_parameters) as (read_stream, write_stream):
1217
# Test sending and receiving messages

0 commit comments

Comments
 (0)