Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions packages/mcpplugin/src/microsoft_teams/mcpplugin/transport.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

import httpx
from mcp.client.sse import sse_client
from mcp.client.streamable_http import streamable_http_client
from mcp.client.streamable_http import create_mcp_http_client, streamable_http_client

ValueOrFactory = Union[str, Callable[[], Union[str, Awaitable[str]]]]

Expand All @@ -31,12 +31,8 @@ async def create_streamable_http_transport(
else:
resolved_headers[key] = str(value)

if resolved_headers:
async with httpx.AsyncClient(headers=resolved_headers) as http_client:
async with streamable_http_client(url, http_client=http_client) as (read_stream, write_stream, _):
yield read_stream, write_stream
else:
async with streamable_http_client(url) as (read_stream, write_stream, _):
async with create_mcp_http_client(headers=resolved_headers or None) as http_client:
async with streamable_http_client(url, http_client=http_client) as (read_stream, write_stream, _):
yield read_stream, write_stream


Expand Down
Loading