Please provide a tutorial on combining "ADK Streaming" with "MCP". The "MCP" tool proxy cannot run in the example of "Quick Start"
As the title suggests, thank you very much!
@kazunori279 to consider adding this after you get bandwidth.
I'm also encountering the same issue when trying to run the MCP tool with ADK Streaming in the "Quick Start" example. Would appreciate any guidance or a workaround in the meantime. Thanks!
Sure, let me work on this.
For me i just have a question : can we use mcp server with adk when we build a system of many agents?
@kazunori279 Thanks for adding the instructions!
However, I’m encountering an issue when trying to create sub-agents using a similar method. The agent initialization fails with the following error:
RuntimeError: cannot reuse already awaited coroutine
Here’s a simplified version of the code that triggers the error:
sub_agent = create_db_agent()
# Create the root agent
root_agent = LlmAgent(
model='gemini-2.0-flash',
name='coordinator',
description="Main coordinator agent that handles user requests and delegates database queries.",
instruction='''
You are a helpful assistant that can answer questions by coordinating with a database specialist.
When a user asks for information that might be in a database:
1. If the query requires database access, transfer to the database_specialist agent.
2. If the query doesn't require database access, answer directly.
Always be helpful, concise, and user-friendly in your responses.
''',
sub_agents=[sub_agent],
allow_transfer=True,
)
Is there a recommended pattern for creating and attaching sub-agents with MCP that avoids this issue?
Sorry for my slow response! Let me check this in a couple of days.
The current MCP tools sample code doesn't work with adk web. The code is being updated with this PR:
https://github.com/google/adk-docs/pull/141#pullrequestreview-2782252406
@sleepMoreEarly @ycchoo28 Do you think this PR would fix your issue?
The PR is merged so the example should work with adk web now. https://github.com/google/adk-docs/pull/141
@sleepMoreEarly @ycchoo28 please try and close this issue if it works!
I have tried and streaming works with MCP now. Feel free to re-open if you still see any issues.