@@ -59,7 +59,9 @@ Create an `agent.py` file (e.g., in `./adk_agent_samples/mcp_agent/agent.py`). T
59
59
# ./adk_agent_samples/mcp_agent/agent.py
60
60
import os # Required for path operations
61
61
from google.adk.agents import LlmAgent
62
- from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioConnectionParams, StdioServerParameters
62
+ from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
63
+ from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
64
+ from mcp import StdioServerParameters
63
65
64
66
# It's good practice to define paths dynamically if possible,
65
67
# or ensure the user understands the need for an ABSOLUTE path.
@@ -261,7 +263,9 @@ Modify your `agent.py` file (e.g., in `./adk_agent_samples/mcp_agent/agent.py`).
261
263
# ./adk_agent_samples/mcp_agent/agent.py
262
264
import os
263
265
from google.adk.agents import LlmAgent
264
- from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioConnectionParams, StdioServerParameters
266
+ from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
267
+ from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
268
+ from mcp import StdioServerParameters
265
269
266
270
# Retrieve the API key from an environment variable or directly insert it.
267
271
# Using an environment variable is generally safer.
@@ -605,7 +609,9 @@ Create an `agent.py` (e.g., in `./adk_agent_samples/mcp_client_agent/agent.py`):
605
609
# ./adk_agent_samples/mcp_client_agent/agent.py
606
610
import os
607
611
from google.adk.agents import LlmAgent
608
- from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioConnectionParams, StdioServerParameters
612
+ from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
613
+ from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
614
+ from mcp import StdioServerParameters
609
615
610
616
# IMPORTANT: Replace this with the ABSOLUTE path to your my_adk_mcp_server.py script
611
617
PATH_TO_YOUR_MCP_SERVER_SCRIPT = " /path/to/your/my_adk_mcp_server.py" # <<< REPLACE
@@ -693,7 +699,9 @@ from google.adk.agents.llm_agent import LlmAgent
693
699
from google.adk.runners import Runner
694
700
from google.adk.sessions import InMemorySessionService
695
701
from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService # Optional
696
- from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, SseConnectionParams, StdioConnectionParams, StdioServerParameters
702
+ from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset
703
+ from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams
704
+ from mcp import StdioServerParameters
697
705
698
706
# Load environment variables from .env file in the parent directory
699
707
# Place this near the top, before using env vars like API keys
0 commit comments