mirror of
https://github.com/aljazceru/mcp-python-sdk.git
synced 2025-12-19 06:54:18 +01:00
Add client handling for sampling, list roots, ping (#218)
Adds sampling and list roots callbacks to the ClientSession, allowing the client to handle requests from the server. Co-authored-by: TerminalMan <84923604+SecretiveShell@users.noreply.github.com> Co-authored-by: David Soria Parra <davidsp@anthropic.com>
This commit is contained in:
@@ -1,12 +1,17 @@
|
||||
import shutil
|
||||
|
||||
import pytest
|
||||
|
||||
from mcp.client.stdio import StdioServerParameters, stdio_client
|
||||
from mcp.types import JSONRPCMessage, JSONRPCRequest, JSONRPCResponse
|
||||
|
||||
tee: str = shutil.which("tee") # type: ignore
|
||||
|
||||
|
||||
@pytest.mark.anyio
|
||||
@pytest.mark.skipif(tee is None, reason="could not find tee command")
|
||||
async def test_stdio_client():
|
||||
server_parameters = StdioServerParameters(command="/usr/bin/tee")
|
||||
server_parameters = StdioServerParameters(command=tee)
|
||||
|
||||
async with stdio_client(server_parameters) as (read_stream, write_stream):
|
||||
# Test sending and receiving messages
|
||||
|
||||
Reference in New Issue
Block a user