Prisma MCP
Bridging LLMs and databases through standardized API protocols
Key Features
Use Cases
README
Overview
The Model-Context-Protocol (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:
npx -y mcp-remote https://mcp.prisma.io/mcp
Tools
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:
{
"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 for that. Add the
https://mcp.prisma.io/mcpURL into the text field with the Enter MCP server URL placeholder, click Connect, and then authenticate with the Prisma Console 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:
npx -y prisma mcp
[!TIP] If you're using VS Code, you can use VS Code 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 for more details.
Tools
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 theprisma migrate statuscommand.migrate-dev: Creates and executes a migration via theprisma migrate dev --name <name>command. The LLM will provide the<name>option.migrate-reset: Resets your database via theprisma migrate reset --forcecommand.Prisma-Postgres-account-status: Checks your authentication status with Prisma Console via theplatform auth show --early-accesscommand.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 via theplatform auth login --early-accesscommand.Prisma-Studio: Open Prisma Studio via theprisma studiocommand.
Usage
The local Prisma MCP server follows the standard JSON-based configuration for MCP servers. Here's what it looks like:
{
"mcpServers": {
"Prisma-Local": {
"command": "npx",
"args": ["-y", "prisma", "mcp"]
}
}
}
Sample prompts
Here are some sample prompts you can use when the MCP server is running:
- "Log me into the Prisma Console."
- "Create a database in the US region."
- "Create a new
Producttable in my database."
Integrating in AI tools
AI tools have different ways of integrating MCP servers. In most cases, there are dedicated configuration files in which you add the JSON configuration from above. The configuration contains a command for starting the server that'll be executed by the respective tool so that the server is available to its LLM.
In this section, we're covering the config formats of the most popular AI tools.
VS Code
If your browser blocks the link, you can set it up manually by creating a .vscode/mcp.json file in your workspace and adding:
{
"servers": {
"Prisma-Local": {
"command": "npx",
"args": ["-y", "prisma", "mcp"]
},
"Prisma-Remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"]
}
}
}
Explore additional Prisma features and workflows for VS Code in our docs.
Cursor
To learn more about Cursor's MCP integration, check out the Cursor MCP docs.
Add via one-click installation
You can add the Prisma MCP server to Cursor using the one-click installation by clicking on the following link:
This will prompt you to open the Cursor app in your browser. Once opened, you'll be guided to install the Prisma MCP server directly into your Cursor configuration.
Add via Cursor Settings UI
When opening the Cursor Settings, you can add the Prisma MCP Server as follows:
- Select MCP in the settings sidenav
- Click + Add new global MCP server
- Add the
Prismasnippet to themcpServersJSON object:json{ "mcpServers": { "Prisma-Local": { "command": "npx", "args": ["-y", "prisma", "mcp"] }, "Prisma-Remote": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"] } } }
Global configuration
Adding it via the Cursor Settings settings will modify the global ~/.cursor/mcp.json config file. In this case, the Prisma MCP server will be available in all your Cursor projects:
{
"mcpServers": {
"Prisma-Local": {
"command": "npx",
"args": ["-y", "prisma", "mcp"]
},
"Prisma-Remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"]
},
// other MCP servers
}
}
Project configuration
If you want the Prisma MCP server to be available only in specific Cursor projects, add it to the Cursor config of the respective project inside the .cursor directory in the project's root:
{
"mcpServers": {
"Prisma-Local": {
"command": "npx",
"args": ["-y", "prisma", "mcp"]
},
"Prisma-Remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"]
}
// other MCP servers
}
}
Windsurf
To learn more about Windsurf's MCP integration, check out the Windsurf MCP docs.
Add via Windsurf MCP Plugin Store (Recommended)
Use the Prisma MCP plugin from the Windsurf MCP Plugin Store. Follow the steps here to add the Prisma MCP plugin in Windsurf. This is the simplest and recommended way to add the Prisma MCP server to Windsurf.
Add via Windsurf Settings UI
When opening the Windsurf Settings (via Windsurf - Settings > Advanced Settings or Command Palette > Open Windsurf Settings Page), you can add the Prisma MCP Server as follows:
- Select Cascade in the settings sidenav
- Click Add Server
- Add the
Prisma-Localand/orPrisma-Remotesnippets to themcpServersJSON object:json{ "mcpServers": { "Prisma-Local": { "command": "npx", "args": ["-y", "prisma", "mcp"] }, "Prisma-Remote": { "command": "npx", "args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"] } } }
Global configuration
Adding it via the Windsurf Settings will modify the global ~/.codeium/windsurf/mcp_config.json config file. Alternatively, you can also manually add it to that file:
{
"mcpServers": {
"Prisma-Local": {
"command": "npx",
"args": ["-y", "prisma", "mcp"]
},
"Prisma-Remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"]
},
// other MCP servers
}
}
Warp
You can add the Prisma MCP to Warp as a globally available tool. First, visit your MCP settings and click + Add. From here, you can configure the Prisma MCP server as JSON. Use the command and args properties to start the Prisma MCP server as a setup command. You can optionally configure Prisma to activate on startup using the start_on_launch flag:
{
"Prisma": {
"command": "npx",
"args": [
"-y",
"prisma",
"mcp"
],
"env": {},
"working_directory": null,
"start_on_launch": true
}
}
Hit Save and ensure the MCP server is running from your MCP settings panel. Then, open a new terminal window and ask Warp to manage your Prisma database. It should reach for the Prisma MCP server automatically.
To learn more about Warp's MCP integration, visit the Warp MCP docs.
Claude Code
Claude Code is a terminal-based AI tool where you can add MCP server using the claud mcp add command for the local MCP server:
claude mcp add prisma-local npx prisma mcp
or for the remote MCP server:
claude mcp add prisma-remote npx mcp-remote https://mcp.prisma.io/mcp
Learn more in the Claude Code MCP docs.
Claude Desktop
Follow the instructions in the Claude Desktop MCP docs to create the required configuration file:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%\Claude\claude_desktop_config.json
Then add the JSON snippet to that configuration file:
{
"mcpServers": {
"Prisma-Local": {
"command": "npx",
"args": ["-y", "prisma", "mcp"]
},
"Prisma-Remote": {
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"]
},
// other MCP servers
}
}
OpenAI Agents SDK
Here's an example for using the Prisma MCP servers in a Python script via the OpenAI Agents SDK:
from openai import AsyncOpenAI
from openai.types.beta import Assistant
from openai.beta import AsyncAssistantExecutor
from openai.experimental.mcp import MCPServerStdio
from openai.types.beta.threads import Message, Thread
from openai.types.beta.tools import ToolCall
import asyncio
async def main():
# Launch both MCP servers concurrently
async with MCPServerStdio(
params={
"command": "npx",
"args": ["-y", "prisma", "mcp"]
}
) as local_server, MCPServerStdio(
params={
"command": "npx",
"args": ["-y", "mcp-remote", "https://mcp.prisma.io/mcp"]
}
) as remote_server:
# Optional: list tools from both servers
local_tools = await local_server.list_tools()
remote_tools = await remote_server.list_tools()
print("Local server tools:", [tool.name for tool in local_tools])
print("Remote server tools:", [tool.name for tool in remote_tools])
# Set up the assistant with both MCP servers
agent = Assistant(
name="Prisma Assistant",
instructions="Use the Prisma tools to help the user with database tasks.",
mcp_servers=[local_server, remote_server],
)
executor = AsyncAssistantExecutor(agent=agent)
# Create a thread and send a message
thread = Thread(messages=[Message(role="user", content="Create a new user in the database")])
response = await executor.run(thread=thread)
print("Agent response:")
for message in response.thread.messages:
print(f"{message.role}: {message.content}")
# Run the async main function
asyncio.run(main())
Star History
Repository Owner
Organization
Repository Details
Programming Languages
Tags
Join Our Newsletter
Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.
Related MCPs
Discover similar Model Context Protocol servers
Multi-Database MCP Server (by Legion AI)
Unified multi-database access and AI interaction server with MCP integration.
Multi-Database MCP Server enables seamless access and querying of diverse databases via a unified API, with native support for the Model Context Protocol (MCP). It supports popular databases such as PostgreSQL, MySQL, SQL Server, and more, and is built for integration with AI assistants and agents. Leveraging the MCP Python SDK, it exposes databases as resources, tools, and prompts for intelligent, context-aware interactions, while delivering zero-configuration schema discovery and secure credential management.
- ⭐ 76
- MCP
- TheRaLabs/legion-mcp
MongoDB MCP Server
A Model Context Protocol server for enabling LLM interaction with MongoDB databases.
MongoDB MCP Server empowers language models to interface directly with MongoDB databases using the Model Context Protocol (MCP). It enables natural language querying and management of collections, documents, and indexes. Users can inspect database schemas, execute document operations, and manage indexes seamlessly. The tool integrates with clients like Claude Desktop for conversational database management.
- ⭐ 172
- MCP
- QuantGeekDev/mongo-mcp
PGMCP
Natural language PostgreSQL interface via the Model Context Protocol.
PGMCP enables seamless interaction with any PostgreSQL database through natural language queries, translating user intent into structured SQL results. It acts as a Model Context Protocol (MCP) server, connecting AI assistants and MCP-compatible clients to databases with features like streaming, robust error handling, and optional AI-powered SQL generation. The tool ensures secure, read-only access to existing databases using HTTP/MCP protocol. Compatibility includes tools such as Cursor, Claude Desktop, and VS Code extensions.
- ⭐ 499
- MCP
- subnetmarco/pgmcp
mcp-graphql
Enables LLMs to interact dynamically with GraphQL APIs via Model Context Protocol.
mcp-graphql provides a Model Context Protocol (MCP) server that allows large language models to discover and interact with GraphQL APIs. The implementation facilitates schema introspection, exposes the GraphQL schema as a resource, and enables secure query and mutation execution based on configuration. It supports configuration through environment variables, automated or manual installation options, and offers flexibility in using local or remote schema files. By default, mutation operations are disabled for security, but can be enabled if required.
- ⭐ 319
- MCP
- blurrah/mcp-graphql
MCP 数据库工具 (MCP Database Utilities)
A secure bridge enabling AI systems safe, read-only access to multiple databases via unified configuration.
MCP Database Utilities provides a secure, standardized service for AI systems to access and analyze databases like SQLite, MySQL, and PostgreSQL using a unified YAML-based configuration. It enforces strict read-only operations, local processing, and credential protection to ensure data privacy and integrity. The tool is suitable for entities focused on data privacy and minimizes risks by isolating database connections and masking sensitive data. Designed for easy integration, it supports multiple installation options and advanced capabilities such as schema analysis and table browsing.
- ⭐ 85
- MCP
- donghao1393/mcp-dbutils
XiYan MCP Server
A server enabling natural language queries to SQL databases via the Model Context Protocol.
XiYan MCP Server is a Model Context Protocol (MCP) compliant server that allows users to query SQL databases such as MySQL and PostgreSQL using natural language. It leverages the XiYanSQL model, providing state-of-the-art text-to-SQL translation and supports both general LLMs and local deployment for enhanced security. The server lists available database tables as resources and can read table contents, making it simple to integrate with different applications.
- ⭐ 218
- MCP
- XGenerationLab/xiyan_mcp_server
Didn't find tool you were looking for?