安装 Firestore Native 插件
安装 firestore-native@data-agent-kit,配置 ADC 和 FIRESTORE_PROJECT。插件通过本地 firestore MCP 连接 Native 模式数据库。
安装 firestore-native@data-agent-kit,配置 ADC 和 FIRESTORE_PROJECT。插件通过本地 firestore MCP 连接 Native 模式数据库。
这是 gemini-cli-extensions/firestore-native 的 Codex 专节。插件把 MCP Toolbox 的预置 firestore 封装为插件,用 ADC 连 Firestore Native 库,去列集合、读写文档、查规则。
要 Codex v0.117.0+,本机有 Node / npx。先开 Firestore API,库必须是 Native 模式(不是 Datastore 模式),IAM 至少 roles/datastore.user(看规则再加 roles/firebaserules.viewer),再准备 ADC:
gcloud auth application-default login
export FIRESTORE_PROJECT=YOUR_FIRESTORE_PROJECT
# 可选:FIRESTORE_DATABASE(默认 (default))
多库才设 FIRESTORE_DATABASE,值带括号时加引号。不要把密钥写进 http_headers。
清单 .agents/plugins/marketplace.json 的 name 是 data-agent-kit,插件 name 是 firestore-native。MCP 表名和 Toolbox 预置都是 firestore:
codex --version
codex plugin marketplace add GoogleCloudPlatform/data-agent-kit
codex plugin add firestore-native@data-agent-kit
codex plugin list
codex mcp list
IDE 扩展没有 /plugins。
插件会登记一台 stdio MCP,表名是 firestore。command 是 npx,args 指定 @toolbox-sdk/server@1.9.0 --prebuilt firestore --stdio。不要 codex mcp login firestore。插件已经带 MCP 时,不要再 codex mcp add firestore -- npx @toolbox-sdk/server 叠一张用户层表。
可选:codex plugin marketplace upgrade data-agent-kit 后再 plugin add 一次。清单目前钉的是 0.3.1,插件仓 plugin.json 已是 0.3.4。0.154 起先看当前会话的 /plugins 和 /mcp;没有再新开。codex mcp list 里应有 firestore。连接失败先看 ADC、FIRESTORE_PROJECT 是不是进了同一进程,以及 npx 能不能拉到 Toolbox 1.9.0。发行仍是 Beta(pre-v1.0)。保持工具调用审批。