Command Palette

Search for a command to run...

UnylyUnyly
Назад к скиллам

api-gateway-mcp-server

БесплатноЗапускает вложенные скриптыНе проверен

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…

googleот google★ 25 380 звёзд на 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.

Usage Attribution

MUST READ: Before executing any gcloud, REST API, or MCP command, you MUST read and follow the instructions in Usage Attribution.

Prerequisites

  1. Install the Google Cloud CLI and the validator dependency:
    • If the Google Cloud CLI is not installed, give the user the install guide. Do not install it yourself. Until it is installed, give the user the commands to run, and continue from the output that they paste. An old CLI can fail when it uploads an OpenAPI 3.x API config. Ask the user before you run gcloud components update.
    • Install Python 3.10 or later and PyYAML for the local OpenAPI MCP validator script. Ask the user before you install it:
      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:
    • Ask the user which project to use, and use that ID as {project_id}. If no project exists, create one (gcloud projects create {project_id}). Pass --project={project_id} on every command. Do not change the active project with gcloud config set project.
    • 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. For the general 2.0 to 3.x conversion, use the api-gateway-openapi-spec-authoring skill. If it is not installed, use the fallback in the migration reference. Keep all MCP operations in one OpenAPI document. If only one document of the API config has MCP extensions, only its operations become tools. API Gateway fails to create an API config that has MCP extensions in more than one document, and the error does not say why. [OpenAPI 2.0 to 3.x Mi
Полный SKILL.md на GitHub

Установить api-gateway-mcp-server в Claude Code и Claude Desktop

Зарегайся, чтобы установить скилл

Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.

  • Открой команду установки в одну строку
  • Сохраняй скиллы в синхронизируемую библиотеку
  • Уведомления, когда скиллы обновляются
Зарегаться бесплатноУ меня уже есть аккаунт

Разрешённые инструменты

Инструменты, которые скиллу разрешено вызывать.

Без ограничений — скилл может использовать любой инструмент.

Вложенные файлы

references/adk-and-api-hub-discovery.mdreferences/attribution.mdreferences/mcp-limitations-and-troubleshooting.mdreferences/openapi-agent-tool-optimizer.mdreferences/openapi-v2-to-v3-mcp-migration.mdscripts/validate_mcp_openapi.py

FAQ

Что делает скилл api-gateway-mcp-server?

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 exposing an API Gateway API as MCP tools, 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), /mcp HTTP 404 or 405 errors, and MCP errors from api-configs create. Do not use for a migration without MCP or another OpenAPI error from api-configs create (use api-gateway-openapi-spec-authoring), API key, JWT, or quota setup for REST only (use api-gateway-backend-security-and-rate-limiting), failing non-MCP requests (use api-gateway-troubleshooting), Apigee X proxy bundles, outbound LLM model routing, or GKE Gateway API.

Как установить скилл api-gateway-mcp-server?

Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.

Скилл api-gateway-mcp-server запускает скрипты?

Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.

Похожие скиллы

Сравнить api-gateway-mcp-server с