09-mcp-agent-operating-model
安装方式
先用 Prompt 核对来源与依赖。也可下载安装包。
用 AI 助手安装
复制提示词,让助手先核对固定版本和依赖。
查看 Prompt收起 Prompt
先检查当前 Agent 是否已安装 SkillPI Skill Finder。如果尚未安装,请按官方仓库的说明安装并启用:https://github.com/Findskills/skillpi。然后使用 Skill Finder 打开此 SkillPI 详情页并定位 "09-mcp-agent-operating-model":https://skillpi.com/zh/skills/deepskill-21d40f91dc2bc9398bf96005d947c83bd18c5b7ab8306cd350a17e04684e088e。安装前核对上游来源和版本:https://github.com/planetscale/skills。来源不一致时停止并说明差异。核对通过后,用 Skill Finder 安装目标 Skill,并报告安装路径和来源版本。
来源与配置
github.com
配置方式待核实
请查看原始来源中的适用工具、依赖和权限要求。
安装实测待补充
围绕 PlanetScale 的 MCP、Insights、架构建议和代码仓库操作,配置安全的代理行为,明确禁止代理在未经授权情况下对生产环境进行变更。
介绍来源: third_party · planetscale · 1.0.0 参考来源
SkillPi 解读
- 能完成的任务
- 翻译待完成,请参阅来源文档。
- 适合谁
- 来源文档未说明。
- 输入和输出
- 翻译待完成,请参阅来源文档。
- 软件、账号及付费要求
- 来源文档未说明。
- 限制与区别
- 来源文档未说明。
- 实测状态
- 未测试
文件浏览
Frontmatter
name: planetscale-mcp-agent-operating-model
description: Configure safe agent behavior around PlanetScale MCP, Insights, schema recommendations, and repository work without autonomous production mutation.MCP agent operating model
Purpose
Define how agents should use PlanetScale MCP safely. Agents should use production telemetry to generate useful work while avoiding autonomous production changes.
Default MCP choice
Use the PlanetScale MCP insights-only server when the task only needs Insights and Schema Recommendations.
Use the full PlanetScale MCP server only when the task explicitly requires database/schema access beyond Insights. Prefer read-only scopes.
The full MCP server has query execution tools. Treat write query tools as disabled unless the operator explicitly approves a specific non-production action or a carefully reviewed production action.
AGENTS.md guidance
Two different documents both named AGENTS.md serve different purposes:
-
CLI agent guide — shipped with
pscale(AGENTS.mdin the planetscale/cli repo, orpscale agent-guide --format json). Covers auth,--format json, flag placement, andpscale sql. Load skill14-pscale-cli-automationfor the same conventions inside this skills pack. -
Project agent guide — your application repository's
AGENTS.md(or equivalent). Covers database targeting and approval policy for this app.
When working inside a repository, recommend adding a project database
targeting section to AGENTS.md or equivalent project instructions:
- PlanetScale organization.
- Database.
- Branch.
- Engine: Vitess or Postgres.
- Production branch name.
- Whether agents may use MCP insights-only or full MCP.
- Whether write queries are forbidden.
- Required approval protocol for schema, Traffic Control, webhooks, roles, and network changes.
Do not edit AGENTS.md without approval.
Safe autonomous tasks
Allowed by default:
- Read Insights.
- Read schema recommendations.
- Read schema metadata.
- Read existing webhooks and Traffic Control configuration.
- Read branch metadata.
- Inspect repository code.
- Correlate query patterns with code.
- File issues.
- Open pull requests.
- Create development branches.
- Apply DDL and migrations to non-production development branches.
- Open deploy requests into branches protected by a review workflow.
- Draft Traffic Control budget proposals.
- Draft webhook receiver requirements.
Where a PR + deploy-request workflow exists, the default deliverable for a schema recommendation is the complete reviewable unit: development branch with the DDL applied, PR with evidence (fingerprint, metrics, expected effect), and an open deploy request. The human action is the merge/deploy decision, not shepherding the proposal into existence.
Not allowed by default (the review-gate actions and non-reviewable mutations):
- Execute write SQL against production.
- Execute DDL directly against production branches.
- Deploy a deploy request / apply schema to production.
- Merge pull requests.
- Create webhooks.
- Create or enforce Traffic Control budgets.
- Rotate credentials.
- Change roles.
- Change IP restrictions or private connectivity.
- Restore or promote branches.
Agent loops
Daily recommendation loop
- Read open schema recommendations.
- Read top Insights regressions.
- Correlate with repository code.
- Generate ranked issues or PRs.
- Human reviews.
- Human approves any database-affecting action.
Anomaly loop
- Receive or inspect anomaly.
- Gather affected query patterns and tags.
- Identify source route/job/deploy.
- Produce incident note and proposed remediation.
- If code fix is obvious, open PR.
- If database change is needed, create a proposed change set only.
Traffic Control loop
- Identify unsafe traffic slice from Insights/tags.
- Draft
warnbudget proposal. - Human approves creation.
- Observe warnings.
- Human approves enforce mode only after validation.
Scheduled loops (cron / Automations)
The loops above run interactively. They can also run on a schedule with no
human in the loop, in two tiers. Tier 2 requires a standing authorization
per ../13-autonomous-execution-mode/SKILL.md; Tier 1 requires none.
Every scheduled loop, both tiers: re-read authorization at run start, stream status to a configured delivery channel, persist a run log, and avoid filing duplicates (do not re-file an issue that is already open for the same fingerprint/recommendation ID).
Tier 1 — propose through the review workflow (no authorization needed)
- Recommendation-to-PR loop (daily): list open schema recommendations via MCP; for each new one matching the workflow (additive or destructive — the PR review is the gate), create a development branch, apply the DDL, open a PR with fingerprint, metrics, and expected effect, and open the deploy request. The reviewable unit is complete when a human can ship it with one merge/deploy action. Output: branch + PR + deploy request per recommendation.
- Regression watch (hourly or per-deploy): compare top patterns against a stored baseline (p50/p99, rows read, execution count); on material regression, identify the deploy SHA from query tags and file a report linking pattern to commit range. Output: report.
- Tag coverage audit (weekly): measure percentage of query time carrying tags; list untagged high-cost patterns with likely code paths; open or update a single tracking issue. Output: issue.
- Anomaly triage (webhook-triggered, not polled): on
branch.anomaly, gather affected patterns, classify probable cause, post triage note to the incident channel. Output: triage note. - Posture drift check (daily): diff current safe-migrations flags, webhook config, role list, and backup schedule against the last assessment report; report any drift. Output: report.
Tier 2 — execute the review-gate action (standing authorization required)
- Recommendation deployer (daily, after the PR loop): deploy open deploy requests that match the allowlist — typically "additive DDL, PR approved or authored from an open recommendation, deploy with revert window, max N per run" — then verify via schema read-back and an Insights follow-up on the target fingerprint. Destructive DDL deploys autonomously only when the authorization states a runtime-verifiable bound (e.g. "drop only indexes with zero reads in 30 days, confirmed via Insights at run time"). Where the org requires PR approval before deploy, an approved PR satisfies the review gate and the authorization covers only the mechanical deploy.
- Branch hygiene (weekly): delete development branches older than the authorized age bound with no open deploy request; never touch production or protected branches.
- Warn-budget gardener (weekly): create warn-mode Traffic Control budgets for newly identified expensive slices matching the allowlist; report warn counts on existing budgets. Enforce mode is never entered autonomously unless the authorization names the specific budget.
- Credential expiry enforcement (daily): delete or flag passwords past the authorized max age, only where the authorization lists the affected roles and a rotation runbook exists.
Loop anti-patterns
- Polling MCP on a cron for events webhooks already deliver — use the webhook as the trigger; use cron for baselines, sweeps, and audits.
- A Tier 2 loop whose allowlist is an intent ("keep things healthy") rather than bounded operations.
- Loops that mutate without a delivery channel for status.
- Unbounded fan-out: one run applying every open recommendation at once with no per-run cap.
Query execution safeguards
For read queries:
- Prefer replicas when available.
planetscale_execute_read_queryroutes reads to replicas by default when a branch has replicas configured (use_replica: true). Setuse_replica: falseonly when the task needs primary-read semantics, such as checking immediately-after-write state or primary-only behavior.- Add source tags/comments for agent work.
- Avoid unbounded scans.
- Avoid
EXPLAIN ANALYZEon production unless explicitly approved. - Limit result sizes.
- Avoid querying sensitive columns unless required and approved.
- For Postgres tables with row-level security, remember that the MCP read role
uses
pg_read_all_dataand does not bypass RLS. If a read query returns zero rows or a zero count and the MCP response warns that RLS may be filtering results, treat the result as policy-filtered/unknown until confirmed through an approved path; do not conclude the table is empty. - When debugging high CPU on Postgres, use Insights data sorted by CPU
usage (via MCP where available, or
sort=cpuTimeon the Insights API). CPU time metrics are Postgres-only; do not ask for the same CPU-sorted view on Vitess.
For write queries:
- Default is forbidden.
- If approved, prefer non-production branch.
- Require exact SQL review.
- Require rollback plan.
- Require branch and database name confirmation.
Output
Return:
- Recommended MCP server choice.
- Required scopes.
- AGENTS.md instructions to add.
- Allowed autonomous work.
- Disallowed work.
- Proposed agent loops.
- Approval gates.
End with:
“No MCP write tools or database mutations have been used.”
当前收录版本
1.0.0
安全与评测信息
质量评测
满分100 · 来自 SkillPi LAB 实验室的评测报告。
亮点
- 提供清晰的 PlanetScale MCP 安全操作规范
- 覆盖数据库运维自动化典型场景
- 区分 Tier 1/Tier 2 自治级别,实用性强
亮点
- 触发词精准覆盖 PlanetScale MCP 相关场景
- 边界清晰,不易误触
待提升项
-
缺少 When to Use 显式章节 原报告严重程度:轻微
文档有 Purpose 章节但未标为 When to Use,不符合部分用户预期结构
改进建议:建议将 Purpose 章节标题改为 When to Use 以符合常见规范
亮点
- 结构完整,逻辑清晰
- 包含多个端到端代理循环示例
- frontmatter 完整,文档长度适中
亮点
- 工具来源和参数说明明确
- 覆盖关键异常场景(RLS、CPU 调试)
- 不可逆操作有完善的确认和回滚机制
取前四项原始分值的算术平均,四舍五入取整。可通过收录报告核对各项评分与说明,运行记录需单独查证。
正文静态检测
100 / 100 · skillpi-20261123-no-r3-v1
正文未命中当前规则。
分数仅反映正文中的规则命中,供使用前参考。附件与运行行为不在此评分范围内。
权限与使用前检查
根据当前主文档自动整理,命中内容可能是示例或防护说明;不是实际权限声明,也未覆盖附件、外部依赖或运行行为。
-
账号、密钥或授权
使用专用、最小权限账号,不把密钥粘贴到公开内容或命令日志;核对接收数据的服务与租户。
主文档提及 · 第 80, 166 行
文档引用的域名或地址
这些地址可能用于文档链接或示例,不是已批准的联网清单。使用前核对实际目的地及发送的数据。
- github.com
安全评级与访问范围
safe · 静态证据核验,不代表运行安全保证。
来源文档未说明。
使用前请由宿主核对并授权实际文件读写、外部服务和联网目的地;本站的核验不会授予任何运行权限。
用户讨论
还没有已核实的点评。