PlanetScale MCP Server – Database AI Access
PlanetScale provides a hosted MCP server for MCP-compatible clients that need live context from PlanetScale databases and query performance data. AI agents can use it to inspect organizations, databases, branches, schemas, Insights, schema recommendations, and, when authorized, execute read or write SQL queries with built-in safeguards.
Overview
The PlanetScale MCP server is a hosted Model Context Protocol integration for connecting AI agents and MCP-compatible tools to PlanetScale. It is designed for database exploration, debugging, schema inspection, and performance analysis across PlanetScale organizations, databases, branches, schemas, and Insights data. The recommended server is hosted by PlanetScale and is authenticated through OAuth, so users grant access from their PlanetScale account instead of copying long-lived database credentials into an MCP client.
What the MCP server enables
The server exposes a curated set of PlanetScale tools for day-to-day database work. Agents can list organizations, databases, and branches; fetch organization, database, branch, and branch schema details; query PlanetScale Insights; list regions and cluster size SKUs; search PlanetScale documentation; and review schema recommendations such as index suggestions or primary-key-exhaustion prevention. When permissions allow it, the server also supports read-only SQL query execution and write SQL query execution against PlanetScale databases.
PlanetScale also provides an insights-only hosted endpoint for agents that need Insights and Schema Recommendations but should not execute database queries. That endpoint excludes the read-query and write-query tools.
When to use it
Use PlanetScale MCP when an AI coding assistant or database agent needs current production-aware database context. Practical workflows include listing the branches for a production database, reviewing schema differences, investigating slow queries from Insights, checking resource profiles, or asking an agent to recommend query or schema changes with live PlanetScale data. It is especially useful when the MCP client runs in a browser, editor, or sandbox where direct database connectivity is not available, because queries execute over HTTP through the hosted MCP server.
Connection and authentication
The recommended transport is remote HTTP using https://mcp.pscale.dev/mcp/planetscale. Authentication is handled through OAuth in the MCP client: users are redirected to PlanetScale, sign in, and grant scoped access. Access can be configured at the organization or per-database level, with no access, read-only access, or full access depending on the granted scopes.
Key considerations
The older local PlanetScale CLI MCP server is deprecated and no longer recommended. For the hosted server, each query uses short-lived ephemeral credentials created on demand and deleted after execution. Even with these protections, write access to production databases should be granted carefully. PlanetScale blocks UPDATE and DELETE statements without a WHERE clause, blocks TRUNCATE, and requires human confirmation for DDL statements such as CREATE, DROP, or ALTER. Re-authenticate the MCP server when scopes or permissions need to change.
Supported Transports
streamable_http
URL: https://mcp.pscale.dev/mcp/planetscale
streamable_http
URL: https://mcp.pscale.dev/mcp/planetscale-insights-only
Frequently Asked Questions
- When should an AI agent use the PlanetScale MCP server?
- Use it when an MCP-compatible agent needs live PlanetScale context for database exploration, schema inspection, branch review, query performance analysis, or optimization work based on PlanetScale Insights.
- What does the PlanetScale MCP server add to an AI agent's capabilities?
- It gives the agent authenticated access to PlanetScale organizations, databases, branches, schemas, Insights, documentation search, schema recommendations, and authorized SQL query execution instead of relying only on static model knowledge.
- What can the AI agent access or manage through this server?
- The documented hosted server can list and retrieve organizations, databases, branches, schemas, regions, cluster size SKUs, invoices, invoice line items, Insights, documentation results, and schema recommendations, and can execute read or write SQL queries when the OAuth scopes permit it.
- How is authentication configured for the PlanetScale MCP server?
- The hosted PlanetScale MCP server uses OAuth. The MCP client connects to the hosted URL, redirects the user to PlanetScale to sign in, and receives access according to the scopes and organization or database permissions the user grants.
- Which transport should be used for the PlanetScale MCP server?
- Use the hosted HTTP MCP endpoint at `https://mcp.pscale.dev/mcp/planetscale` for full documented functionality, or the insights-only HTTP endpoint when query execution should be excluded. The local PlanetScale CLI MCP server is deprecated and not recommended.