diff --git a/docs/tools/mcp-tools.md b/docs/tools/mcp-tools.md index fdb392c2..ceb33136 100644 --- a/docs/tools/mcp-tools.md +++ b/docs/tools/mcp-tools.md @@ -59,7 +59,9 @@ Create an `agent.py` file (e.g., in `./adk_agent_samples/mcp_agent/agent.py`). T # ./adk_agent_samples/mcp_agent/agent.py import os # Required for path operations from google.adk.agents import LlmAgent -from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioConnectionParams, StdioServerParameters +from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset +from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams +from mcp import StdioServerParameters # It's good practice to define paths dynamically if possible, # 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`). # ./adk_agent_samples/mcp_agent/agent.py import os from google.adk.agents import LlmAgent -from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioConnectionParams, StdioServerParameters +from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset +from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams +from mcp import StdioServerParameters # Retrieve the API key from an environment variable or directly insert it. # 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`): # ./adk_agent_samples/mcp_client_agent/agent.py import os from google.adk.agents import LlmAgent -from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, StdioConnectionParams, StdioServerParameters +from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset +from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams +from mcp import StdioServerParameters # IMPORTANT: Replace this with the ABSOLUTE path to your my_adk_mcp_server.py script 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 from google.adk.runners import Runner from google.adk.sessions import InMemorySessionService from google.adk.artifacts.in_memory_artifact_service import InMemoryArtifactService # Optional -from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset, SseConnectionParams, StdioConnectionParams, StdioServerParameters +from google.adk.tools.mcp_tool.mcp_toolset import MCPToolset +from google.adk.tools.mcp_tool.mcp_session_manager import StdioConnectionParams +from mcp import StdioServerParameters # Load environment variables from .env file in the parent directory # Place this near the top, before using env vars like API keys