# PlanetScale MCP

> PlanetScale MCP lets your AI agent manage serverless MySQL databases and complex schema structures directly from your IDE. You can provision new global database instances, list regional endpoints, or create temporary, isolated test branches by simply asking your client. This is essential for full-stack developers who need to safely version schemas—treating the entire database setup like source code branching—without leaving their development environment.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** mysql, serverless, database-branching, vitess, schema-management, devops

## Description

Managing complex data infrastructure used to mean jumping between a console dashboard and local scripts. Now, you can let your AI agent handle it all. You tell your client what needs fixing—whether that's spinning up a temporary copy of the main schema for testing or auditing which physical cloud regions are available—and your MCP executes the commands. This connector lets you manage entire database lifecycles: provisioning brand new clusters, checking existing configurations, and handling complex branching workflows instantly. If you rely on reliable data infrastructure management, connecting this through Vinkius gives you a centralized place to run these advanced commands across any compatible AI client.

## Tools

### create_branch
Creates an isolated, empty schema copy of a parent database for secure testing without affecting live data.

### create_database
Provisions a new, scalable serverless MySQL cluster instance ready for your defined schema.

### delete_branch
Permanently removes an old or unused development branch from the database structure.

### delete_database
Irreversibly destroys an entire PlanetScale MySQL construct, wiping all associated data globally.

### get_branch
Retrieves the necessary access hostnames for a specific database branch so your code can connect to it.

### get_database
Analyzes and returns the core configuration details of any targeted MySQL cluster logic.

### list_branches
Provides a list of all development database branches currently existing in the system, mirroring production architectures.

### list_databases
Retrieves details for all high-availability MySQL databases distributed across your organization's shards.

### list_organizations
Lists the foundational root identifiers needed to manage and connect to any subsequent endpoint.

### list_regions
Locates all supported physical cloud edge zones, helping you plan where to deploy new databases or branches.

## Prompt Examples

**Prompt:** 
```
List all physical cloud regions currently exposed by the PlanetScale integration.
```

**Response:** 
```
I executed `list_regions` successfully against your organization map. I found 15 edge locations. The primary North-American targets are `us-east` (AWS N. Virginia) and `us-west-2` (AWS Oregon). There are also `eu-west` endpoints available for immediate Database generation. Would you like me to create an instance there?
```

**Prompt:** 
```
We're starting a new feature. Fork testing branch from the main database 'store-backend'.
```

**Response:** 
```
Executed `create_branch`. Branch `feature-test-1y82` has been successfully spun up under `store-backend`. It copied the exact static schema logic from `main` without migrating standard rows, resulting in an empty, compliant Vitess environment ready for raw testing strings. What's the new DDL injection you're planning?
```

**Prompt:** 
```
Drop the specific 'staging-01' branch inside the 'web-portal' database.
```

**Response:** 
```
Command `delete_branch` deployed explicitly specifying target DB 'web-portal' aiming for branch 'staging-01'. The environment hook has been severed internally and queued for complete data physical destruction. Staging-01 operates out of existence as of now.
```

## Capabilities

### Audit Global Infrastructure Locations
Discover all physical cloud edge zones and core organizational identifiers required for setting up databases.

### Provision New Database Clusters
Create brand new, scalable serverless MySQL instances ready to accept definitions and data loads.

### Isolate Schema Testing Environments
Generate temporary, empty schema branches from a production database for consequence-free feature testing.

### Manage Database Schema Versioning
List or delete existing development branches to maintain clean and predictable data schemas.

### Inspect Cluster Configurations
Retrieve the core setup details for any specific MySQL cluster you manage.

## Use Cases

### Feature Development Requires Isolation
A developer needs to test a database migration for Feature X. They ask their agent to run `create_branch` off the main production schema, getting an isolated environment without duplicating gigabytes of live user data.

### Preparing for Multi-Region Launch
A platform architect plans expansion into Europe. The agent runs `list_regions`, confirming that 'eu-west' endpoints are available, allowing the architect to proceed with provisioning new clusters immediately.

### Database Cleanup After Deployment
After a major release, several temporary test branches remain active. The devops engineer asks the agent to use `delete_branch` on all identified stale schema forks, clearing clutter and reducing overhead.

## Benefits

- Test schema changes safely. By using the `create_branch` tool, you get an empty copy of production data's structure for testing without ever touching the live `main` branch.
- Automate cleanup tasks. When a feature is done, use `delete_branch` to purge obsolete test environments immediately, keeping your database clean and manageable.
- Scale globally with confidence. Run `list_regions` to audit physical edge locations. This lets you plan where to provision new databases for optimal latency targets.
- Speed up provisioning. Instead of manual console clicks, simply ask your agent to use `create_database` to spin up a fully configured serverless MySQL instance in natural language.
- Know your structure instantly. If you need to check the details of an existing cluster, running `get_database` gives you the core configuration without needing to navigate complex web consoles.

## How It Works

The bottom line is you tell your agent what infrastructure change you need, and it handles the complex backend steps to make it happen safely.

1. First, ensure your AI client has subscribed to this MCP and that you've provided an active PlanetScale Service Token.
2. Next, use natural language prompts in your IDE. Your agent translates the request (e.g., 'Create a test branch for Feature X') into the necessary API calls.
3. The system executes the command against PlanetScale and returns the result—whether it's a list of available regions or confirmation that the new schema branch exists.

## Frequently Asked Questions

**How do I check which physical regions PlanetScale supports using the PlanetScale MCP?**
You run `list_regions`. This tool immediately returns a full list of all supported cloud edge zones, allowing you to audit your global deployment footprint before starting any new project.

**Can I test a schema change without affecting the live database using PlanetScale MCP?**
Yes. Use `create_branch` to fork an empty, compliant copy of the main schema. This lets you run all your tests on the temporary branch without risking production data.

**What is the difference between list_databases and list_branches in PlanetScale MCP?**
`list_databases` shows every major, high-availability MySQL cluster. `list_branches` specifically lists all the temporary development schema versions you've created for testing purposes.

**If I delete a database using PlanetScale MCP, is it recoverable?**
No. The `delete_database` tool is permanent and irreversible; it will wipe terabytes of records globally. Always confirm the target ID before running this command.

**How do I get connection details for a temporary test branch using PlanetScale MCP?**
Run `get_branch`. This tool analyzes your schema version and returns all the necessary access hostnames required for your application to connect to that specific development branch.