Skip to content

Commit 2182205

Browse files
authored
Support different transports in Client (#1972)
1 parent 2137c8f commit 2182205

File tree

25 files changed

+544
-631
lines changed

25 files changed

+544
-631
lines changed

.github/actions/conformance/client.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ async def handle_callback(self) -> tuple[str, str | None]:
156156
@register("initialize")
157157
async def run_initialize(server_url: str) -> None:
158158
"""Connect, initialize, list tools, close."""
159-
async with streamable_http_client(url=server_url) as (read_stream, write_stream, _):
159+
async with streamable_http_client(url=server_url) as (read_stream, write_stream):
160160
async with ClientSession(read_stream, write_stream) as session:
161161
await session.initialize()
162162
logger.debug("Initialized successfully")
@@ -167,7 +167,7 @@ async def run_initialize(server_url: str) -> None:
167167
@register("tools_call")
168168
async def run_tools_call(server_url: str) -> None:
169169
"""Connect, initialize, list tools, call add_numbers(a=5, b=3), close."""
170-
async with streamable_http_client(url=server_url) as (read_stream, write_stream, _):
170+
async with streamable_http_client(url=server_url) as (read_stream, write_stream):
171171
async with ClientSession(read_stream, write_stream) as session:
172172
await session.initialize()
173173
await session.list_tools()
@@ -178,7 +178,7 @@ async def run_tools_call(server_url: str) -> None:
178178
@register("sse-retry")
179179
async def run_sse_retry(server_url: str) -> None:
180180
"""Connect, initialize, list tools, call test_reconnection, close."""
181-
async with streamable_http_client(url=server_url) as (read_stream, write_stream, _):
181+
async with streamable_http_client(url=server_url) as (read_stream, write_stream):
182182
async with ClientSession(read_stream, write_stream) as session:
183183
await session.initialize()
184184
await session.list_tools()
@@ -209,7 +209,7 @@ async def default_elicitation_callback(
209209
@register("elicitation-sep1034-client-defaults")
210210
async def run_elicitation_defaults(server_url: str) -> None:
211211
"""Connect with elicitation callback that applies schema defaults."""
212-
async with streamable_http_client(url=server_url) as (read_stream, write_stream, _):
212+
async with streamable_http_client(url=server_url) as (read_stream, write_stream):
213213
async with ClientSession(
214214
read_stream, write_stream, elicitation_callback=default_elicitation_callback
215215
) as session:
@@ -296,7 +296,7 @@ async def run_auth_code_client(server_url: str) -> None:
296296
async def _run_auth_session(server_url: str, oauth_auth: OAuthClientProvider) -> None:
297297
"""Common session logic for all OAuth flows."""
298298
client = httpx.AsyncClient(auth=oauth_auth, timeout=30.0)
299-
async with streamable_http_client(url=server_url, http_client=client) as (read_stream, write_stream, _):
299+
async with streamable_http_client(url=server_url, http_client=client) as (read_stream, write_stream):
300300
async with ClientSession(
301301
read_stream, write_stream, elicitation_callback=default_elicitation_callback
302302
) as session:

CLAUDE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This document contains critical information about working with this codebase. Fo
1717
- Functions must be focused and small
1818
- Follow existing patterns exactly
1919
- Line length: 120 chars maximum
20-
- FORBIDDEN: imports inside functions
20+
- FORBIDDEN: imports inside functions. THEY SHOULD BE AT THE TOP OF THE FILE.
2121

2222
3. Testing Requirements
2323
- Framework: `uv run --frozen pytest`

0 commit comments

Comments
 (0)