At a glance
- Availability: Experimental (how to enable).
- Auth: OAuth 2.0.
- Connection: A user authorizes the connection in the provider’s consent screen.
- Scopes:
https://www.googleapis.com/auth/compute.readonly,https://www.googleapis.com/auth/run.readonly. - Optional scopes:
https://www.googleapis.com/auth/cloud-platform. - Docs: https://cloud.google.com/docs/authentication
Credentials
Set these per environment. See Connect an integration. With a managed OAuth app, Connect works without these variables; set them to use your own OAuth app instead.Setup
- Create or select a Google Cloud project: Go to https://console.cloud.google.com and create a project (new Google Cloud accounts include free-tier credit, and Compute Engine offers an always-free e2-micro instance in some US regions for testing).
- Enable the required APIs: Enable the Compute Engine API (https://console.cloud.google.com/apis/library/compute.googleapis.com), the Cloud Run Admin API (https://console.cloud.google.com/apis/library/run.googleapis.com), and the Cloud Functions API (https://console.cloud.google.com/apis/library/cloudfunctions.googleapis.com) for your project.
- Create OAuth credentials: In https://console.cloud.google.com/apis/credentials create an OAuth 2.0 Client ID (Web application) and add your callback URL as an authorized redirect URI. Store the values as GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET.
- Create test resources: Create a small VM instance (e2-micro) in Compute Engine and deploy a sample Cloud Run service so the list tools have something to return. Stop the VM when done to avoid charges.
- The default scopes are read-only (compute.readonly and run.readonly) and cover listing Compute Engine instances and Cloud Run services; listing Cloud Functions and starting or stopping VM instances require granting the optional cloud-platform scope during authorization.
- The signed-in user also needs IAM permissions on the project: roles/viewer covers the list tools, and roles/compute.instanceAdmin.v1 (or broader) is needed to start and stop instances.
- Start and stop return a zone operation immediately; the instance state changes asynchronously, so re-run List Compute Instances to confirm.
- Use ’-’ as the location to list Cloud Functions across all locations in one call (unreachable regions are reported in the ‘unreachable’ field); Cloud Run does not support the ’-’ wildcard, so list its services one region at a time.
- The Cloud Functions v2 API also returns 1st-gen functions, with the generation indicated by the ‘environment’ field.
Tools
Example prompts
- List my Compute Engine instances across all zones and summarize their machine types and power states.
- List my Cloud Run services and Cloud Functions in a region and summarize what is deployed.
- Find running Compute Engine instances and help me stop one that looks idle so it stops incurring charges.