Resolving Mcp Region Configs

作者 gemini-cli-extensions2df10e25bbf7Apache-2.0215 个星标收录于 2026年10月8日更新于 2026年10月8日仓库今天更新

Mandatory Step 0 pre-flight check for regional Google Cloud MCP servers (e.g. Dataproc) before using MCP tools or falling back to gcloud/bq CLI. Use whenever interacting with Dataproc clusters, Spark batches, jobs, sessions, or regional GCP resources. Fixes regional MCP servers whose endpoint URL still has an unreplaced $GCP_REGION / ${REGION} placeholder across Claude Code, Codex, and Antigravity. Trigger: an expected mcp__*_{service}_* tool is missing entirely (not just failing), or a call to one fails/hangs on a malformed host. Check via ToolSearch/deferred-tools listing before falling back to gcloud/bq CLI. Asks the user for a region, patches the live MCP config file(s), and tells the user how to restart without losing session context.

AI 生成的概览

修复区域级 Google Cloud MCP 服务器配置中未替换的区域占位符,使缺失的 MCP 工具得以注册。

功能
当预期的区域级 Google Cloud MCP 工具(例如 Dataproc 工具)缺失,或因主机格式错误而调用失败时,此技能会执行预检。它会检查 Claude Code、Codex 和 Antigravity 的实时 MCP 配置文件中是否存在未替换的区域占位符,例如 $GCP_REGION 或 ${REGION}。在向用户询问其 GCP 区域后,它会在相关配置文件中替换该占位符,并告知用户如何在不丢失会话上下文的情况下重启。
适用场景
当任务涉及区域级 Google Cloud 服务(如 Dataproc 集群、Spark 批处理、作业或会话),且对应的 MCP 工具缺失或调用失败时使用。它适用于回退到 gcloud 或 bq CLI 命令之前,且仅在区域占位符仍未替换时适用。
运行要求
无脚本,仅为说明。需要访问 Claude Code、Codex 或 Antigravity 的本地 MCP 配置文件,并且用户必须提供其 GCP 区域。

Regional MCP Server Configuration

Mandatory Step 0 Pre-Flight Check

[!IMPORTANT] Pre-Flight Check Before Using Dataproc / Regional Services or Falling Back to CLI: Whenever a task involves a regional Google Cloud service (e.g. Dataproc clusters, Spark batches, jobs, or sessions): 1. Check for MCP tools first: Before executing any gcloud dataproc or CLI commands, check whether the expected mcp__*__<service>__* tools (e.g. mcp__*__dataproc__*) are registered in the current environment (ToolSearch or deferred tools). 2. If tools are missing or calls fail/hang on a malformed host: Do NOT immediately fall back to gcloud/bq CLI. Inspect the live MCP configuration files (below) for unreplaced $GCP_REGION, ${REGION}, or ${user_config.GCP_REGION} placeholders. 3. If the region placeholder is already replaced with a valid region (e.g. us-central1): This skill does not apply — proceed normally with the task.

Some Google Cloud MCP servers are region-scoped (e.g. Dataproc: https://dataproc-$GCP_REGION.googleapis.com/mcp). If the region placeholder was never filled in, the server fails to connect silently — it registers zero tools, with no error and no placeholder string visible anywhere to notice. Treat a missing mcp__*__<service>__* tool as the trigger, not just a failed call — that's the most common way this skill gets skipped in favor of a gcloud/bq fallback.

When to use

  • User asks to use a regional service (e.g. "list dataproc clusters"), and the matching mcp__* tools aren't present — check ToolSearch or the deferred-tools listing first — or a call to one fails/hangs on a malformed host.
  • Then inspect the live config (below) for $GCP_REGION, ${REGION}, or ${user_config.GCP_REGION}. If found, run the procedure. If the region is already set, this skill doesn't apply — investigate normally instead.

Supported services

  • Dataproc: https://dataproc-$GCP_REGION.googleapis.com/mcp

Locating the live config

The file actually loaded at runtime is under the plugin's install/cache path, not just any workspace copy — edit that one (and the source copy, best-effort, so the fix survives a reinstall):

  • Claude Code: ~/.claude/plugins/cache/<marketplace>/dak/<version>/.claude-mcp.json (get <marketplace>/<version> from ~/.claude/plugins/installed_plugins.json). Also check ./.claude-mcp.json and claude_desktop_config.json.
  • Codex: ~/.codex/plugins/cache/**/dak/**/.mcp.json (or mcp.json). Also check ~/.agents/plugins/dak/.mcp.json, ./.mcp.json, and ~/.codex/config.toml ([mcp_servers.<name>]).
  • Antigravity: ./mcp_config.json or ~/.gemini/antigravity/mcp_config.json.

Procedure

  1. You MUST NOT call the regional tools yet — there likely aren't any to call.

  2. You MUST ask the user for their GCP region (e.g. us-central1). You MUST NOT guess.

  3. You MUST edit the placeholder to that region in the config file(s) above.

  4. You MUST tell the user to restart — MCP connections load once at startup and won't hot-reload mid-session. Restarting does not lose the conversation:

    • Claude Code: claude --resume (or --continue)
    • Codex: codex resume --last (or codex resume for a picker)
    • Antigravity: use its resume/history picker if available

来源与署名

来源:gemini-cli-extensions/data-agent-kit-starter-pack位于skills/resolving-mcp-region-configs提交2df10e2

许可证: Apache-2.0

内容归原作者所有。SourceWeft 从公开仓库中收录这些内容。

举报或申请下架

更多来自 gemini-cli-extensions/data-agent-kit-starter-pack 的技能

Schema Mapping

gemini-cli-extensions

为 ETL、ELT 或数据集成任务规划源到目标的模式映射,产出文档化的映射宣言。

Data & Analytics215今天更新

Notebook Guidance

gemini-cli-extensions

This skill guides the use of Jupyter notebooks for data analysis, exploration, and visualization, particularly with BigQuery. It outlines best practices for notebook execution and validation (supporting both cell-by-cell execution and full notebook generation depending on tool availability), library installation, and structuring notebooks for clarity. It also covers specific rules for data cleaning, plotting, and integrating with BigQuery SQL and machine learning workflows. Relevant when any of the following conditions are true: 1. The user request involves a data analysis, data exploration, data visualization, or data insights task that requires multiple steps, queries, or visualizations to answer. 2. The user explicitly requests a notebook (.ipynb). 3. You are creating, editing, or executing cells in a Jupyter notebook. 4. You need to query BigQuery from within a notebook. DO NOT use the Python BigQuery client library; instead, you MUST use the `%%bqsql` magics explained in this skill.

待分类215今天更新

Ml Best Practices

gemini-cli-extensions

为机器学习笔记本提供分步方案,涵盖聚类、预测、分类、回归和模型比较。

Data & Analytics215今天更新

Managing Python Dependencies

gemini-cli-extensions

指导代理检测 Python 项目的依赖管理器并正确安装依赖,而不是使用全局 pip。

Software Development215今天更新

Google Cloud Storage Fuse

gemini-cli-extensions

Mounts Cloud Storage buckets as a POSIX file system with Cloud Storage FUSE (gcsfuse). Use when you need to interact with gcsfuse — decide whether FUSE, native gs:// reads, or Filestore/Managed Lustre fits a workload, deploy tuned mounts on GKE, Compute Engine, or Cloud Run, enable and size the file, stat, and list caches, tune mount flags or config-file settings, apply workload profiles, keep ML checkpointing safe (rename atomicity, hierarchical namespace, close-time finalization, concurrent writers), or diagnose slow training, low throughput, or GCS bill spikes on existing mounts with gcsfuse metrics. Covers mount semantics, the gcsfuse CLI and config file, the GKE gcsfuse CSI driver (Workload Identity principal:// bindings, profile StorageClasses, sidecar sizing), and Cloud Run volume mounts. Don't use for bucket administration or data management without a mount (google-cloud-storage-basics) or for fully POSIX-compliant shared file systems (Filestore, Managed Lustre).

待分类215今天更新

Google Cloud Auth Verification

gemini-cli-extensions

Mandatory Step 0 pre-flight execution order and authentication verification for Google Cloud Platform (GCP), Application Default Credentials (ADC), gcloud CLI, Spark, Dataproc, BigQuery, GCS, and notebook runtimes. Use whenever interacting with GCP resources, running Spark/PySpark pipelines, BigQuery queries, GCS paths (gs://), or creating/running notebooks.

待分类215今天更新