# PlanetScale MCP for AI Agents AI Agent Connect

> PlanetScale MCP lets you manage distributed MySQL databases using your AI client. You can provision clusters, create branches for testing, and manage global regions without leaving your IDE. It turns complex database infrastructure tasks into simple chat commands.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_Cj1wlp2M7NG4xG8y4bWLeF2TWX2ttuftARXCdWYR/ai-agent-connect
- **Tags:** mysql, serverless, database-branching, vitess, schema-management, devops

## Description

Managing distributed database infrastructure usually involves jumping between your terminal and a web console, clicking through menus to spin up new environments or figuring out where your data is actually hosted. This Connector changes that by giving your agent direct access to the PlanetScale API. Instead of hunting for organizational IDs or manual region lists, you just tell your AI client what you need. If you need a sandbox for a new feature, your agent can fork the production schema into a dedicated branch without leaving your IDE. This keeps your testing isolated and your production environment safe. You can also handle the cleanup of stale staging branches or delete old database clusters through the same chat interface. It is a much faster way to handle the heavy lifting of Vitess-backed MySQL. By adding this to your setup on Vinkius, you get a unified way to handle database lifecycle management. You stop wasting time on manual configuration and start spending it on shipping code.

## Tools

### create_database
Provision a new managed MySQL cluster ready for your DDL commands.

### delete_branch
Remove a specific schema branch from your database once you are done testing.

### delete_database
Irreversibly destroy a PlanetScale MySQL cluster to stop its billing.

### get_branch
Get the specific hostnames and connection details for a database branch.

### get_database
View the core configuration details of a specific MySQL cluster.

### list_branches
See all the development branches currently mirroring your production architecture.

### list_databases
List all the high-availability MySQL distributions in your account.

### create_branch
Create a new schema branch that mirrors the parent structure but does not copy any data.

### list_organizations
Get the root organizational IDs needed for managing your MySQL endpoints.

### list_regions
Find all the physical cloud availability zones supported by the Vitess backend.

## Prompt Examples

**Prompt:** 
```
I need to test a migration on a new branch.
```

**Response:** 
```
I've created a new branch called `migration-test` from your `main` branch. It is a clean schema clone with no production data attached. You can now run your migrations against it. Would you like me to grab the connection hostnames for you?
```

**Prompt:** 
```
Where can I host my new cluster?
```

**Response:** 
```
Here are the available physical cloud regions: 
- us-east (AWS N. Virginia)
- us-west-2 (AWS Oregon)
- eu-west (AWS Ireland)
- sa-east-1 (AWS São Paulo)

Which one works best for your latency targets?
```

**Prompt:** 
```
Clean up my old test branches.
```

**Response:** 
```
I've successfully removed the following obsolete branches:

- `test-branch-99`
- `temp-migration-v2`
- `staging-cleanup-01`

Your workspace is now clear. Do you have any other branches to purge?
```

## Capabilities

### Create isolated schema branches
Fork your production schema into a new branch for safe testing without copying production data.

### Provision new managed clusters
Spin up new MySQL instances in specific global regions through natural language commands.

### Purge old staging branches
Delete obsolete branches from your database to keep your development workspace clean.

### Retrieve database configurations
Get the hostnames and connection details for any specific database branch or cluster.

### Identify global edge regions
Find out which physical cloud zones are available for your next deployment to optimize latency.

## Use Cases

### Safe migration testing
A developer needs to test a heavy DDL change. They ask their agent to use create_branch to fork the schema, then run the migration in isolation.

### Rapid dev environment setup
A new project starts and the team needs a database. They ask the agent to use create_database to spin up a new cluster in a specific region.

### Staging environment cleanup
A DevOps engineer wants to clear out old tests. They tell their agent to use delete_branch to remove every branch from the last month.

### Multi-region audit
An architect needs to verify where all databases are hosted. They ask the agent to list_databases and list_regions to generate a summary.

## Benefits

- Skip the web console by using create_branch to fork production schemas directly from your IDE.
- Reduce deployment risks by isolating migrations in dedicated branches before they hit production.
- Save time on infrastructure setup with create_database for rapid environment provisioning.
- Keep your environment clean by using delete_branch to purge obsolete testing grounds.
- Optimize global latency by identifying the best physical cloud zones with list_regions.
- Simplify audits by using list_organizations and list_databases to see your entire fleet at once.

## How It Works

The bottom line is you get full control over your MySQL infrastructure through a chat interface.

1. Subscribe to the PlanetScale MCP via the Vinkius catalog.
2. Provide an active PlanetScale Service Token in your AI client settings.
3. Manage your MySQL clusters and branches using natural language in Cursor or Claude.

## Frequently Asked Questions

**Can I use PlanetScale MCP to manage my MySQL databases?**
Yes. This Connector gives your agent the ability to provision, branch, and manage your distributed MySQL clusters using natural language commands.

**How does PlanetScale MCP handle database branching?**
It allows you to fork your production schema into a new, isolated branch. This is perfect for testing migrations without affecting your live data.

**Can my AI agent delete my PlanetScale databases?**
Yes, it can use the delete tool to remove a cluster. It is best practice to list your databases first to ensure you are targeting the correct environment.

**Does PlanetScale MCP support global regions?**
Yes. Your agent can identify all the physical cloud availability zones supported by the backend, helping you choose the best spot for low latency.

**Is PlanetScale MCP good for DevOps engineers?**
It is excellent for DevOps. It automates the tedious parts of infrastructure management, like purging stale branches and auditing distribution footprints.

**How do I provision a new database with PlanetScale MCP?**
Just tell your agent to create a new database. It will handle the provisioning of a managed MySQL cluster in your preferred region.

**Can I run destructive commands like deleting databases through this AI implementation?**
Yes. The integration provides `delete_branch` and `delete_database`. They map directly to infrastructure teardowns. You should scope the Service Token carefully inside the PlanetScale dashboard to avoid catastrophic misinterpretations if your explicit intent is just testing. Deletions via `delete_database` are absolute and irretrievable.

**Does `create_branch` replicate and copy my production dataset into the new branch?**
No. PlanetScale branches solely duplicate the static underlying DDL structure (schema), exactly like taking a snapshot of empty tables. The new branch boots up free of rows. This design lets your agent freely run `ALTER TABLE` operations independently without crashing the master tables.

**How does the agent know which organizational node I am provisioning my branches on?**
All queries essentially require the foundational string parameters known as the `org_name`. If unknown, a simple `list_organizations` query reveals the UUID scope dictating your authorized account parameter bounds securely.