Skip to content

ADK with MCPToolSet not working connecting to local MCPServer #33

Open

Description

@dubeym078
  1. I have created venv for adk project
  2. In the same env I am running FastMCP MCP server http://localhost:8000
  3. Instead of using MCP client - i wanted to use ADK as a client and calling tool from MCP server
  4. My ADK API server is running like
    adk api_server --host localhost --port 8000
  5. When I am make a call to this server which in turn goes to MCP and call the tool its not working. I am getting error
    Fail to load 'adk-google-models' module. 'module' object is not callable

Flow

Running venv where MCP server is running and ADK is running. ADK is the client calling tool defined in MCP server.

Code
root_agent = LlmAgent(
# Use the latest stable Flash model identifier
model="gemini-2.5-flash",
name="gemini_flash_agent",
description=("Agent to answer questions about weather in a city."),
instruction="Use the data from a URL provided by the user",
generate_content_config=generate_content_config,
tools= [McpToolset (
connection_params=StreamableHttpConnectionParams(
url="http://localhost:9000/mcp",
timeout=10,
),
tool_filter['get_weather']. // Weather tool running on MCP server
#sub_agents=[],
# ... other agent parameters
),
],
)

MCP code:

import io

from fastmcp import FastMCP
from fastmcp.utilities.types import Image

Create server - dependencies are now in fastmcp.json

mcp = FastMCP("Screenshot Demo")

@mcp.tool
def get_weather(city: str) -> dict:
"""Gets the current weather for a specific city."""
# In a real app, this would call a weather API
return {"city": city, "temperature": "72F", "forecast": "Sunny"}

if name == "main":
import asyncio

asyncio.run(mcp.run_async())

testing calling MCP:

curl -X POST http://localhost:8000/run
-H "Content-Type: application/json"
-d '{
"app_name": "adk-google-models",
"user_id": "test1",
"session_id": "test1session",
"new_message": {
"role": "user",
"parts": [
{"text": "What is the weather in cityxxx"}
]
}
}'

anyone have idea what is missing?

Activity

  1. soccernee commented on Jan 6, 2026

    @soccernee

    It looks like both the MCP server and your ADK agent are running on port 8000, so they will clash. In your agent definition, you call an MCP on port 9000. Fix: set the MCP server to run on port 9000 to avoid the clash & match the definition.

    It's hard to tell what else is wrong without more detail, but it sounds like the 'adk-google-models' module may not be installed correctly either?

    For an example of a working ADK agent that fetches the weather using MCP, check out this post: https://www.simvasia.com/blog/tutorial-testing-adk-agents-with-simvasia/.

  2. Utkarsh3725 commented on Aug 28, 2026

    @Utkarsh3725

    Hi, I’d like to investigate this.

    I’ll try to reproduce the MCPToolSet + local MCP server setup and check whether this is a code issue, docs issue, or configuration issue.

  3. Utkarsh3725 commented on Aug 28, 2026

    @Utkarsh3725

    I tried a minimal local reproduction with google adk[mcp] installed, and McpToolset was able to list a local streamable HTTP MCP tool successfully.

    Working client setup:

    from google.adk.tools.mcp_tool.mcp_toolset import McpToolset
    from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
    
    toolset = McpToolset(
        connection_params=StreamableHTTPConnectionParams(
            url="http://127.0.0.1:8000/mcp/"
        ),
        tool_filter=["get_weather"],
    )
    
    Result:
    ['get_weather']
    
    A few things that may be causing the reported failure:
    
    - `mcp` is optional, so `google adk[mcp]` is needed.
    - The class name is `McpToolset`.
    - The params class is `StreamableHTTPConnectionParams`.
    - `tool_filter` should be a list, e.g. `tool_filter=["get_weather"]`.
    - The server entrypoint should use `if __name__ == "__main__":`.
    
    I can help narrow this further if a full minimal reproduction is provided.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions