api-gateway-mcp-server
O que ela faz
Esta skill ajuda desenvolvedores a expor uma API REST existente para agentes de IA como ferramentas, usando o API Gateway do Google Cloud. É para equipes que querem que seus agentes usem as APIs atuais sem reescrevê-las.
Quando usar
- ✓Quando você quiser que agentes de IA usem uma API REST existente pelo API Gateway do Google Cloud como ferramentas.
- ✓Quando precisar converter uma especificação OpenAPI 2.0 para OpenAPI 3.x para que ela funcione como um servidor MCP.
- ✓Quando quiser proteger a lista de ferramentas de um servidor MCP com JWTs ou chaves de API.
Link da skill
https://github.com/google/skills/blob/main/skills/cloud/api-gateway-mcp-server/SKILL.mdCopie e cole na sua IA (Claude, ChatGPT ou Cursor) pedindo para seguir as instruções.
Como usar
O jeito mais fácil: copie a mensagem e cole na sua IA. Ela lê a skill e segue as instruções.
Mensagem pronta para colar
Para Claude Code, Codex ou Cursor: rode na pasta do projeto e a skill fica instalada.
Baixe o SKILL.md e coloque na pasta de skills do seu agente.
Exemplo do que pedir para a IA
“Transforme a API da minha empresa em ferramentas que um agente de IA possa usar pelo API Gateway do Google Cloud.”
5 skills novas por semana. 1 minuto de leitura.
Como funciona
Ela adiciona anotações MCP ao arquivo OpenAPI, para que o gateway transforme as requisições do agente em chamadas normais ao seu backend. As regras de login e limite já existentes continuam valendo.
Conteúdo técnico (SKILL.md original)
Texto original do autor, em inglês, direto do 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
- 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
PyYAMLfor the local OpenAPI MCP validator script:pip install "PyYAML>=6.0,<7.0"
- Install the Google Cloud CLI. Then update it to the latest version with
- Authenticate your environment:
- Local CLI session:
gcloud auth login - Application Default Credentials (SDKs / ADK):
gcloud auth application-default login
- Local CLI session:
- 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-central1as the default--locationfor gateway commands. For the other supported regions, see API Gateway deployment model.
- Select an existing project (
- Enable the required Google Cloud APIs:
For API hub discovery (optional), enable the API hub API in the API hub host project:gcloud services enable \ apigateway.googleapis.com \ servicemanagement.googleapis.com \ servicecontrol.googleapis.com \ --project={project_id}gcloud services enable apihub.googleapis.com --project={hub_project_id}. To query Agent Registry (optional), also rungcloud services enable agentregistry.googleapis.com --project={project_id}. - 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 thegcloud services enablecommands: 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.
- To create and update the API, API configs, and gateways: API Gateway Admin (
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 |
Perguntas frequentes
Este recurso já está disponível de forma geral?
Não. A skill o descreve como Public Preview, então os detalhes podem mudar.
Isso muda o funcionamento da minha API REST?
Ela adiciona um endpoint MCP remoto e mantém as regras de autenticação e cota existentes.
Preciso da versão mais recente da Google Cloud CLI?
Sim. A skill recomenda atualizar a CLI, porque uma versão antiga pode falhar com configurações OpenAPI 3.x.
Detalhes
Descrição original do autor
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
Popularidade
- Estrelas no GitHub
- 22 mil
- Posição no ranking
- #10214
- Licença
- Apache-2.0
- Atualizada em
- 02/11/2026
Comentários
- …
Mais skills deste repositório
finding-google-skills
22 milAjuda seu agente a achar os guias certos do Google para configurar um projeto, como hospedagem, banco de dados, armazenamento e login.
gcloud
22 milAjuda seu agente a escrever e verificar comandos gcloud do Google Cloud, consultando a sintaxe exata antes de executar qualquer coisa, para não adivinhar flags.
google-cloud-recipe-auth
22 milOrienta seu agente pela identidade e pelo acesso no Google Cloud, incluindo como pessoas e serviços fazem login e quais permissões recebem.
google-cloud-recipe-onboarding
22 milGuia um desenvolvedor novo pelos primeiros passos no Google Cloud, incluindo escolher um projeto, vincular o faturamento e implantar um primeiro recurso.
Skills parecidas
mcporter
394 milAjuda seu agente a listar, chamar e inspecionar servidores MCP e suas ferramentas por HTTP ou stdio, e a gerenciar as configurações de login.
fastmcp
260 milAjuda você a construir, testar e publicar um servidor MCP em Python que dá a assistentes de IA acesso à sua API, banco de dados ou arquivos como ferramentas.
mcp-oauth-remote-gateway
260 milGuia você pelo login OAuth de um servidor MCP remoto quando o Hermes roda em um servidor, onde o login normal pelo navegador não consegue chegar.