Repository navigation
Closed
Description
** Please make sure you read the contribution guide and file the issues in the right place. **
Contribution guide.
Describe the bug
A clear and concise description of what the bug is.
To Reproduce
Please share a minimal code and data to reproduce your problem.
Steps to reproduce the behavior:
- Create the agent based on
McpToolsettools inbigquery_mcp/agent.py:
from google.adk.agents.llm_agent import LlmAgent
from google.adk.tools.mcp_tool.mcp_session_manager import StreamableHTTPConnectionParams
from google.adk.tools.mcp_tool.mcp_toolset import McpToolset
import google.auth
BIGQUERY_AGENT_NAME = "adk_sample_bigquery_mcp_agent"
BIGQUERY_MCP_ENDPOINT = "https://bigquery.googleapis.com/mcp"
BIGQUERY_SCOPE = "https://www.googleapis.com/auth/bigquery"
# Initialize the tools to use the application default credentials.
# https://cloud.google.com/docs/authentication/provide-credentials-adc
credentials, project_id = google.auth.default(scopes=[BIGQUERY_SCOPE])
credentials.refresh(google.auth.transport.requests.Request())
oauth_token = credentials.token
bigquery_mcp_toolset = McpToolset(
connection_params=StreamableHTTPConnectionParams(
url=BIGQUERY_MCP_ENDPOINT,
headers={"Authorization": f"Bearer {oauth_token}"},
)
)
# The variable name `root_agent` determines what your root agent is for the
# debug CLI
root_agent = LlmAgent(
model="gemini-2.0-flash",
name=BIGQUERY_AGENT_NAME,
description=(
"Agent to answer questions about BigQuery data and models and execute"
" SQL queries using MCP."
),
instruction="""\
You are a data science agent with access to several BigQuery tools provided via MCP.
Make use of those tools to answer the user's questions.
""",
tools=[bigquery_mcp_toolset],
)- Run
adk web --log_level debug - Open http://127.0.0.1:8000/dev-ui/?app=bigquery_mcp
- Notice the error on the terminal
receive_response_headers.complete return_value=(b'HTTP/1.1', 403, b'Forbidden', [(b'Vary', b'Origin'), (b'Vary', b'X-Origin'), (b'Vary', b'Referer'), (b'Content-Type', b'application/json; charset=UTF-8'), (b'Content-Encoding', b'gzip'), (b'Date', b'Wed, 14 Jan 2026 22:43:58 GMT'), (b'Server', b'ESF'), (b'X-XSS-Protection', b'0'), (b'X-Frame-Options', b'SAMEORIGIN'), (b'X-Content-Type-Options', b'nosniff'), (b'Transfer-Encoding', b'chunked')])
- On ADK Web UI see "TypeError: network error" notification at the bottom (which looks like outside the main chat UI) but the tool doesn't finish, all you see is "...."
Expected behavior
If the BigQuery MCP feature is not enabled in the GCP project (which is the case for the project bigquery-public-data), an appropriate error should be reported to the user and the user should be able to continue to chat normally.
Screenshots
screen/5c337S54ceDgprf
Desktop (please complete the following information):
- OS: Linux
- Python version(python -V): 3.11.4
- ADK version(pip show google-adk): 1.21.0
Model Information:
- Are you using LiteLLM: No
- Which model is being used(e.g. gemini-2.5-flash)
Additional context
Add any other context about the problem here.
Reacted by simone viozzi and Jon Fox
Activity
adk-bot commentedon Jan 22, 2026
Notification: The author has updated the issue description. Maintainers, please review.
klateefa commentedon Feb 12, 2026
@shobsi Thanks for reporting!
The
403 responseindicates that the request is successfully reaching theBigQuery MCP endpoint, but the project being used does not haveMCP enabledor does not have permission to access it. So this is not anauthentication or token issue.The real problem appears to be error handling inADK Web: the 403 is surfaced as a generic“network error,”and the tool never completes, leaving theUI stuck. Ideally, the 403 should be handled gracefully and shown as aproper tool errorso the user can continue chatting normally.Thank you.
shobsi commentedon Feb 18, 2026
@klateefa thanks for looking into it. So it sounds like the fix is two fold:
adk webUI so that the user can carry on the conversation.Hope we can prioritize it soon.
feat(mcp): gracefully handle tool execution errors and transport crashes
feat(mcp): gracefully handle tool execution errors and transport crashes
feat(mcp): gracefully handle tool execution errors and transport crashes
feat(mcp): gracefully handle tool execution errors and transport crashes
GWeale commentedon Jun 16, 2026
Was fixed in 7744cfe
feat(mcp): gracefully handle tool execution errors and transport crashes
feat(mcp): gracefully handle tool execution errors and transport crashes
feat(mcp): gracefully handle tool execution errors and transport crashes
feat(mcp): gracefully handle tool execution errors and transport crashes