api-gateway-mcp-server
できること
API Gatewayを通じて、既存のREST APIを、ツールとしてAIエージェントに公開する開発者を支援します。書き直さずに、現在のAPIをエージェントに使わせたいチーム向けです。
使う場面
- ✓Google Cloud API Gatewayを通じて、既存のREST APIをエージェントのツールとして使わせたいとき。
- ✓OpenAPI 2.0の仕様をOpenAPI 3.xに変換して、MCPサーバーとして動かす必要があるとき。
- ✓JWTやAPIキーで、MCPサーバーのツール一覧を保護したいとき。
スキルのリンク
https://github.com/google/skills/blob/main/skills/cloud/api-gateway-mcp-server/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“私の会社の既存のAPIを、Google Cloud API Gatewayを通じてAIエージェントが使えるツールにしてください。”
毎週5つの新しいスキル。1分で読めます。
仕組み
エージェントはOpenAPIのファイルにMCPのアノテーションを追加し、ゲートウェイがエージェントのリクエストを、バックエンドへの通常の呼び出しに変換するようにします。既存のログインと上限のルールはそのまま適用されます。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)を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 |
よくある質問
一般に提供されている機能ですか?
いいえ。スキルはPublic Previewと説明しており、詳細は変わる可能性があります。
REST APIの動作は変わりますか?
リモートのMCPのエンドポイントを追加するだけで、既存の認証とクォータのルールは残ります。
最新のGoogle Cloud CLIが必要ですか?
はい。古いバージョンはOpenAPI 3.xの設定で失敗することがあるため、CLIを更新するよう勧めています。
詳細
作者による元の説明
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
人気
- GitHubのスター
- 22k
- ランキング
- #10214
- ライセンス
- Apache-2.0
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
finding-google-skills
22kセットアップ作業に合うGoogleの公式ガイドを探すようエージェントを支援します。ホスティング、データベース、ストレージ、サインイン、AIモデルの提供などが対象です。
gcloud
22kエージェントが、Google CloudのgcloudコマンドについてWeb検索に頼らず、正確な構文を確かめてから書いたり確認したりできるよう支援します。
google-cloud-recipe-auth
22kエージェントが、Google Cloudのアイデンティティとアクセス(人やサービスがどうサインインし、どの権限を得るか)について、手順を案内できるよう支援します。
google-cloud-recipe-onboarding
22k新しい開発者が、プロジェクトの選択、請求の設定、最初のリソースのデプロイなど、Google Cloudの最初の手順を進められるよう案内します。
似ているスキル
mcporter
394kHTTPまたはstdioでMCPサーバーとそのツールを一覧表示、呼び出し、確認し、サインイン設定を管理するようエージェントを支援します。
fastmcp
260kPythonで、AIアシスタントがAPI、データベース、ファイルをツールとして利用できるMCPサーバーを作成、テスト、デプロイするのを支援します。
mcp-oauth-remote-gateway
260kHermesがサーバー上で動いている場合に、リモートのMCPサーバーのOAuthサインインを手動で完了させ、トークンを保存します。