io.prisma/mcp
MCP server for managing Prisma Postgres.
★ 40No licensedatabases
Install
Config snippet generator goes here (5 client tabs)
README
## Overview
The [Model-Context-Protocol](https://modelcontextprotocol.io/introduction) (MCP) gives LLMs a way to call APIs and thus access external systems in a well-defined manner.
Prisma's provides two MCP servers: a _local_ and a _remote_ one. See below for specific information on each.
If you're a developer working on a local machine and want your AI agent to help with your database workflows, use the local MCP server.
If you're building an "AI platform" and want to give the ability to manage database to your users, use the remote MCP server.
## Remote MCP server
You can start the remote MCP server as follows:
```terminal
npx -y mcp-remote https://mcp.prisma.io/mcp
```
### Tools
[Tools](https://modelcontextprotocol.io/docs/concepts/tools) represent the _capabilities_ of an MCP server. Here's the list of tools exposed by the remote MCP server:
- `CreateBackupTool`: Create a new managed Prisma Postgres Backup.
- `CreateConnectionStringTool`: Create a new Connection String for a Prisma Postgres database with the given id.
- `CreateRecoveryTool`: Restore a Prisma Postgres Database to a new database with the given Backup id.
- `DeleteConnectionStringTool`: Delete a Connection String with the given connection string id.
- `DeleteDatabaseTool`: Delete a Prisma Postgres database with the given id.
- `ListBackupsTool`: Fetch a list of available Prisma Postgres Backups for the given database id and environment id.
- `ListConnectionStringsTool`: Fetch a list of available Prisma Postgres Database Connection Strings for the given database id and environment id.
- `ListDatabasesTool`: Fetch a list of available Prisma Postgres Databases for user's workspace.
- `ExecuteSqlQueryTool`: Execute a SQL query on a Prisma Postgres database with the given id.
- `IntrospectSchemaTool`: Introspect the schema of a Prisma Postgres database with the given id.
Once you're connected to the remote MCP server, you can also always prompt your AI agent to "List the Prisma tools" to get a full overview of the latest supported tools.
### Usage
The remote Prisma MCP server follows the standard JSON-based configuration for MCP servers. Here's what it looks like:
```json
{
"mcpServers": {
"Prisma-Remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"]
}
}
}
```
> [!TIP]
> If you want to try it the remote MCP server and explore it's capabilities, we recommend [Cloudflare's AI Playground](https://playground.ai.cloudflare.com/) for that. Add the `https://mcp.prisma.io/mcp` URL into the text field with the **Enter MCP server URL** placeholder, click **Connect**, and then authenticate with the [Prisma Console](https://console.prisma.io) in the popup window. Once connected, you can send prompts to the Playground and see what MCP tools the LLM chooses based on your prompts.
### Sample prompts
- "Show me a list of all the databases in my account."
- "Create a new database in the US region for me."
- "Seed my database with real-looking data but create a backup beforehand."
- "Show me all available backups of my database."
- "Show me all customers and run an analysis over their orders."
## Local MCP server
You can start the local MCP server as follows:
```terminal
npx -y prisma mcp
```
> [!TIP]
> If you're using VS Code, you can use [VS Code agent mode](https://code.visualstudio.com/docs/copilot/chat/chat-agent-mode) to enter prompts such as "create Postgres database" or "apply schema migration" directly in the chat. The VS code agent handles all underlying Prisma CLI invocations and API calls automatically. See our [VS Code Agent documentation](/postgres/integrations/vscode-extension#agent-mode) for more details.
### Tools
[Tools](https://modelcontextprotocol.io/docs/concepts/tools) represent the _capabilities_ of an MCP server. Here's the list of tools exposed by the local MCP server:
- `migrate-status`: Checks your migration status via the `prisma migrate status` command.
- `migrate-dev`: Creates and executes a migration via the `prisma migrate dev --name <name>` command. The LLM will provide the `<name>` option.
- `migrate-reset`: Resets your database via the `prisma migrate reset --force` command.
- `Prisma-Postgres-account-status`: Checks your authentication status with [Prisma Console](https://console.prisma.io) via the `platform auth show --early-access` command.
- `Create-Prisma-Postgres-Database`: Creates a new Prisma Postgres database via the `'init --db --name' <name> '--region' <region> '--non-interactive'` command. The LLM will provide the `<name>` and `<region>` options.
- `Prisma-Login`: Authenticates with [Prisma Console](https://console.prisma.io) via the `platform auth login --early-access` command.
- `Prisma-Studio`: Open Prisma Studio via the `prisma studio` command.
### Usage
The local Prisma MCP server follows the standard JSON-based configuration for MCP servers. Here's what it looks like:
```json
{
"mcpServers": {
"Prisma-Local": {