MCPcopy Index your code
hub / github.com/modelcontextprotocol/python-sdk / test_client_is_initialized

Function test_client_is_initialized

tests/client/test_client.py:109–120  ·  view source on GitHub ↗

Test that the client is initialized after entering context.

(app: MCPServer)

Source from the content-addressed store, hash-verified

107
108
109async def test_client_is_initialized(app: MCPServer):
110 """Test that the client is initialized after entering context."""
111 async with Client(app, mode="legacy") as client:
112 assert client.server_capabilities == snapshot(
113 ServerCapabilities(
114 experimental={},
115 prompts=PromptsCapability(list_changed=False),
116 resources=ResourcesCapability(subscribe=False, list_changed=False),
117 tools=ToolsCapability(list_changed=False),
118 )
119 )
120 assert client.server_info.name == "test"
121
122
123async def test_client_exposes_negotiated_protocol_version(app: MCPServer):

Callers

nothing calls this directly

Calls 5

ClientClass · 0.90
ServerCapabilitiesClass · 0.90
PromptsCapabilityClass · 0.90
ResourcesCapabilityClass · 0.90
ToolsCapabilityClass · 0.90

Tested by

no test coverage detected