# Run agents with PlanetScale

PlanetScale AI agents on Rush: connect PlanetScale once, then name it on any run. The agent works in its own cloud computer, with a record of every run.

[Connect PlanetScale](https://cloud.getrush.ai/console/settings/?section=connections) in the console under Settings → Connections.

## What an agent can do in PlanetScale

Inspect databases, branches and schemas, analyze query performance with Insights, and run queries with the permissions you grant.

## Jobs on Rush that use PlanetScale

- [Which Orders Are Stuck Between Paid and Shipped? A Back-Office App's Morning Check of Each Marketplace's PlanetScale Database](https://getrush.ai/run/find-orders-stuck-between-paid-and-shipped/planetscale/)
- [Which Queries Got Slower This Month? A Database Consultancy's PlanetScale Review for Each Client](https://getrush.ai/run/review-each-clients-slow-queries/planetscale/)

## How PlanetScale connects

PlanetScale is a remote MCP server, published by PlanetScale, at `https://mcp.pscale.dev/mcp/planetscale`. Connecting it signs in through the MCP OAuth flow on PlanetScale's side.

From PlanetScale: [PlanetScale's MCP documentation](https://planetscale.com/docs/mcp-server).

Connect it once in the console under Settings → Connections, or from your server with `POST /me/connections`. The sign-in finishes in a browser signed in to the console as the same person, and a link not finished within 10 minutes expires.

After that, a run that names `planetscale` in `connections`, or runs a saved agent that names it, gets it; your connections reach no run that does not name them.

```http
POST https://api.phoenix.so/me/connections

{
  "type": "mcp",
  "name": "PlanetScale",
  "url": "https://mcp.pscale.dev/mcp/planetscale"
}
```

## Whose PlanetScale account the agent uses

Your PlanetScale connection is personal: it belongs to the person who signed in. A run started in the console uses that person's PlanetScale, and a run started with an API key uses the PlanetScale of the member who created the key.

To act for your own app's users, make each user an agent from your template and show them, signed in to your app, the sign-in link `POST /o/{org}/agents/{agent}/connections` returns. They sign in to their own PlanetScale, and that agent's runs use their account and nothing else: never yours, never another user's.

## More Database integrations

- [Supabase](https://getrush.ai/integrations/supabase/)
- [Neon](https://getrush.ai/integrations/neon/)
- [Prisma](https://getrush.ai/integrations/prisma/)

## Frequently asked questions

### How do I connect PlanetScale to Rush?

Open Settings → Connections in the console and connect PlanetScale, or send `POST /me/connections` with `{"type":"mcp","name":"PlanetScale","url":"https://mcp.pscale.dev/mcp/planetscale"}` and open the `authorize_url` it returns while signed in to the console. The connection reads `pending` until the sign-in finishes, then `connected`.

### Does every run get my PlanetScale account?

No. A run gets your PlanetScale connection only when it names it in `connections` (`"connections": ["planetscale"]`), or runs a saved agent that names it. A saved agent names its connections once, and every run of it gets them.

### What can an agent do in PlanetScale?

Inspect databases, branches and schemas, analyze query performance with Insights, and run queries with the permissions you grant. 2 published jobs use it; this page lists them.

### Can my app's users connect their own PlanetScale?

Yes. Make each user an agent from your template, and they sign in to their own PlanetScale through the link `POST /o/{org}/agents/{agent}/connections` returns. That agent's runs use their account alone.

## Keep reading

- [AI agents for engineering teams: every job and app for them](https://getrush.ai/solutions/engineering/)
- [How connections work: sign in once, then every run that names a connection gets it](https://getrush.ai/docs/concepts/connections/)
- [Start your first run from the developer API quickstart](https://getrush.ai/docs/quickstart/)
- [Pricing: one price per member, hours shared by the team](https://getrush.ai/pricing/)
- [How Rush compares with other cloud agents](https://getrush.ai/compare/)
- [Every app and MCP server Rush connects to](https://getrush.ai/integrations/)
