Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions agentregistry/gke/agent-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START agentregistry_gke_agent_manifest]
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-agent
labels:
# GKE takes this label and registers the agent to Agent Registry
registry.gke.io/functional-type: "AGENT"
annotations:
# A2A protocol metadata annotation for automated Agent Card discovery
a2a-protocol.org/agent-card: |
card:
endpoint: /.well-known/agent-card.json
protocol: HTTP
port: 8080
spec:
selector:
matchLabels:
app: my-agent
template:
metadata:
labels:
app: my-agent
annotations:
# Agent Identity annotation for identity and access management
iam.gke.io/spiffe-identity-type: agent-identity
spec:
containers:
- name: server
image: gcr.io/PROJECT_ID/my-agent:1.0.0

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit (non-blocking): Both GKE manifests match our current docs accurately! Just flagging for a future follow-up (not blocking this migration): gcr.io/PROJECT_ID/... uses legacy Container Registry, so we should consider migrating both the docs and these manifests to Artifact Registry (REGION-docker.pkg.dev/...) in a separate pass.

ports:
- containerPort: 8080
env:
- name: PORT
value: "8080"
---
# Kubernetes Service for in-cluster network routing to the agent pod
apiVersion: v1
kind: Service
metadata:
name: my-agent-service
labels:
app: my-agent
spec:
type: ClusterIP
ports:
- port: 8080
targetPort: 8080
protocol: TCP
name: http
selector:
app: my-agent
# [END agentregistry_gke_agent_manifest]
47 changes: 47 additions & 0 deletions agentregistry/gke/mcp-server-deployment.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
# Copyright 2026 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# [START agentregistry_gke_mcp_server_manifest]
apiVersion: apps/v1
kind: Deployment
metadata:
name: my-mcp-server
labels:
# GKE takes this label and registers the deployment as an MCP server
registry.gke.io/functional-type: "MCP_SERVER"
annotations:
# Endpoint URLs where the GKE controller can access this MCP server
modelcontextprotocol.info/urls: |
- https://my-mcp-server.default.svc.cluster.local/mcp
# Defines structural capabilities for the MCP server card
modelcontextprotocol.info/capabilities: |
card:
endpoint: "/mcp"
protocol: "HTTP"
Comment on lines +24 to +31

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The URL in modelcontextprotocol.info/urls uses https://, which typically requires configuring TLS certificates inside the container. For a basic GKE sample, using http:// is more standard and simplifies deployment. Consider changing the scheme to http.

    # Endpoint URLs where the GKE controller can access this MCP server
    modelcontextprotocol.info/urls: |
      - http://my-mcp-server.default.svc.cluster.local/mcp
    # Defines structural capabilities for the MCP server card
    modelcontextprotocol.info/capabilities: |
      card:
        endpoint: "/mcp"
        protocol: "HTTP"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applying this change: this manifest is extracted from the published Agent Registry GKE documentation (register-mcp-servers.md), which uses https://my-mcp-server.default.svc.cluster.local/mcp alongside iam.gke.io/spiffe-identity-type: agent-identity. Keeping https:// preserves parity with the documented example.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 from the TW side — keeping exact parity with register-mcp-servers.md makes sense for this migration PR.

spec:
selector:
matchLabels:
app: my-mcp-server
template:
metadata:
labels:
app: my-mcp-server
annotations:
# Agent Identity annotation for identity and access management
iam.gke.io/spiffe-identity-type: agent-identity
spec:
containers:
- name: server
image: gcr.io/PROJECT_ID/my-mcp-server:1.0.0
# [END agentregistry_gke_mcp_server_manifest]
Comment on lines +43 to +47

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The deployment defines an in-cluster URL my-mcp-server.default.svc.cluster.local but does not define a corresponding Kubernetes Service or expose any container ports. Without a Service, the GKE controller and other in-cluster clients will not be able to route traffic to the MCP server pod. Consider exposing port 8080 on the container and adding a Service named my-mcp-server to route traffic.

    spec:
      containers:
      - name: server
        image: gcr.io/PROJECT_ID/my-mcp-server:1.0.0
        ports:
        - containerPort: 8080
---
# Kubernetes Service for in-cluster network routing to the MCP server pod
apiVersion: v1
kind: Service
metadata:
  name: my-mcp-server
  labels:
    app: my-mcp-server
spec:
  type: ClusterIP
  ports:
  - port: 80
    targetPort: 8080
    protocol: TCP
    name: http
  selector:
    app: my-mcp-server
# [END agentregistry_gke_mcp_server_manifest]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not applying this change: this sample intentionally mirrors the focused GKE deployment manifest for an MCP server snippet in register-mcp-servers.md, which illustrates only the Deployment labels and modelcontextprotocol.info/* / iam.gke.io/* annotations required for Agent Registry registration (unlike agent-deployment.yaml, which explicitly includes a Service). Keeping it scoped to the Deployment avoids diverging from the doc walkthrough.

32 changes: 32 additions & 0 deletions agentregistry/specs/agent-card.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"supportedInterfaces": [
{
"url": "https://example.com/mock-travel-agent",
"protocolBinding": "HTTP+JSON",
"protocolVersion": "1.0.0"
}
],
"name": "mock-travel-agent",
"description": "A mock agent that plans travel itineraries.",
"version": "1.0.0",
"capabilities": {
"streaming": false,
"pushNotifications": false
},
"defaultInputModes": ["text/plain"],
"defaultOutputModes": ["text/plain"],
"skills": [
{
"id": "BookFlight",
"name": "BookFlight",
"description": "Books a flight to a destination.",
"tags": ["travel", "booking"]
},
{
"id": "SearchHotels",
"name": "SearchHotels",
"description": "Searches for hotels in a destination city.",
"tags": ["travel", "accommodation"]
}
]
}
23 changes: 23 additions & 0 deletions agentregistry/specs/toolspec.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"tools": [
{
"name": "get_customer_info",
"description": "Retrieves customer details from the database.",
"annotations": {
"title": "Get Customer Info",
"readOnlyHint": true,
"idempotentHint": true
}
},
{
"name": "create_support_ticket",
"description": "Creates a new support ticket in the issue tracking system.",
"annotations": {
"title": "Create Support Ticket",
"destructiveHint": true,
"idempotentHint": false,
"openWorldHint": true
}
}
Comment on lines +13 to +21

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

issue (blocking): This is missing the _meta / com.googleapis.iap/PolicyHints block on create_support_ticket that's currently in register-mcp-servers.md:

      "_meta": {
        "com.googleapis.iap/PolicyHints": {
          "authorization": {
            "toolDisabled": false,
            "hitlMode": "HITL_MODE_ALWAYS"
          }
        }
      }

The two paragraphs immediately below the snippet in register-mcp-servers.md explicitly walk through _meta, com.googleapis.iap/PolicyHints, toolDisabled, and hitlMode, so we need to keep that block in toolspec.json to preserve parity with the doc.

]
}