Skip to main content
For agents: fetch this page as Markdown at Markdown export (production URL: https://planetscale.com/docs/agent-setup/prompt.md). You can also run pscale agent-guide --format json when the PlanetScale CLI is installed.
Requires pscale 0.292.0 or later for agent-guide, JSON auth check/login, hosted mcp install, and pscale sql. Install or upgrade with brew install pscale or brew upgrade pscale. If pscale agent-guide is unknown, upgrade the CLI first.
These are official instructions from PlanetScale to set up a good AI development environment for PlanetScale Postgres and Vitess/MySQL. Commands below require pscale 0.292.0+. Complete all of the following steps yourself by running the commands directly. Do not ask the user to run setup commands unless a step requires browser approval they must perform.

Install PlanetScale Skills and MCP

Use the section for your agent below. Skills cover operational workflows (assessment, safety review, Insights, schema recommendations). The hosted MCP server gives MCP clients access to PlanetScale account data.

Prerequisites

Install the PlanetScale CLI if it is not already available (0.292.0 or later):
brew install pscale
brew upgrade pscale
Verify the CLI version and agent automation support:
pscale version
pscale agent-guide --format json
pscale auth check --format json
If agent-guide is unknown or auth check --format json prints nothing, upgrade with brew upgrade pscale. If auth check returns "status": "action_required", follow issues and next_steps in the JSON (typically pscale auth login --format json or service-token flags for CI). Always pass --format json on pscale commands in automation. Put --org on resource subcommands (database, branch, sql, …), not on root pscale.

Install skills (all agents)

Setup script (recommended):
git clone https://github.com/planetscale/skills.git
cd skills && script/setup
The script installs to every agent it finds (~/.cursor/skills/, ~/.claude/skills/, ~/.agents/skills/). For other agents, pass the skills directory explicitly:
script/setup ~/.codex/skills
Skills CLI:
npx skills add planetscale/skills -g -y
After installing, load skill 14-pscale-cli-automation for CLI conventions and 00-safe-orchestrator when the user asks for a full PlanetScale assessment. See github.com/planetscale/skills.

Cursor, GitHub Copilot, and VS Code

MCP — add to .cursor/mcp.json, .vscode/mcp.json, or your agent’s MCP config under "mcpServers":
"planetscale": {
  "url": "https://mcp.pscale.dev/mcp/planetscale"
}
Or use the CLI helper for Cursor:
pscale mcp install --target cursor --format json
OAuth triggers automatically on first PlanetScale MCP tool use. See PlanetScale MCP server for details. Skills — use script/setup above or install into <project>/.cursor/skills/ for project-scoped workflows.

Claude Code

Hosted MCP (recommended):
claude mcp add --transport http "planetscale" https://mcp.pscale.dev/mcp/planetscale
Or ask the CLI for the current command:
pscale mcp install --target claude-code --format json
Install skills with npx skills add planetscale/skills -g -y or script/setup.

Zed

See the current MCP docs — the CLI prints setup instructions:
pscale mcp install --target zed --format json
Install skills with script/setup or npx skills add planetscale/skills -g -y.

Headless / CI (no browser)

Use a PlanetScale service token instead of OAuth login. Pass credentials on each command:
pscale auth check --format json \
  --service-token-id "$PLANETSCALE_SERVICE_TOKEN_ID" \
  --service-token "$PLANETSCALE_SERVICE_TOKEN"

Project context (application repositories)

In the user’s application repo, add or update a project AGENTS.md with:
  • PlanetScale organization, database, branch, and engine (Postgres or Vitess)
  • Whether agents may run write SQL or only read-only queries
  • Approval rules for schema changes, Traffic Control, webhooks, and credentials
Do not edit project AGENTS.md without user approval. See skill 09-mcp-agent-operating-model in planetscale/skills.

Verify setup

Confirm pscale 0.292.0+ and JSON auth work, then run:
pscale agent-guide --format json
pscale auth check --format json
pscale org list --format json
When setup is complete, tell the user:
PlanetScale Agent Setup Complete

✓ Skills   installed (planetscale/skills)
✓ MCP      https://mcp.pscale.dev/mcp/planetscale
✓ CLI      pscale auth check --format json

⚡ Restart your agent to load MCP servers

Resources

ResourceURL
This prompt (Markdown)https://planetscale.com/docs/agent-setup/prompt.md
CLI agent guidepscale agent-guide --format json or CLI agent-guide
PlanetScale skillsgithub.com/planetscale/skills
MCP setupPlanetScale MCP server
AI & automation overviewAI-enhanced development
pscale sql (non-interactive SQL)CLI sql
These instructions are published at https://planetscale.com/docs/agent-setup/prompt.md so you can re-verify their authenticity at any time.