Aller au contenu
Skillpedia
Connecteurs (MCP)22k · #10214

api-gateway-mcp-server

Ce qu’il fait

Cette skill aide les développeurs à exposer une API REST existante aux agents IA sous forme d'outils, à l'aide d'API Gateway de Google Cloud. Elle s'adresse aux équipes qui veulent que leurs agents utilisent leurs API actuelles sans les réécrire.

Quand l’utiliser

  • ✓Quand vous voulez que des agents IA utilisent une API REST existante via API Gateway de Google Cloud comme outils.
  • ✓Quand vous devez convertir une spécification OpenAPI 2.0 en OpenAPI 3.x pour qu'elle fonctionne comme serveur MCP.
  • ✓Quand vous voulez sécuriser la liste d'outils d'un serveur MCP avec des JWT ou des clés d'API.

Lien du skill

https://github.com/google/skills/blob/main/skills/cloud/api-gateway-mcp-server/SKILL.md

Copiez-le et collez-le dans votre IA (Claude, ChatGPT ou Cursor) en lui demandant de suivre les instructions.

Comment l’utiliser

Le plus simple : copiez le message et collez-le dans votre IA. Elle lit le skill et suit les instructions.

Message prêt à coller

Utilise ce skill pour m’aider : https://github.com/google/skills/blob/main/skills/cloud/api-gateway-mcp-server/SKILL.md Lis le fichier SKILL.md de ce lien et suis ses instructions pour ma tâche.
Envie que votre IA trouve seule des skills comme celui-ci ?Installez le MCP gratuit de Skillpedia : une ligne, et elle cherche parmi 15 000+ skills avant chaque tâche.Installer en 1 minute →

Exemple de demande à votre IA

“Transforme l'API existante de mon entreprise en outils qu'un agent IA peut utiliser via API Gateway de Google Cloud.”

5 nouveaux skills par semaine. 1 minute de lecture.

Comment ça marche

Elle ajoute des annotations MCP au fichier OpenAPI, pour que la passerelle transforme les requêtes de l'agent en appels normaux vers votre backend. Vos règles de connexion et de quota existantes restent en vigueur.

Contenu technique (SKILL.md original)

Texte original de l’auteur, en anglais, directement depuis GitHub.

API Gateway Remote MCP Server (Public Preview)

This skill converts new or existing REST APIs on Google Cloud API Gateway into remote Model Context Protocol (MCP) servers (POST https://{default_hostname}/mcp, Public Preview). By annotating an OpenAPI 3.x (3.0.x or 3.1.x) specification with x-google-api-management.mcp and x-google-mcp-tool, API Gateway translates MCP JSON-RPC 2.0 requests (initialize, notifications/initialized, tools/list, tools/call) into standard HTTP REST requests to your backend while enforcing existing authentication and quota policies.

Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read Usage Attribution. For commands executed directly in the terminal (never in generated scripts, Terraform, or user code), prefix gcloud with CLOUDSDK_METRICS_REQUEST_ATTRIBUTION="agent-skills/1.0 (skill:api-gateway-mcp-server)" and append agent-skills/1.0 (skill:api-gateway-mcp-server) to User-Agent headers.

Prerequisites

  1. Install the Google Cloud CLI and the validator dependency:
    • Install the Google Cloud CLI. Then update it to the latest version with gcloud components update. An old CLI can fail when it uploads an OpenAPI 3.x API config.
    • Install Python 3.10 or later and PyYAML for the local OpenAPI MCP validator script:
      pip install "PyYAML>=6.0,<7.0"
      
  2. Authenticate your environment:
    • Local CLI session: gcloud auth login
    • Application Default Credentials (SDKs / ADK): gcloud auth application-default login
  3. Select or create a project, confirm billing, and pick a supported gateway location:
    • Select an existing project (gcloud config set project {project_id}) or create one (gcloud projects create {project_id}).
    • Confirm that an active billing account is linked to {project_id}. API Gateway has a free monthly allowance of API calls for each billing account, but you still need an active billing account to deploy. Calls above the allowance and network data transfer out are charged. For current prices, see API Gateway pricing.
    • Use us-central1 as the default --location for gateway commands. For the other supported regions, see API Gateway deployment model.
  4. Enable the required Google Cloud APIs:
    gcloud services enable \
      apigateway.googleapis.com \
      servicemanagement.googleapis.com \
      servicecontrol.googleapis.com \
      --project={project_id}
    
    For API hub discovery (optional), enable the API hub API in the API hub host project: gcloud services enable apihub.googleapis.com --project={hub_project_id}. To query Agent Registry (optional), also run gcloud services enable agentregistry.googleapis.com --project={project_id}.
  5. Verify the IAM roles (use the most restrictive role for each step):
    • To create and update the API, API configs, and gateways: API Gateway Admin (roles/apigateway.admin) on {project_id}. To run the gcloud services enable commands: Service Usage Admin (roles/serviceusage.serviceUsageAdmin) on that project.
    • To reference the gateway service account in an API config: Service Account User (roles/iam.serviceAccountUser) on {gateway_sa_name}@{project_id}.iam.gserviceaccount.com.
    • For a Cloud Run backend: grant the gateway service account the Cloud Run Invoker role (roles/run.invoker) on the service.
    • To mint test ID tokens as a caller service account: Service Account Token Creator (roles/iam.serviceAccountTokenCreator) on {caller_sa_email}.
    • Reference: Configure the development environment.

Decision Matrix: MCP Server Configuration and Client Integration

Task Required Mechanism Critical Guardrail Detailed Reference
Migrate OpenAPI 2.0 (swagger: "2.0") or author OpenAPI 3.x for MCP Root x-google-api-management.mcp + named backends + operation-level x-google-mcp-tool NEVER add MCP extensions to an OpenAPI 2.0 spec. Rationale: MCP is not supported for OpenAPI 2.0. Use OpenAPI 3.0.x or 3.1.x, and deploy the spec with gcloud api-gateway api-configs create. Keep all MCP operations in one OpenAPI document: if an API con
Questions fréquentes

Cette fonctionnalité est-elle généralement disponible ?

Non. La skill la décrit comme une version en aperçu public, donc les détails peuvent changer.

Modifie-t-elle le fonctionnement de mon API REST ?

Elle ajoute un point de terminaison MCP distant et conserve les règles d'authentification et de quota existantes.

Ai-je besoin de la dernière Google Cloud CLI ?

Oui. La skill conseille de mettre la CLI à jour, car une ancienne version peut échouer avec les configurations OpenAPI 3.x.

Détails

Description originale de l’auteur

Configures Google Cloud API Gateway to act as a remote Model Context Protocol (MCP) server (Public Preview) that exposes REST APIs as agent tools over HTTP (POST /mcp). Use when migrating OpenAPI 2.0 specs to OpenAPI 3.x for MCP, annotating specs with x-google-api-management.mcp and x-google-mcp-tool, securing tools/list with JWTs or API keys, connecting Google ADK (McpToolset) or Apigee API hub and Agent Registry, or troubleshooting MCP JSON-RPC errors (-32601, -32602, -32000). Do not use for Apigee X proxy bundles, outbound LLM model routing, or GKE Gateway API.

repo: google/skills

Popularité

Étoiles GitHub
22k
Position au classement
#10214
Licence
Apache-2.0
Mis à jour
02/11/2026

Ce skill vous est-il utile ?

0

Connectez-vous pour voter.

Commentaires

  • …

Autres skills de ce dépôt

Skills similaires