Planet Scale MCP connector
OAuth 2.1/DCR DatabasesDeveloper ToolsAIConnect to PlanetScale MCP. Run SQL queries, inspect database branches and schemas, get query performance insights, and manage organizations and invoices...
Planet Scale MCP connector
-
Install the SDK
Section titled “Install the SDK”Terminal window npm install @scalekit-sdk/nodeTerminal window pip install scalekit -
Set your credentials
Section titled “Set your credentials”Add your Scalekit credentials to your
.envfile. Find values in app.scalekit.com > Developers > API Credentials..env SCALEKIT_ENVIRONMENT_URL=<your-environment-url>SCALEKIT_CLIENT_ID=<your-client-id>SCALEKIT_CLIENT_SECRET=<your-client-secret> -
Authorize and make your first call
Section titled “Authorize and make your first call”quickstart.ts import { ScalekitClient } from '@scalekit-sdk/node'import 'dotenv/config'const scalekit = new ScalekitClient(process.env.SCALEKIT_ENV_URL,process.env.SCALEKIT_CLIENT_ID,process.env.SCALEKIT_CLIENT_SECRET,)const actions = scalekit.actionsconst connector = 'planetscalemcp'const identifier = 'user_123'// Generate an authorization link for the userconst { link } = await actions.getAuthorizationLink({ connectionName: connector, identifier })console.log('Authorize Planet Scale MCP:', link)process.stdout.write('Press Enter after authorizing...')await new Promise(r => process.stdin.once('data', r))// Make your first callconst result = await actions.executeTool({connector,identifier,toolName: 'planetscalemcp_planetscale_execute_read_query',toolInput: { organization: 'YOUR_ORGANIZATION', database: 'YOUR_DATABASE', branch: 'YOUR_BRANCH', query: 'YOUR_QUERY' },})console.log(result)quickstart.py import osfrom scalekit.client import ScalekitClientfrom dotenv import load_dotenvload_dotenv()scalekit_client = ScalekitClient(env_url=os.getenv("SCALEKIT_ENV_URL"),client_id=os.getenv("SCALEKIT_CLIENT_ID"),client_secret=os.getenv("SCALEKIT_CLIENT_SECRET"),)actions = scalekit_client.actionsconnection_name = "planetscalemcp"identifier = "user_123"# Generate an authorization link for the userlink_response = actions.get_authorization_link(connection_name=connection_name,identifier=identifier,)print("Authorize Planet Scale MCP:", link_response.link)input("Press Enter after authorizing...")# Make your first callresult = actions.execute_tool(tool_input={"organization":"YOUR_ORGANIZATION","database":"YOUR_DATABASE","branch":"YOUR_BRANCH","query":"YOUR_QUERY"},tool_name="planetscalemcp_planetscale_execute_read_query",connection_name=connection_name,identifier=identifier,)print(result)
What you can do
Section titled “What you can do”Connect this agent connector to let your agent:
- Search planetscale — Search the PlanetScale knowledge base for documentation, API references, code examples, and guides
- List planetscale — List all schema recommendations for a PlanetScale database based on production query patterns
- Get planetscale — Get details about a specific PlanetScale organization
- Execute planetscale — Execute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch
Tool list
Section titled “Tool list”Use the exact tool names from the Tool list below when you call execute_tool. If you’re not sure which name to use, list the tools available for the current user first.
planetscalemcp_planetscale_execute_read_query
#
Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) against a PlanetScale database branch. 5 params
Execute a read-only SQL query (SELECT, SHOW, DESCRIBE, EXPLAIN) against a PlanetScale database branch.
branch string required Branch name (e.g., 'main') database string required Database name organization string required PlanetScale organization name query string required SQL SELECT query to execute postgres_database_name string optional Postgres only: target database name to connect to. Use when the user has created additional databases in the same PlanetScale Postgres cluster (e.g. via CREATE DATABASE). Omit to use the default database for the branch. planetscalemcp_planetscale_execute_write_query
#
Execute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch. 6 params
Execute a write SQL query (INSERT, UPDATE, DELETE, or DDL) against a PlanetScale database branch.
branch string required Branch name (e.g., 'main') database string required Database name organization string required PlanetScale organization name query string required SQL INSERT/UPDATE/DELETE/DDL query to execute confirm_destructive boolean optional HUMAN CONFIRMATION REQUIRED: Only set to true after explicitly asking the user and receiving their approval. Show them the exact DELETE or DDL query first. postgres_database_name string optional Postgres only: target database name to connect to. Use when the user has created additional databases in the same PlanetScale Postgres cluster (e.g. via CREATE DATABASE). Omit to use the default database for the branch. planetscalemcp_planetscale_get_branch
#
Get details about a specific database branch. 1 param
Get details about a specific database branch.
pathParameters object required No description. planetscalemcp_planetscale_get_branch_schema
#
Get the schema (tables and columns) for a specific database branch. 2 params
Get the schema (tables and columns) for a specific database branch.
pathParameters object required No description. queryParameters object optional No description. planetscalemcp_planetscale_get_database
#
Get details about a specific PlanetScale database. 1 param
Get details about a specific PlanetScale database.
pathParameters object required No description. planetscalemcp_planetscale_get_insights
#
Get query performance insights for a PlanetScale database branch, including top queries aggregated over a time period. 13 params
Get query performance insights for a PlanetScale database branch, including top queries aggregated over a time period.
branch string required Branch name (e.g., 'main') database string required Database name organization string required PlanetScale organization name fields array optional Request specific metric fields from the API (e.g. ['query', 'count', 'rowsRead', 'rowsAffected', 'rowsReadPerReturned', 'egressBytes', 'indexes', 'maxShardQueries']). Ignored when fingerprint is provided. fingerprint string optional Query fingerprint hash to drill down into a specific query pattern. Use the `fingerprint` value from an initial insights call. Always include `keyspace` (also from the initial results) to get summary data. from string optional Start of time range (ISO 8601 format, e.g. '2026-03-09T00:00:00.000Z'). Defaults to 24 hours ago. Supported in both discovery and fingerprint modes. keyspace string optional Keyspace for fingerprint drill-down. Required to get summary data. Use the `keyspace` value returned in insights results (e.g. 'my_keyspace' for MySQL/Vitess or 'postgres.public' for Postgres databases). limit number optional Number of results per metric (default: 5, max: 20) period string optional Shorthand for a recent time window ending at now. Valid values: '15m', '1h', '3h', '6h', '12h', '24h'. Cannot be combined with from/to — use one or the other. Only supported in discovery mode (ignored in fingerprint mode — use from/to instead). query string optional Filter insights by search query. Supports plain text matching and structured filters: exact match with quotes ("select count"), statement_type:select|delete|update|insert, table:table_name, keyspace:keyspace_name, table_keyspace:keyspace_name, index:index_name or index:table.index_name, indexed:true|false, multishard:true|false, query_count:>N or query_count:<N, p99:>N or p50:<N (ms), max_latency:>N (ms). Ignored when fingerprint is provided. sort_by string optional Sort order: 'all' (default) aggregates 5 API calls for comprehensive view, or specify a single metric: 'totalTime', 'rowsRead', 'p99Latency', 'rowsReadPerReturned', 'rowsAffected', 'egressBytes'. Ignored when fingerprint is provided. tablet_type string optional Filter by tablet type: 'primary' or 'replica' to string optional End of time range (ISO 8601 format). Defaults to now. Supported in both discovery and fingerprint modes. planetscalemcp_planetscale_get_invoice_line_items
#
Get all line items for a specific invoice, broken down by database branch costs. 2 params
Get all line items for a specific invoice, broken down by database branch costs.
pathParameters object required No description. queryParameters object optional No description. planetscalemcp_planetscale_get_organization
#
Get details about a specific PlanetScale organization. 1 param
Get details about a specific PlanetScale organization.
pathParameters object required No description. planetscalemcp_planetscale_list_branches
#
List all branches within a PlanetScale database. 2 params
List all branches within a PlanetScale database.
pathParameters object required No description. queryParameters object optional No description. planetscalemcp_planetscale_list_cluster_sizes
#
List available PlanetScale cluster sizes (SKUs) for an organization. 3 params
List available PlanetScale cluster sizes (SKUs) for an organization.
organization string required PlanetScale organization name engine string optional Database engine to list SKUs for (default: mysql) type string optional Filter to only autoscaling (PS-*, network-backed) or metal (M-*, local storage) sizes planetscalemcp_planetscale_list_databases
#
List all databases within a PlanetScale organization. 2 params
List all databases within a PlanetScale organization.
pathParameters object required No description. queryParameters object optional No description. planetscalemcp_planetscale_list_invoices
#
List all invoices for a PlanetScale organization. 2 params
List all invoices for a PlanetScale organization.
pathParameters object required No description. queryParameters object optional No description. planetscalemcp_planetscale_list_organizations
#
List all PlanetScale organizations you have access to. 1 param
List all PlanetScale organizations you have access to.
queryParameters object optional No description. planetscalemcp_planetscale_list_regions_for_organization
#
List the regions available for a PlanetScale organization. 2 params
List the regions available for a PlanetScale organization.
pathParameters object required No description. queryParameters object optional No description. planetscalemcp_planetscale_list_schema_recommendations
#
List all schema recommendations for a PlanetScale database based on production query patterns. 2 params
List all schema recommendations for a PlanetScale database based on production query patterns.
pathParameters object required No description. queryParameters object optional No description. planetscalemcp_planetscale_search_documentation
#
Search the PlanetScale knowledge base for documentation, API references, code examples, and guides. 5 params
Search the PlanetScale knowledge base for documentation, API references, code examples, and guides.
query string required Search query for PlanetScale docs api_reference_only boolean optional Only return API reference docs code_only boolean optional Only return code snippets language string optional Optional language filter (e.g., 'en', 'es') version string optional Optional version filter (e.g., 'v0.7')