Skip to main content

Google Compute Engine

Google hosts the Compute Engine MCP server at https://compute.googleapis.com/mcp over streamable HTTP. The Official card pre-fills that URL. It is the Google Compute Engine card with the Official badge.

Enabling the Compute Engine API on a project turns the server on for that project. Tool calls use OAuth 2.0 and Identity and Access Management, as the Google identity that minted the access token. The card sends that token as Authorization: Bearer <token>.

A tool call might be routed through any region.

Before you start​

  • A Google Cloud project with the Compute Engine API enabled. Enabling an API needs the Owner role or Service Usage Admin (roles/serviceusage.serviceUsageAdmin).
  • On that project, the identity behind the token needs:
  • serviceusage.services.use on the project you send as the quota project (x-goog-user-project).

Google recommends a separate identity for agents so access can be limited and audited.

gcloud auth print-access-token has no scopes flag. It prints a token for the active gcloud account, with the scopes from that sign-in. Compute Engine documents these MCP scopes:

  • https://www.googleapis.com/auth/compute.read-only — read data
  • https://www.googleapis.com/auth/compute.read-write — read and change data

A tool call can also need another scope from the Compute Engine API.

Create an access token​

Google's bearer-token method prints a token for the account signed in to the gcloud CLI. Access tokens for a user account last one hour.

  1. Sign in if gcloud has no active account: gcloud auth login.
  2. Print a token: gcloud auth print-access-token.
  3. Copy the token. When it expires, print a new one and paste it again. The value saved in Willow stays until you replace it.

--lifetime changes that lifetime only together with --impersonate-service-account. Extending it past one hour, up to 12 hours (43200 seconds), also needs the organization policy constraints/iam.allowServiceAccountCredentialLifetimeExtension.

Set up Willow​

  1. Go to MCP Servers → + Add MCP server, open the Google Compute Engine card with the Official badge, and click + Use.
  2. Keep API key. Paste the access token from the step above.
    • One shared — leave Scheme as Bearer and paste the token itself. Willow keeps it in the vault and sends Authorization: Bearer <token> on every request. Everyone who uses this server shares that identity until the token expires.
    • Each person's own — each person pastes Bearer <token>, including the word Bearer, the first time they connect. Willow sends that value as the Authorization header and does not add a prefix.
  3. Open the Settings tab. Under Request → Headers, click Add Header. Set the name to x-goog-user-project and the value to the Google Cloud project ID. Google's bearer-token setup sends this quota project with the token.
  4. Click Check connection. Assign groups and Publish.

Listing tools does not require a token. A tool call does.

Troubleshooting​

The error says the API has not been used, or names another project​

Cause: The call has no quota project, or the Compute Engine API is off on the project in x-goog-user-project. gcloud describes this as the API not having been used in that project, or being disabled.

Solution: Enable the Compute Engine API on that project, set x-goog-user-project to its project ID, and confirm the identity has serviceusage.services.use there.

A tool call returns a permission error​

Cause: The identity is missing mcp.tools.call, or a Compute Engine permission named in the error.

Solution: Grant MCP Tool User on the project, then grant the Compute Engine role that includes the permission in the error.

Calls fail about an hour after you pasted the token​

Cause: The access token expired. Willow keeps the saved value until you replace it.

Solution: Run gcloud auth print-access-token again and paste the new token. On Each person's own, include the Bearer prefix.

The tool list succeeds and a tool call has no credential​

Cause: tools/list does not require authentication. A tool call does.

Solution: Paste a current access token under API key. On One shared, leave Scheme as Bearer. On Each person's own, paste Bearer plus the token.

Additional Resources​