Enable the necessary APIs

Vérifier ma progression

/ 10

Perform the necessary policy bindings

Vérifier ma progression

/ 5

MCP deploy and test locally

Vérifier ma progression

/ 20

MCP deploy to Cloud Run

Vérifier ma progression

/ 20

Update the agent to use MCP

Vérifier ma progression

/ 5

Deploy the ADK Agent locally

Vérifier ma progression

/ 20

Deploy the ADK Agent on Cloud Run

Vérifier ma progression

/ 10

Verify the deployed ADK Agent

Vérifier ma progression

/ 10

Cet atelier peut intégrer des outils d'IA pour vous accompagner dans votre apprentissage.

GSP532

Google Cloud self-paced labs

Challenge overview

In a challenge lab you’re given a scenario and a set of tasks. Instead of following step-by-step instructions, you will use the skills learned from the labs in the course to figure out how to complete the tasks on your own! An automated scoring system (shown on this page) will provide feedback on whether you have completed your tasks correctly.

When you take a challenge lab, you will not be taught new Google Cloud concepts. You are expected to extend your learned skills, like changing default values and reading and researching error messages to fix your own mistakes.

To score 100% you must successfully complete all tasks within the time period!

This lab is recommended for students who have enrolled in the Build a Smart Cloud Application with Vibe Coding and MCP course. Are you ready for the challenge?

Topics tested

  • Enable the APIs and set the environment variables.
  • Perform the IAM policy bindings.
  • Deploy the MCP server locally for testing and deploy to Cloud Run.
  • Use the Agent Development Kit (ADK) to update the Python application to use MCP.
  • Dockerize and deploy the MCP server and ADK agent to Cloud Run.

Setup and requirements

Before you click the Start Lab button

Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.

This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.

To complete this lab, you need:

  • Access to a standard internet browser (Chrome browser recommended).
Note: Use an Incognito (recommended) or private browser window to run this lab. This prevents conflicts between your personal account and the student account, which may cause extra charges incurred to your personal account.
  • Time to complete the lab—remember, once you start, you cannot pause a lab.
Note: Use only the student account for this lab. If you use a different Google Cloud account, you may incur charges to that account.

Challenge scenario

The Cloud Creek Zoo has contracted the Cymbal Group's 'Digital Experience' consulting division to implement a state-of-the-art visitor engagement system. Cloud Creek Zoo's ultimate goal is a highly accurate, dynamic, and engaging Tour Guide powered by AI that can provide deep, contextual answers to visitor questions. At the core of the systems upgrade is the implementation and upgrade of the "zoo tour guide" AI agent that can perform lookups of animal information via a remote Model Context Protocol (MCP) server, the "zoo server".

Cymbal logo

In addition to using Wikipedia for context when answering visitor queries, the "zoo tour guide" agent should have access to real-time, broad information via a dedicated Google Search MCP Server tool. This would give the agent the capacity to answer questions such as, "Give me recent conservation news about the lion species."

A junior consultant made some mistakes while upgrading the existing "zoo server", resulting in a slightly broken, non-functional Python server. In addition, the project's architecture had not yet been finalized according to Cymbal Group's strict IAM policies.

You have been called to address these issues.

Your challenge

In this lab, your mission as a Senior AI Integration Specialist for the Cymbal Group is the following:

  • Set up the project and enable the necessary APIs as well as services.
  • Enforce corporate IAM policy.
  • Fix the broken MCP server's code and deploy the server to Cloud Run for testing.
  • Integrate and upgrade the "zoo tour guide" ADK AI agent's functionality and workflow to support Google Search.
  • Dockerize the ADK agent package and deploy it to Cloud Run to achieve production readiness.

Task 1. Set up the environment and enable the necessary APIs

In this task, you create the project-specific foundation in Google Cloud to support an AI deployment at scale.

Ensure your Google Cloud project is configured to allow the required services to function and communicate effectively.

Download the code files

  1. In Cloud Shell, click Open Editor to open the Cloud Shell Editor to your home directory.

  2. In the Cloud Shell Editor action bar, click View > Terminal.

    Note: You may have to lengthen your browser window or click More options (More options icon) to see the View menu option.

Use this window as your IDE, with both the Cloud Shell Editor (top) and the Cloud Shell Terminal (bottom), for the remainder of this lab.

Close any additional tutorial or Gemini panels that appear on the right side of the screen to save more of your window for your code editor.

  1. In the terminal, enter the following command to set up your project:

    gcloud config set project {{{primary_project.project_id | filled in at lab start}}}

    Expected output: You should get an output message confirming the updated property.

  2. In the terminal, run the following commands to download and extract the boilerplate code files:

    gcloud storage cp gs://{{{primary_project.project_id | filled in at lab start}}}-labconfig-bucket/labs_code.zip . unzip labs_code.zip
  3. Run the following to create the environment variables:

    cd ~/zoo_guide_agent cat <<EOF > .env MODEL="{{{primary_project.startup_script.gemini_flash_model_id |filled in at lab start}}}" SERVICE_ACCOUNT="{{{primary_project.startup_script.project_number | filled in at lab start}}}-compute@developer.gserviceaccount.com" MCP_SERVER_URL="https://{{{primary_project.startup_script.mcp_server_name | filled in at lab start}}}-{{{primary_project.startup_script.project_number | filled in at lab start}}}.{{{primary_project.default_region | filled in at lab start}}}.run.app/mcp/" GOOGLE_GENAI_USE_ENTERPRISE=1 GOOGLE_CLOUD_PROJECT={{{primary_project.project_id | filled in at lab start}}} PROJECT_NUMBER={{{primary_project.startup_script.project_number | filled in at lab start}}} GOOGLE_CLOUD_LOCATION={{{primary_project.default_region | filled in at lab start}}} EOF

    Your final directory structure should look similar to the following.

    Output:

    . ├── mcp-on-cloudrun │ ├── Dockerfile │ ├── local_mcp_call.py │ ├── pyproject.toml │ ├── server.py │ └── uv.lock └── zoo_guide_agent ├── agent.py ├── __init__.py ├── .env └── requirements.txt
  4. Finally, enable the necessary APIs—Agent Platform API, Artifact Registry API, Compute Engine API, Cloud Build API, and Cloud Run Admin API.

Click Check my progress to verify the objective. Enable the necessary APIs

Task 2. Perform the necessary policy bindings (IAM setup)

The automated services (Cloud Build and Cloud Run) need specific permissions to interact with each other and the AI Platform.

In this task, you must perform the necessary policy bindings to give the user/service account permissions to invoke Cloud Run and use the AI Platform.

You need to grant the following IAM roles to the respective service accounts:

  • Grant the Cloud Run Admin and Agent Platform User role to user to allow it to deploy services to Cloud Run.

Click Check my progress to verify the objective. Perform the necessary policy bindings

Task 3. Fix and deploy the MCP server to Cloud Run

In this task, you must use the Gemini CLI to troubleshoot and revitalize the MCP server, which acts as the application's backbone and orchestrates AI tool use.

Once you've fixed the problem(s) in the code, ensure you use the relevant Cloud Build integration command in the Gemini CLI to deploy the preexisting, remote MCP server to the Gemini CLI repository for testing.

Deploy and test locally

  1. In the terminal, execute the following commands to run ~/mcp-on-cloudrun/server.py:

    cd ~/mcp-on-cloudrun uv run server.py

    You will get an error; you need to fix that error using Gemini in Cloud Shell.

    Note: Gemini CLI may take some time to update and make code changes in the actual Python file. If the Gemini CLI asks for your permission to execute the Python file that it has fixed, press ESC to cancel, and exit the Gemini CLI to return to the terminal. Then perform the lab steps that follow to proceed with the lab.
  2. Once the error is fixed, re-run the previous command. It should start the MCP server locally and you should get output confirming that.

  1. Open another terminal instance and run ~/mcp-on-cloudrun/local_mcp_call.py to test the locally deployed agent:

    Note: If you get a google.logging.v2.WriteLogEntriesPartialErrors error, set your project using the gcloud config set project command. gcloud config set project {{{primary_project.project_id | filled in at lab start}}} cd ~/mcp-on-cloudrun uv run local_mcp_call.py

    Expected output: The resulting output, presented as a CallToolResult, should show the successful retrieval of structured data about the walrus species.

Click Check my progress to verify the objective. MCP deploy and test locally

Deploy to Cloud Run

Note: You need to authorize Cloud Shell during the deployment process if prompted.
  • Run the following gcloud command to deploy the application to Cloud Run:

    cd ~/mcp-on-cloudrun gcloud run deploy {{{primary_project.startup_script.mcp_server_name | filled in at lab start}}} \ --no-allow-unauthenticated \ --region={{{primary_project.default_region | filled in at lab start}}} \ --source=. \ --min=1 \ --project={{{primary_project.project_id | filled in at lab start}}} \ --labels=lab-dev=mcp-zoo-cloud-run-service
Note: Deployment can take up to 10 minutes. If you encounter a Quota exceeded for total allowable CPU per project per region error during the Cloud Run deployment, please wait a moment and retry the command.

Click Check my progress to verify the objective. MCP deploy to Cloud Run

Task 4. Update the agent to use MCP

In this task, you deploy your Python Agent code and link it to the newly deployed MCP server.

Using the ADK commands within the Gemini CLI, deploy the local (updated) agent.py file. Configure this deployment to use the MCP Server deployed in Task 3, making the zoo tour guide operational within your local CLI environment.

Generate tokens and configure the settings.json file

  1. Save your Google Cloud credentials and project number in environment variables for use in the Gemini settings file:

    export PROJECT_NUMBER=$(gcloud projects describe $GOOGLE_CLOUD_PROJECT --format="value(projectNumber)") export ID_TOKEN=$(gcloud auth print-identity-token)
Note: If you get an authentication error in Gemini CLI, your ID_TOKEN may have expired. Exit with /quit and set your project using the gcloud config set project command.
  1. In the Cloud Shell Editor, select View > Toggle hidden files, and open or create the ~/.gemini/settings.json file so you can update it. Populate the file contents with the following Gemini CLI settings to add the Cloud Run MCP server:

    { "mcpServers": { "zoo-remote": { "httpUrl": "https://{{{primary_project.startup_script.mcp_server_name | filled in at lab start}}}-{{{primary_project.startup_script.project_number | filled in at lab start}}}.{{{primary_project.default_region | filled in at lab start}}}.run.app/mcp/", "headers": { "Authorization": "Bearer $ID_TOKEN" } } }, "selectedAuthType": "compute-default-credentials", "hasSeenIdeIntegrationNudge": true }

Open the Gemini CLI

Perform the steps that follow to open the Gemini CLI.

  1. In the terminal, run the command to launch the Gemini CLI.

    You may need to press ENTER to accept some default settings. gemini-cli-landing-screen.png

  2. Use the relevant slash command to have Gemini list the MCP tools available to it within its context.

  1. Ask Gemini to find something in the zoo:

    Where can I find penguins?

    The Gemini CLI should know to use the zoo-remote MCP server and should ask if you allow execution of the MCP tool.

  2. Choose to always allow all tools from the zoo-remote MCP server.

    Expected output: The output should show the correct answer and a display box showing that the MCP server was used.

  1. Prompt the Gemini CLI as follows to use the new custom command that you created:

    /find --animal="lion"

    Expected output: You should see that Gemini CLI calls the fetch_animals_by_species tool and formats the response as instructed by the MCP prompt.

  1. When you are ready to end your session, exit Gemini CLI using the relevant command or keyboard shortcuts.

Verify server logs

  • In the terminal, enter the following to verify the server logs:

    gcloud run services logs read {{{primary_project.startup_script.mcp_server_name | filled in at lab start}}} --region {{{primary_project.default_region| filled in at lab start}}} --limit=5

    Expected output: You should see an output log that confirms a tool call was made. 🛠️

Click Check my progress to verify the objective. Update the agent to use MCP and verify

Task 5. Dockerize and deploy the ADK agent to Cloud Run

For the final task, you must move the entire system from your local testing environment to a scalable, production-ready serverless environment.

You need to containerize the complete ADK application, including the MCP server and the Zoo Tour Guide agent that has Google Search integrated, and deploy the resulting container image(s) to Google Cloud Run. You must ensure the service is configured for public invocation and confirm the agent is responsive at its public URL.

Deploy and test locally

  1. Open ~/zoo_guide_agent/agent.py, review the TODO comments, and update the code accordingly to complete the agent setup.

  2. Run the following commands to install the package zoo_guide_agent:

    gcloud config set project {{{primary_project.project_id | filled in at lab start}}} cd ~/zoo_guide_agent python -m venv .venv source .venv/bin/activate pip install --no-cache-dir -r requirements.txt
  3. Run the following to deploy the ADK agent locally:

    cd ~ adk web
  4. In Cloud Shell, CTRL+click the http://localhost:8000 or http://127.0.0.1:8000 link to open the ADK dev UI in a new browser tab.

  5. In the ADK dev UI, select the zoo_guide_agent, and ask it the following query:

    Where can I find bears?

    Expected output: You should see events for all function calls, and a resolution to your query that combines information from all sources. The agent should also provide an approximate count of the number of species available globally.

Note: It may take some time to consolidate the actual agent response.

Click Check my progress to verify the objective. Deploy the ADK Agent locally

Deploy to Cloud Run

  • In the terminal, terminate the local ADK web instance by hitting Ctrl+C twice, and run the following commands to deploy your agent:

    cd ~/zoo_guide_agent adk deploy cloud_run \ --project={{{primary_project.project_id | filled in at lab start}}} \ --region={{{primary_project.default_region| filled in at lab start}}} \ --service_name={{{primary_project.startup_script.adk_server_name | filled in at lab start}}} \ --with_ui \ . \ -- \ --labels=lab-dev=cloud-zoo-run-adk-service
Note: It may take 15 minutes on average for the deployment to complete. If you get prompted to confirm if you allow unauthenticated invocations, ENTER y to proceed.

Click Check my progress to verify the objective. Deploy the ADK Agent on Cloud Run

Verify the deployed ADK agent

With your agent now live on Cloud Run, perform a test to confirm a successful deployment and to verify that the agent is working as expected. Use the public Service URL to access the ADK's web interface and interact with the agent.

  1. Once the agent has successfully been deployed to Cloud Run, CTRL+click the Service URL in the output to open it in a new browser tab.

It should resemble the following format.

Service URL output:

https://{{{primary_project.startup_script.adk_server_name | filled in at lab start}}}-{{{primary_project.startup_script.project_number | filled in at lab start}}}.{{{primary_project.default_region | filled in at lab start}}}.run.app/

Because you used the --with_ui flag while deploying to Cloud Run, you should see the ADK developer UI.

  1. Toggle Token Streaming to On in the upper right.

  2. Interact with the zoo agent. Enter the query that follows to start a new conversation:

    Where can I find elephants?

    Expected output: You should see events for all function calls with a resolution to your query that combines information from all sources. The agent should also provide an approximate count of the number of species available globally.

Note: It may take some time to consolidate the actual agent response.

Click Check my progress to verify the objective. Verify the deployed ADK Agent

Congratulations!

In this lab, you demonstrated your ability to use Gemini CLI with Google Cloud Run and Cloud Build to configure, test, and deploy an enhanced and functional "zoo tour guide" ADK Agent. By ensuring the Agent can interact with a dedicated MCP Server and built-in tools, this significantly improves and streamlines the handling of zoo visitor queries and animal lookups as part of Cloud Creek Zoo's digital transformation efforts.

Build a Smart Cloud Application with Vibe Coding and MCP Skill Badge

Next steps / Learn more

Check out the following resources to learn more about Gen AI and the Gemini Enterprise Agent Platform:

Google Cloud training and certification

...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.

Manual Last Updated May 18, 2026

Lab Last Tested January 28, 2026

Copyright 2026 Google LLC. All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.

Avant de commencer

  1. Les ateliers créent un projet Google Cloud et des ressources pour une durée déterminée.
  2. Les ateliers doivent être effectués dans le délai imparti et ne peuvent pas être mis en pause. Si vous quittez l'atelier, vous devrez le recommencer depuis le début.
  3. En haut à gauche de l'écran, cliquez sur Démarrer l'atelier pour commencer.

Utilisez la navigation privée

  1. Copiez le nom d'utilisateur et le mot de passe fournis pour l'atelier
  2. Cliquez sur Ouvrir la console en navigation privée

Connectez-vous à la console

  1. Connectez-vous à l'aide des identifiants qui vous ont été attribués pour l'atelier. L'utilisation d'autres identifiants peut entraîner des erreurs ou des frais.
  2. Acceptez les conditions d'utilisation et ignorez la page concernant les ressources de récupération des données.
  3. Ne cliquez pas sur Terminer l'atelier, à moins que vous n'ayez terminé l'atelier ou que vous ne vouliez le recommencer, car cela effacera votre travail et supprimera le projet.

Ce contenu n'est pas disponible pour le moment

Nous vous préviendrons par e-mail lorsqu'il sera disponible

Parfait !

Nous vous contacterons par e-mail s'il devient disponible

Un atelier à la fois

Confirmez pour mettre fin à tous les ateliers existants et démarrer celui-ci

Utilisez la navigation privée pour effectuer l'atelier

Le meilleur moyen d'exécuter cet atelier consiste à utiliser une fenêtre de navigation privée. Vous éviterez ainsi les conflits entre votre compte personnel et le compte temporaire de participant, qui pourraient entraîner des frais supplémentaires facturés sur votre compte personnel.

Effectuez cette étape rapide pour démarrer votre atelier.