planetscale/mcp

CategoryDatabase
AuthorCommunity
Stars468
PricingFree

Overview

The planetscale/mcp server bridges the gap between LLMs and your database schema, allowing AI agents to interact directly with PlanetScale databases. Instead of manually pasting table definitions or query results into a prompt, this tool enables the model to inspect schemas, execute read queries, and analyze data in real-time. For developers, this means faster debugging and the ability to generate accurate migrations or complex SQL queries based on the actual state of the database. It integrates seamlessly via the PlanetScale CLI, eliminating the need for custom middleware to expose your data layer to AI assistants. Compared to static context windows, this provides a dynamic, live interface to your production or development environments.

Highlights

  • Direct AI access to live PlanetScale database schemas
  • Real-time data retrieval via natural language queries
  • Eliminates manual schema pasting for SQL generation
  • Easy setup through the existing PlanetScale CLI
  • Dynamic context for faster database debugging

Full Documentation

PlanetScale CLI ![Build status](https://github.com/planetscale/cli/actions/workflows/ci.yml)

PlanetScale is more than a database and our CLI is more than a jumble of commands. The pscale command line tool brings branches, deploy requests, and other PlanetScale concepts to your fingertips.

!PlanetScale CLI

Installation

#### macOS

pscale is available via a Homebrew Tap, and as downloadable binary from the releases page:

code
brew install planetscale/tap/pscale
Optional: pscale requires a MySQL 8 Client in your PATH for certain commands. You can install it by running:
code
brew install [email protected]

To upgrade to the latest version:

code
brew upgrade pscale

#### Linux

pscale is available as downloadable binaries from the releases page. Download the .deb or .rpm from the releases page and install with sudo dpkg -i and sudo rpm -i respectively.

Arch: pscale-cli-bin

#### Windows

pscale is available via scoop, and as a downloadable binary from the releases page:

code
scoop bucket add pscale https://github.com/planetscale/scoop-bucket.git
scoop install pscale mysql

To upgrade to the latest version:

code
scoop update pscale

#### Manually

Download the pre-compiled binaries from the releases page and copy to the desired location.

Alternatively, you can install bin which works on all macOS, Windows, and Linux platforms:

code
bin install https://github.com/planetscale/cli

To upgrade to the latest version

code
bin upgrade pscale

#### Container images

We provide ready to use Docker container images. To pull the latest image:

code
docker pull planetscale/pscale:latest

To pull a specific version:

code
docker pull planetscale/pscale:v0.63.0

If you like to have a shell alias that runs the latest version of pscale from docker whenever you type pscale:

code
mkdir -p $HOME/.config/planetscale
alias pscale="docker run -e HOME=/tmp -v $HOME/.config/planetscale:/tmp/.config/planetscale --user $(id -u):$(id -g) --rm -it -p 3306:3306/tcp planetscale/pscale:latest"

If you need a more advanced example that works with service tokens and differentiates between commands that need a pseudo terminal or non-interactive mode, have a look at this shell function.

MCP Server Integration

> Deprecated: The CLI-based MCP server (pscale mcp) is deprecated and will be removed in a future version. Use the PlanetScale MCP server instead: https://planetscale.com/docs/connect/mcp

GitHub Actions Usage

Use the setup-pscale-action to install and use pscale in GitHub Actions.
yaml
- name: Setup pscale
  uses: planetscale/setup-pscale-action@v1
  • name: Use pscale
env: PLANETSCALE_SERVICE_TOKEN_ID: ${{ secrets.PLANETSCALE_SERVICE_TOKEN_ID }} PLANETSCALE_SERVICE_TOKEN: ${{ secrets.PLANETSCALE_SERVICE_TOKEN }} run: | pscale deploy-request list my-db --org my-org

Local Development

To run a command:

code
go run cmd/pscale/main.go <command>

Alternatively, you can build pscale:

code
go build cmd/pscale/main.go

And then use the pscale binary built in cmd/pscale/ for testing:

code
./cmd/pscale/pscale <command>

Documentation

Please checkout our Documentation page: planetscale.com/docs

For AI agents and automation, run pscale agent-guide or see AGENTS.md.
For operational workflows (inventory, safety review, schema recommendations), install
planetscale/skills.

Join our Telegram