Skip to content

Commit 9431bc1

Browse files
committed
feat: google#479 streamable http added to right package
1 parent c5b9d49 commit 9431bc1

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/google/adk/tools/mcp_tool/mcp_toolset.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
from types import TracebackType
1818
from typing import List, Optional, TextIO, Tuple, Type
1919

20-
from .mcp_session_manager import MCPSessionManager, SseServerParams, retry_on_closed_resource
20+
from .mcp_session_manager import (MCPSessionManager, SseServerParams, StreamableHTTPServerParams,
21+
retry_on_closed_resource)
2122

2223
# Attempt to import MCP Tool from the MCP library, and hints user to upgrade
2324
# their Python version to 3.10 if it fails.
@@ -96,15 +97,15 @@ async def load_tools():
9697
9798
Attributes:
9899
connection_params: The connection parameters to the MCP server. Can be
99-
either `StdioServerParameters` or `SseServerParams`.
100+
`StdioServerParameters`, `SseServerParams` or `StreamableHTTPServerParams`.
100101
exit_stack: The async exit stack to manage the connection to the MCP server.
101102
session: The MCP session being initialized with the connection.
102103
"""
103104

104105
def __init__(
105106
self,
106107
*,
107-
connection_params: StdioServerParameters | SseServerParams,
108+
connection_params: StdioServerParameters | SseServerParams | StreamableHTTPServerParams,
108109
errlog: TextIO = sys.stderr,
109110
exit_stack=AsyncExitStack(),
110111
):
@@ -166,7 +167,8 @@ async def load_tools():
166167
Args:
167168
connection_params: The connection parameters to the MCP server. Can be:
168169
`StdioServerParameters` for using local mcp server (e.g. using `npx` or
169-
`python3`); or `SseServerParams` for a local/remote SSE server.
170+
`python3`); `SseServerParams` for a local/remote SSE server; or
171+
`StreamableHTTPServerParams` for local/remote Streamable http server.
170172
"""
171173
if not connection_params:
172174
raise ValueError('Missing connection params in MCPToolset.')
@@ -184,7 +186,7 @@ async def load_tools():
184186
async def from_server(
185187
cls,
186188
*,
187-
connection_params: StdioServerParameters | SseServerParams,
189+
connection_params: StdioServerParameters | SseServerParams | StreamableHTTPServerParams,
188190
async_exit_stack: Optional[AsyncExitStack] = None,
189191
errlog: TextIO = sys.stderr,
190192
) -> Tuple[List[MCPTool], AsyncExitStack]:

0 commit comments

Comments
 (0)