Skip to content

[bigquery-maps-mcp] Bug: adk web returns 403 Forbidden when accessed via Cloud Shell Web Preview #1800

@JannetEkka

Description

@JannetEkka

Codelab : Build a Location Intelligence ADK Agent with MCP servers for BigQuery and Google Maps

Step affected

Step 7 — "Chat with your agent!"

Description

When running adk web in Google Cloud Shell and accessing the UI via Web Preview (port 8000), the ADK web server returns a 403 Forbidden error on session creation:

POST /apps/mcp_bakery_app/users/user/sessions HTTP/1.1" 403 Forbidden

This is caused by Cloud Shell proxying requests through a *.cloudshell.dev domain, which ADK's default CORS/origin check blocks.

Fix

The codelab should instruct users to run adk web with the --allow_origins flag:

adk web --allow_origins "regex:https://.*\.cloudshell\.dev"

Steps to reproduce

  1. Follow the codelab in Google Cloud Shell
  2. Run adk web as instructed
  3. Open the UI via Web Preview → port 8000
  4. Observe 403 on session creation — the chat interface does not load

Expected behavior

The codelab should include the --allow_origins flag in the adk web command, or add a note explaining this is required when using Cloud Shell Web Preview.

Metadata

Metadata

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