Use the Service Metadata API remote MCP server

This document shows you how to use the Service Metadata API remote Model Context Protocol (MCP) server to connect with AI applications including Gemini CLI, ChatGPT, Claude, and custom applications you are developing. The Service Metadata API remote MCP server lets your AI applications and agents securely list and inspect Google Cloud location metadata, such as available regions and zones.

The Service Metadata API remote MCP server is enabled when you enable the Service Metadata API.

Model Context Protocol (MCP) standardizes how large language models (LLMs) and AI applications or agents connect to external data sources. MCP servers let you use their tools, resources, and prompts to take actions and get updated data from their backend service.

What's the difference between local and remote MCP servers?

Local MCP servers
Typically run on your local machine and use the standard input and output streams (stdio) for communication between services on the same device.
Remote MCP servers
Run on the service's infrastructure and offer an HTTP endpoint to AI applications for communication between the AI MCP client and the MCP server. For more information about MCP architecture, see MCP architecture.

Stateless core

With MCP version 2026-07-28, MCP changes from a bidirectional, stateful protocol to a stateless protocol. Each MCP request is self-describing and can be routed using headers. There isn't a need for the initialize/initialized handshake or Mcp-Session-Id because each request includes all the information needed in HTTP headers or the _meta parameter. MCP servers can request additional information required by a tool through multi-round-trip requests (MRTR).

To help route and process requests without parsing the request body, some MCP headers are required, including the following:

  • Headers that are required by the MCP specification such as the protocol version header and standard request headers.
  • Custom headers that are defined by the MCP server. These headers are mirrored into HTTP headers from the tool's input schema using the x-mcp-header property. For example, an MCP server might define a custom header to specify the Google Cloud region or project ID.

For more information about MCP architecture, see the MCP version 2026-07-28 specification and key changes.

Google and Google Cloud remote MCP servers

Google and Google Cloud remote MCP servers have the following features and benefits:

  • Simplified, centralized discovery
  • Managed global or regional HTTP endpoints
  • Fine-grained authorization
  • Optional prompt and response security with Model Armor protection
  • Centralized audit logging

For information about other MCP servers and information about security and governance controls available for Google Cloud MCP servers, see Google Cloud MCP servers overview.

Before you begin

  1. Sign in to your Google Cloud account. If you're new to Google Cloud, create an account to evaluate how our products perform in real-world scenarios. New customers also get $300 in free credits to run, test, and deploy workloads.
  2. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  3. Verify that billing is enabled for your Google Cloud project.

  4. Enable the Service Metadata API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

  5. In the Google Cloud console, on the project selector page, select or create a Google Cloud project.

    Roles required to select or create a project

    • Select a project: Selecting a project doesn't require a specific IAM role—you can select any project that you've been granted a role on.
    • Create a project: To create a project, you need the Project Creator role (roles/resourcemanager.projectCreator), which contains the resourcemanager.projects.create permission. Learn how to grant roles.

    Go to project selector

  6. Verify that billing is enabled for your Google Cloud project.

  7. Enable the Service Metadata API, if it is not already enabled.

    Roles required to enable APIs

    To enable APIs, you need the serviceusage.services.enable permission. If you created the project, then you likely already have this permission through the Owner role (roles/owner). Otherwise, you can get this permission through the Service Usage Admin role (roles/serviceusage.serviceUsageAdmin). Learn how to grant roles.

    Enable the API

Required roles

To get the permissions that you need to use the Service Metadata API MCP server, ask your administrator to grant you the following IAM roles on the project where you want to use the Service Metadata API MCP server:

For more information about granting roles, see Manage access to projects, folders, and organizations.

These predefined roles contain the permissions required to use the Service Metadata API MCP server. To see the exact permissions that are required, expand the Required permissions section:

Required permissions

The following permissions are required to use the Service Metadata API MCP server:

  • Make MCP tool calls: mcp.tools.call
  • Read and list locations:
    • cloud.locations.get
    • cloud.locations.list

You might also be able to get these permissions with custom roles or other predefined roles.

Authentication and authorization

The Service Metadata API remote MCP server uses the OAuth 2.0 protocol with Identity and Access Management (IAM) for authentication and authorization. All Google Cloud identities are supported for authentication to MCP servers.

The Service Metadata API remote MCP server requires authentication using OAuth 2.0 and doesn't accept API keys.

We recommend that you create a separate identity for agents that are using MCP tools so that access to resources can be controlled and monitored. For more information about authentication, see Authenticate to MCP servers.

Service Metadata API MCP OAuth scopes

OAuth 2.0 uses scopes and credentials to determine if an authenticated principal is authorized to take a specific action on a resource. For more information about OAuth 2.0 scopes at Google, read Using OAuth 2.0 to access Google APIs.

Service Metadata API requires the following MCP tool OAuth scope:

Scope URI for gcloud CLI Description
https://www.googleapis.com/auth/cloud-platform Allows access to view and manage Google Cloud resources.

Configure an MCP client to use the Service Metadata API MCP server

AI applications and agents, such as Claude or Antigravity, can instantiate an MCP client that connects to a single MCP server. An AI application can have multiple clients that connect to different MCP servers. If your application isn't listed in the client-specific guidance, then you can use the following information to connect from most applications.

In your AI application, look for a way to add or connect to a remote MCP server. For the Service Metadata API MCP server, enter the following information as required:

  • Server name: Service Metadata API MCP server
  • Server URL or Endpoint: https://cloud.googleapis.com/mcp
  • Transport: Streamable HTTP
  • Authentication details: Depending on how you want to authenticate, you can enter your Google Cloud credentials, your OAuth Client ID and secret, or an agent identity and credentials. For more information about authentication, see Authenticate to MCP servers.
  • OAuth scope: the OAuth 2.0 scope that you want to use when connecting to the Service Metadata API MCP server.

Redirect URIs

For web-based applications, and some desktop applications, you must allowlist a redirect URI when you create a client ID and secret for authentication. Redirect URIs are used by the authorization server to send tokens to your application. Your application's documentation should specify the redirect URI that you must use. Custom redirect URIs aren't supported.

For application-specific guidance about setting up and connecting to MCP server, see Client-specific guidance.

For more general guidance, see the following resources:

Available tools

To view details of available MCP tools and their descriptions for the Service Metadata API MCP server, see the Service Metadata API MCP reference.

List tools

Use the MCP inspector to list tools, or send a tools/list HTTP request directly to the Service Metadata API remote MCP server. The tools/list method doesn't require authentication.

POST /mcp HTTP/1.1
Host: cloud.googleapis.com
Content-Type: application/json

{
  "jsonrpc": "2.0",
  "method": "tools/list"
}

Example use cases

The following are example use cases for the Service Metadata API MCP server:

  • Listing available locations: Ask your agent to "List all Google Cloud locations available for my project."
  • Inspecting location details: Ask your agent to "Get metadata and details for the us-central1 location in my project."

Optional security and safety configurations

MCP introduces new security risks and considerations due to the wide variety of actions that you can do with the MCP tools. To minimize and manage these risks, Google Cloud offers default settings and customizable policies to control the use of MCP tools in your Google Cloud organization or project.

For more information about MCP security and governance, see AI security and safety.

Control MCP use with IAM policies

Identity and Access Management (IAM) deny policies and allow policies help you secure Google Cloud and Google MCP servers.

You can combine multiple criteria to build customized security and governance policies by allowing or denying access based on the following:

  • The principal.
  • Tool properties like the read-only attribute.
  • The service name or tool name.
  • The application's OAuth client ID.

For more information, see Control MCP use with Identity and Access Management.

What's next