MCP/PlanetScale MCP Server
PlanetScale MCP Server logo

PlanetScale MCP Server

Hosted Model Context Protocol server for PlanetScale databases, schema branching, query insights, and infrastructure metrics.

rag-data•Databases & Storage
GitHub120
License:Apache-2.0
VERIFIED

About this Server

The official PlanetScale Model Context Protocol (MCP) server connects AI agents directly to PlanetScale cloud databases and Vitess/Postgres infrastructure. It enables natural language schema exploration, read/write query execution with replica routing, schema change recommendations, error fingerprint tracking, query tag summaries, and deep Insights performance metrics.

Real-time Interaction

Direct low-latency RPC protocol communication with structured JSON schemas.

Scoped Sandboxing

Restricted capability bounds to prevent accidental modifications or leakage.

Security & Best Practices

OAuth & Service Tokens: Authenticate via browser OAuth or restricted service tokens for headless CI environments.
Replica Read Offloading: Default reads to replica instances to safeguard primary database performance.
Branch Isolation: Test migrations and experimental DDL on dedicated development branches prior to production deploy requests.

When to Use (and When Not To)

Best For
  • •Inspecting schemas, branches, and running SQL queries on PlanetScale databases
  • •Diagnosing database latency and slow query bottlenecks using PlanetScale Insights
  • •Reviewing schema index recommendations and error patterns without leaving the editor
Not For / Limitations
  • •Vector similarity search over unstructured document embeddings (use Chroma MCP instead)
  • •Non-relational document stores and Atlas streams (use MongoDB MCP instead)
  • •Local embedded in-memory Parquet analytics (use DuckDB / MotherDuck MCP instead)

Install & Setup

terminal command
$claude mcp add planetscale --transport http https://mcp.pscale.dev/mcp/planetscale

Exposed Tools & Endpoints

10 tools

Functions your AI agent can invoke via this Model Context Protocol server

planetscale_execute_read_query

Executes read-only SQL queries (SELECT, SHOW, DESCRIBE, EXPLAIN) with optional replica or primary routing.

planetscale_execute_write_query

Executes write SQL queries (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch.

planetscale_get_branch_schema

Retrieves the complete schema and table definitions for a specific database branch.

planetscale_get_insights

Fetches query performance insights, latency metrics, and row count trends for a database branch.

planetscale_list_databases

Lists all databases belonging to a specified PlanetScale organization.

planetscale_list_branches

Lists all development and production branches within a database.

planetscale_list_schema_recommendations

Lists schema suggestions including missing indexes, redundant indexes, and primary key health.

planetscale_list_query_error_patterns

Lists aggregated failing query patterns, error messages, and occurrence frequencies.

planetscale_get_branch_metrics

Fetches infrastructure telemetry: CPU, memory (RSS/cache), disk, replication lag, and connections.

planetscale_search_documentation

Searches official PlanetScale documentation and technical guides.