Model Context Protocol (MCP) standardizes the way large language models (LLMs) and AI applications or agents connect to outside data sources. MCP servers let you use their tools, resources, and prompts to take actions and get updated data from their backend service.
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 on MCP architecture, see MCP architecture.
This document describes how to use the GKE remote Model Context Protocol (MCP) server to connect to GKE from AI applications such as Gemini CLI, agent mode in Gemini Code Assist, Claude Code, or in AI applications you're developing.
For information on the GKE local MCP server, see GKE MCP server on GitHub.
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.
You might want to use the GKE local MCP server for the following reasons:
- Local development and testing
- Offline MCP use
- Cluster and workload creation, including manifest generation for AI/ML workloads
- Local client configuration (using
kubeconfig) - Query logs
- Get cost and security recommendations for your GKE environment
For more information about how to use our local MCP server, see GKE MCP server. The following sections only apply to the GKE remote MCP server.
Before you begin
- 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.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
Create or select 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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_IDwith a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_IDwith your Google Cloud project name.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Kubernetes Engine API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.gcloud services enable container.googleapis.com
-
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/container.clusterViewergcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID: Your project ID.USER_IDENTIFIER: The identifier for your user account. For example,myemail@example.com.ROLE: The IAM role that you grant to your user account.
-
Install the Google Cloud CLI.
-
If you're using an external identity provider (IdP), you must first sign in to the gcloud CLI with your federated identity.
-
To initialize the gcloud CLI, run the following command:
gcloud init -
Create or select 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 theresourcemanager.projects.createpermission. Learn how to grant roles.
-
Create a Google Cloud project:
gcloud projects create PROJECT_ID
Replace
PROJECT_IDwith a name for the Google Cloud project you are creating. -
Select the Google Cloud project that you created:
gcloud config set project PROJECT_ID
Replace
PROJECT_IDwith your Google Cloud project name.
-
Verify that billing is enabled for your Google Cloud project.
-
Enable the Kubernetes Engine API:
Roles required to enable APIs
To enable APIs, you need the Service Usage Admin IAM role (
roles/serviceusage.serviceUsageAdmin), which contains theserviceusage.services.enablepermission. Learn how to grant roles.gcloud services enable container.googleapis.com
-
Grant roles to your user account. Run the following command once for each of the following IAM roles:
roles/container.clusterViewergcloud projects add-iam-policy-binding PROJECT_ID --member="user:USER_IDENTIFIER" --role=ROLE
Replace the following:
PROJECT_ID: Your project ID.USER_IDENTIFIER: The identifier for your user account. For example,myemail@example.com.ROLE: The IAM role that you grant to your user account.
Required roles
To perform the one-time setup of enabling the GKE remote MCP server, an administrator needs the following roles:
- Organization Policy Administrator (
roles/orgpolicy.policyAdmin): Grant this role on your Google Cloud organization to allow the creation of custom organization policies. - Service Usage Admin (
roles/serviceusage.serviceUsageAdmin): Grant this role on your Google Cloud project to allow enabling the remote MCP service endpoint. This role includes theserviceusage.mcppolicy.getandserviceusage.mcppolicy.updatepermissions.
For more information about granting roles, see Manage access to projects, folders, and organizations.
Roles for using the service
The principal that makes calls to the remote MCP server tools needs permissions to access GKE resources. This principal can be a human user or an automated service account. At a minimum, grant the following role on your Google Cloud project:
- MCP Tool User (
roles/mcp.toolUser): Grants permission to make tool calls to the MCP server endpoint. - Kubernetes Engine Cluster Viewer (
roles/container.clusterViewer): This role provides the read-only access needed for the remote server's tools.
Grant this role to:
- A user account when a person is interacting with the MCP server through a client like the Gemini CLI.
- A service account when building an autonomous agent or application that calls the MCP server.
Enable or disable the GKE remote MCP server
You can enable or disable the GKE remote MCP server
in a project with the gcloud beta services mcp enable command. For more
information, see the following sections.
Enable the GKE remote MCP server in a project
If you are using different projects for your client credentials, such as service account keys, OAuth client ID or API keys, and for hosting your resources, then you must enable the GKE service and the GKE remote MCP server on both projects.
To enable the GKE remote MCP server in your Google Cloud project, run the following command:
gcloud beta services mcp enable container.googleapis.com \
--project=PROJECT_ID
Replace PROJECT_ID with the Google Cloud project ID.
The GKE remote MCP server is enabled for use in your Google Cloud Project. If the GKE service isn't enabled for your Google Cloud project, you are prompted to enable the service before enabling the GKE remote MCP server.
As a security best practice, we recommend that you enable MCP servers only for the services required for your AI application to function.
Disable the GKE remote MCP server in a project
To disable the GKE remote MCP server in your Google Cloud project, run the following command:
gcloud beta services mcp disable SERVICE \
--project=PROJECT_ID
The GKE remote MCP server is disabled for use in your Google Cloud Project.
Authentication and authorization
GKE remote MCP servers use 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 GKE remote MCP server does not accept API keys for authentication.
We recommend creating a separate identity for agents using MCP tools so that access to resources can be controlled and monitored. For more information on authentication, see Authenticate to MCP servers.
GKE remote 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.
GKE has the following MCP tool OAuth scopes:
| Scope URI for gcloud CLI | Description |
|---|---|
https://www.googleapis.com/auth/cloud-platform |
Grants broad, read-only access to your Google Cloud projects. |
Additional scopes might be required on the resources accessed during a tool call. To view a list of scopes required for GKE, see GKE API.
Configure an MCP client to use the GKE MCP server
Host programs, such as Claude or Gemini CLI, can instantiate MCP clients that connect to a single MCP server. A host program can have multiple clients that connect to different MCP servers. To connect to a remote MCP server, the MCP client must know at a minimum the URL of the remote MCP server.
In your host, look for a way to connect to a remote MCP server. You are prompted to enter details about the server, such as its name and URL.
For the GKE remote MCP server, enter the following as required:
- Server name: GKE remote MCP server
- Server URL or Endpoint: https://container.googleapis.com/mcp
- Transport: 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 on authentication, see Authenticate to MCP servers.
For host specific guidance, see the following:
For more general guidance, see Connect to remote MCP servers.
Available tools
MCP Tools that are read-only have
the MCP attribute mcp.tool.isReadOnly set to true. You might want to only
allow read-only tools in certain environments through your
organization policy.
To view details of available MCP tools and their descriptions for the GKE MCP server, see the GKE MCP reference.
List tools
Use the MCP inspector to list tools, or send a
tools/list HTTP request directly to the GKE
remote MCP server. The tools/list method doesn't require authentication.
POST /mcp HTTP/1.1
Host: container.googleapis.com
Content-Type: application/json
{
"jsonrpc": "2.0",
"method": "tools/list",
}
Sample use cases
The following are sample use cases for the GKE remote MCP server:
- Inspect the configuration and status of your GKE clusters and node pools. For example, use the prompt: "Show me the details of my 'production-cluster' and list all of its node pools."
- View Kubernetes resource configurations and container logs from within a cluster without using kubectl. For example, use the prompt: "Get the YAML for the 'frontend-deployment' in the 'default' namespace."
- Monitor the status of long-running GKE operations, such as cluster upgrades. For example, use the prompt: "List all the GKE operations in my project from the last hour."
Optional security and safety configurations
MCP introduces new security risks and considerations due to the wide variety of actions that can be taken with MCP tools. To minimize and manage these risks, Google Cloud offers defaults 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.
Model Armor
Model Armor is a Google Cloud service designed to enhance the security and safety of your AI applications. It works by proactively screening LLM prompts and responses, protecting against various risks and supporting responsible AI practices. Whether you are deploying AI in your cloud environment, or on external cloud providers, Model Armor can help you prevent malicious input, verify content safety, protect sensitive data, maintain compliance, and enforce your AI safety and security policies consistently across your diverse AI landscape.
Model Armor is only available in specific regional locations. If Model Armor is enabled for a project, and a call to that project comes from an unsupported region, Model Armor makes a cross-regional call. For more information, see Model Armor locations.
Enable Model Armor
To enable Model Armor, complete the following steps:
To enable Model Armor on your Google Cloud project, run the following gcloud CLI command:
gcloud services enable modelarmor.googleapis.com \ --project=PROJECT_IDReplace
PROJECT_IDwith your Google Cloud project ID.To configure the recommended floor settings for Model Armor, run the following gcloud CLI command:
gcloud model-armor floorsettings update \ --full-uri='projects/PROJECT_ID/locations/global/floorSetting' \ --mcp-sanitization=ENABLED \ --malicious-uri-filter-settings-enforcement=ENABLEDReplace
PROJECT_IDwith your Google Cloud project ID.Model Armor is configured to scan for malicious URLs attempts.
For more information about configurable Model Armor filters, see Model Armor filters.
To add Model Armor as a content security provider for MCP services, run the following gcloud CLI command:
gcloud beta services mcp content-security add modelarmor.googleapis.com \ --project=PROJECT_IDReplace
PROJECT_IDwith the Google Cloud project ID.To confirm that MCP traffic is sent to Model Armor, run the following command:
gcloud beta services mcp content-security get \ --project=PROJECT_IDReplace
PROJECT_IDwith the Google Cloud project ID.
Model Armor logging
For information about Model Armor audit and platform logs, see Model Armor audit logging.
Disable Model Armor in a project
To disable Model Amor on a Google Cloud project, run the following command:
gcloud beta services mcp content-security remove modelarmor.googleapis.com \
--project=PROJECT_ID
Replace PROJECT_ID with the
Google Cloud project ID.
MCP traffic on Google Cloud won't be scanned by Model Armor for the specified project.
Disable scanning MCP traffic with Model Armor
If you still want to use Model Armor in a project, but you want to stop scanning MCP traffic with Model Armor, then run the following command:
gcloud model-armor floorsettings update \
--full-uri='projects/PROJECT_ID/locations/global/floorSetting' \
--mcp-sanitization=DISABLED
Replace PROJECT_ID with the
Google Cloud project ID.
Model Armor won't scan MCP traffic on Google Cloud.
Organization level MCP control
You can create custom organization policies to control the use of MCP servers
in your Google Cloud organization using the
gcp.managed.allowedMCPService constraint. For more information and
usage examples, see
Google Cloud MCP servers Access control with IAM.
What's next
- Read the GKE remote MCP reference documentation.
- Learn more about Google Cloud MCP servers.