Announcing CIMD support for MCP Client registration
Learn more

Prisma MCP vs Prisma API for AI Agents (2026)

Srinivas Karre
Founding Engineer

TL;DR

  • Prisma exposes two MCP servers and a REST API. The remote MCP server at mcp.prisma.io/mcp ships 19 tools for managing Prisma Postgres; the REST API at api.prisma.io/v1 exposes the full workspace, project, and database hierarchy behind an OpenAPI 3.1 spec.
  • The two surfaces overlap heavily on Postgres management, but each has an exclusive. The MCP server runs SQL and answers documentation questions with citations. The REST API adds projects and workspaces as managed resources, per-database usage metering, and a provision-then-transfer claim flow.
  • The MCP path is OAuth only; Scalekit classifies the flow as OAuth 2.1 with Dynamic Client Registration (DCR). The REST API adds service tokens for headless use, and those service tokens never expire, which is a credential-management liability rather than a convenience.
  • For a multi-tenant B2B agent, both paths hand you one credential per user, or one workspace-admin token per app. Neither stores, rotates, or revokes it for you. That is infrastructure you own regardless of the path.
  • Scalekit's Prisma connector wraps the remote MCP server with per-user connected accounts and a token vault. A Virtual MCP server scopes the 19 tools down to the few an agent actually needs, so a read-only reporting agent never holds prismamcp_delete_prisma_postgres_database.

Your agent needs to manage Prisma Postgres, and you have noticed Prisma ships both a Model Context Protocol (MCP) server and a REST API. They look interchangeable from a distance: both create databases, both manage backups, both hand back connection strings. They are not interchangeable. The capability coverage differs in both directions, the auth models put you on different paths, and one of them carries a credential that never expires. Here is how to pick the one your agent should build against.

What Prisma ships: two MCP servers and a REST API

Before comparing paths, it helps to be precise about what "Prisma MCP" and "Prisma API" actually refer to, because Prisma ships three distinct surfaces and only two of them are relevant to a production agent.

The remote Prisma MCP server

The remote Prisma MCP server is a hosted endpoint at https://mcp.prisma.io/mcp, introduced with Prisma ORM v6.10.0 in June 2025 and built for AI tools and platforms that manage Prisma Postgres on behalf of their users. It speaks standard HTTP transport and authenticates against Prisma Console on the first connection. Scalekit classifies that flow as OAuth 2.1 with DCR. This is the server Scalekit's Prisma connector wraps, and its 19 tools cover workspace details, database lifecycle, connection strings, backups and recovery, schema introspection, SQL execution, object-store buckets, and documentation search.

The local Prisma MCP server

The local server shipped earlier, in Prisma CLI v6.6.0 in April 2025, and it runs on a developer machine over npx prisma mcp. It is the coding-agent path: it exposes Prisma CLI operations such as migrate-status, migrate-dev, Create-Prisma-Postgres-Database, and Prisma-Studio so an editor agent can run migrations and scaffold schemas in the repository where they live. It is stdio, per-developer, and has no centralized credential model, which rules it out for multi-tenant deployments but makes it ideal inside Cursor, VS Code, or Claude Code.

The Prisma REST API

The Prisma REST API, also called the Management API, is the control plane for Prisma Postgres. It lives at https://api.prisma.io/v1, is described by a public OpenAPI 3.1 specification, and ships an official TypeScript SDK, @prisma/management-api-sdk. It models the full account hierarchy as first-class resources: workspaces, projects, databases, connections, backups, usage, buckets, integrations, regions, and service tokens. It also supports partner integrations, where you provision a database in your own workspace and later transfer ownership to a user.

What your agent can actually do

The honest comparison here is not "the API is a superset of the MCP server." It is not. The two surfaces overlap on Prisma Postgres management, and then each one adds something the other does not have. Name the overlap first, then name both gaps precisely.

Where the surfaces overlap

Both paths cover the core Prisma Postgres management loop that most database agents need. Listing databases, creating and deleting a database, managing connection strings, listing backups and restoring to a new database, and managing object-store buckets and their access keys are all available on both. If your agent only does managed-database housekeeping, either path is technically sufficient, and the decision falls to auth rather than capability.

What only the MCP server gives you

The MCP server bundles two capabilities the control-plane API does not expose as endpoints. prismamcp_execute_sql_query runs a SQL query against a database and returns JSON, and prismamcp_execute_prisma_postgres_schema_update applies a DDL change, both without your agent holding a connection string or a Postgres driver. prismamcp_search_prisma_documentation answers natural-language questions about Prisma ORM, Prisma Postgres, Accelerate, and migrations, grounded in the official docs with citations. For an interactive agent, running a query and explaining a migration in one tool surface is a real convenience.

What only the REST API gives you

The REST API exposes the parts of the account model the MCP server leaves out. Projects and workspaces are managed resources you can create and organize, per-database usage is a metering endpoint rather than a workspace-level summary, and available regions and integrations are queryable rather than hard-coded. Most consequentially for B2B products, the API supports the claim flow: provision a database under your service token, then transfer it into the user's own Prisma workspace through an OAuth handoff. None of that exists on the MCP server.

Capability
Prisma MCP (remote)
Prisma REST API
List databases; create and delete a database
Yes
Yes
Manage connection strings
Yes
Yes
List backups and restore to a new database
Yes
Yes
Object-store buckets and access keys
Yes
Yes
Run a SQL query against a database
Yes
Via connection string
Apply a DDL schema change
Yes
Via connection string
Introspect a schema as JSON
Yes
Via connection string
Search the Prisma docs with citations
Yes
No
Projects and workspaces as managed resources
Not exposed
Yes
Per-database usage metering
Workspace-level only
Yes
Provision, then hand off a database to a user
No
Yes
Headless auth without a browser
No
Yes

One precise limitation worth flagging: the MCP prismamcp_create_prisma_postgres_backup tool does not create on-demand backups. Backups on that path are created automatically by the system, so an agent that needs to force a snapshot before a risky migration cannot rely on the MCP tool to do it.

The auth path each one puts you on

Capability decides less here than authentication does. This is the axis where the two paths genuinely diverge, and it is the axis that determines whether your agent can run without a human in the loop.

Prisma MCP: OAuth only

The remote MCP server authenticates against Prisma Console on first use, and that is the entire list of options. Scalekit classifies the flow as OAuth 2.1 with DCR, which means the client registers dynamically rather than requiring you to create an OAuth application by hand. The upside is a clean, consent-driven connection per user. The constraint is that there is no non-interactive path: every connection begins with a browser, and there is no service credential a background job can present. For an agent that acts inside a user's own Prisma workspace during a session, this is exactly right. For a scheduled job with no user present, it is a wall.

The REST API: service tokens or OAuth 2.0

The REST API supports two methods, and the second one is what the MCP server lacks. OAuth 2.0 with PKCE covers user-delegated access, using the workspace:admin and offline_access scopes, with access tokens that live one hour and refresh tokens that live 90 days under single-use rotation with replay detection. Service tokens cover everything else: a bearer token you create once in Prisma Console and present from a script, a CI pipeline, or a backend. Service tokens are the headless path. They are also the sharp edge, because Prisma's own documentation is explicit that service tokens never expire; a leaked token stays valid until you manually revoke it.

What this means for multi-tenant B2B agents

Both paths require per-user credential isolation in a multi-tenant B2B agent, and the path itself does not provide it. If your product manages databases inside each customer's own Prisma workspace, you want OAuth per user, which both the MCP server and the REST API support. If your product provisions databases for users, owning the infrastructure yourself, you want the service token plus the claim flow, which only the REST API supports. In neither case does Prisma store, rotate, or revoke those credentials for you. What the user cannot do, the agent cannot do, but only if you scope and hold the credential correctly in the first place.

Dimension
Prisma MCP (remote)
Prisma REST API
OAuth for user-delegated access
Yes, OAuth 2.1 with DCR
Yes, OAuth 2.0 with PKCE
Manual OAuth app registration
Not required, DCR handles it
Required, register in Prisma Console
Headless service credential
Not supported
Service token, bearer
OAuth access token lifetime
Short-lived, session-refreshed
1 hour
Service token lifetime
Not applicable
Never expires
Refresh model
Handled by the MCP client session
Refresh token, 90 days, single-use rotation

What you own in production

Both paths hand off some operational burden and keep some. The useful question is what breaks, what needs your attention, and who owns the fix.

With the MCP path

Prisma hosts the remote server, maintains the tool schemas, and normalizes the endpoints, so you do not run a container or patch a server. What you still own is the credential lifecycle: token storage per user, proactive refresh, tenant isolation, and revocation when a user leaves. You also inherit schema drift. When Prisma updates the server, the tool set can change; the server itself invites you to prompt "List the Prisma tools" to see the current surface, which is a polite way of saying the surface is not version-pinned.

With the REST API path

You own more of the stack and get more stability in return. Request construction, pagination, retries, and error handling are yours, and so is the full token lifecycle, including the never-expiring service token that has to live in a secrets manager and be rotated on your schedule. In exchange, the contract is versioned under /v1 and described by an OpenAPI 3.1 spec, so a deterministic pipeline calling the same three endpoints every night is not going to shift under you because an MCP tool was renamed upstream.

Safety guardrails worth knowing

Prisma builds a guardrail into the CLI, which matters on the local MCP path. When the Prisma CLI detects that an AI agent such as Cursor or Claude Code is invoking a destructive command like prisma migrate reset --force, it blocks execution and refuses to proceed until the agent surfaces the risk and the user consents through the PRISMA_USER_CONSENT_FOR_DANGEROUS_AI_ACTION variable. This protects the editor workflow. It does not extend to the remote server's prismamcp_delete_prisma_postgres_database, which is an ordinary tool call; guarding that destructive surface is on you.

When to use MCP, when to use the API

The decision is not about which is better. It is about which matches the agent you are shipping.

Use Prisma MCP when

  • You are building an interactive agent or an AI platform where users manage their own Prisma Postgres databases in natural language, session by session.
  • You want SQL execution, schema introspection, and documentation Q&A in a single tool surface, without wiring up a connection string and a driver.
  • You are inside a coding agent such as Cursor, VS Code, or Claude Code and want the local server to run migrations and scaffold schemas in the repository.
  • You are fine with OAuth per user and do not need a headless credential for background work.

Use the Prisma REST API when

  • You are running headless: provisioning a database on signup, metering usage on a schedule, or reconciling state with no user present.
  • You are building a partner integration that provisions databases in your workspace and later transfers them to users through the claim flow.
  • You need projects, workspaces, regions, or per-database usage as first-class resources rather than a workspace-level summary.
  • You want a versioned, OpenAPI-described contract for a deterministic pipeline that must not shift when the MCP tool set changes.

The credential problem that exists on both paths

The auth divergence is real, and it obscures a problem sitting underneath both choices. Whichever path you pick, you end up holding a credential you now have to manage.

What neither path hands you

Both paths produce a credential per identity. The MCP OAuth flow gives you a token per user. The REST API gives you a token per user on the OAuth path, or a workspace-admin service token per app on the headless path. What neither gives you is the infrastructure around that credential. Storage outside the agent runtime, encrypted at rest and isolated per tenant. Proactive refresh, because Prisma's OAuth access tokens expire in one hour and its refresh tokens rotate single-use. Revocation, because a service token never expires on its own and a churned customer's credential has to be found and killed by something. In a multi-tenant product, that is N credentials, each with its own lifecycle, and the path you chose only changed the token type.

Where Scalekit fits

This is the layer Scalekit's Prisma connector operates at. It wraps the remote Prisma MCP server with per-user connected accounts and a token vault, so credentials never touch your agent runtime and the OAuth 2.1 with DCR flow, token storage, and refresh are handled for you. The MCP-versus-API decision stops changing your auth infrastructure, because the connected-account model holds the credential either way.

Building a Prisma agent with Scalekit

The pattern below connects a user to Prisma, retrieves only the tools that user is authorized to call, and runs a full Claude tool-use loop against them. It uses the Scalekit Node SDK with the Anthropic SDK; the same flow is available in Python.

Install the two SDKs to start.

npm install @scalekit-sdk/node @anthropic-ai/sdk

Connect the user to Prisma

The connection is per user, and the connection name must match the connection you configured in the Scalekit dashboard exactly; for the Prisma connector that name is prismamcp. Check whether the user already has an active connected account, and only send them through authorization if they do not.

import { ScalekitClient } from '@scalekit-sdk/node'; import { ConnectorStatus } from '@scalekit-sdk/node/lib/pkg/grpc/scalekit/v1/connected_accounts/connected_accounts_pb'; import Anthropic from '@anthropic-ai/sdk'; const scalekit = new ScalekitClient( process.env.SCALEKIT_ENV_URL!, process.env.SCALEKIT_CLIENT_ID!, process.env.SCALEKIT_CLIENT_SECRET!, ); const anthropic = new Anthropic(); // 'prismamcp' must match the connection name in your Scalekit dashboard const { connectedAccount } = await scalekit.actions.getOrCreateConnectedAccount({ connectionName: 'prismamcp', identifier: 'user_123', }); if (connectedAccount?.status !== ConnectorStatus.ACTIVE) { const { link } = await scalekit.actions.getAuthorizationLink({ connectionName: 'prismamcp', identifier: 'user_123', }); console.log('Authorize Prisma:', link); }

Retrieve the tools this user is authorized to call

The agent does not load a flat catalog of every Prisma tool. listScopedTools returns the tools the current user's connected account is authorized to call, and no more. Scalekit returns them with an input_schema in Anthropic's native format, so no conversion is needed before passing them to Claude.

// Retrieve the tools authorized for this user's connected account const { tools } = await scalekit.tools.listScopedTools('user_123', { filter: { connectionNames: ['prismamcp'] }, pageSize: 100, // fetch beyond the default page so no connector tools are missed }); const llmTools = tools.map(t => ({ name: t.tool.definition.name, description: t.tool.definition.description, input_schema: t.tool.definition.input_schema, }));

Run the agent loop

With the scoped tools in hand, run the loop. Construct the message, call messages.create with the tools, check the stop reason, execute each requested tool through executeTool, append the results, and continue until Claude finishes.

const messages: Anthropic.MessageParam[] = [ { role: 'user', content: 'List my databases, then show the row count per table in the production one' }, ]; while (true) { const response = await anthropic.messages.create({ model: 'claude-sonnet-4-6', max_tokens: 1024, tools: llmTools, messages, }); if (response.stop_reason === 'end_turn') { const text = response.content.find(b => b.type === 'text'); if (text?.type === 'text') console.log(text.text); break; } const toolResults: Anthropic.ToolResultBlockParam[] = []; for (const block of response.content) { if (block.type === 'tool_use') { const result = await scalekit.actions.executeTool({ toolName: block.name, // e.g. prismamcp_list_prisma_postgres_databases identifier: 'user_123', toolInput: block.input as Record<string, unknown>, }); toolResults.push({ type: 'tool_result', tool_use_id: block.id, content: JSON.stringify(result.data), }); } } messages.push({ role: 'assistant', content: response.content }); messages.push({ role: 'user', content: toolResults }); }

Scope the surface with a Virtual MCP server

The remote Prisma server exposes 19 tools, and most agents need a handful. Handing all 19 to an agent that only reads data is two problems at once. It is an overreach problem, because a reporting agent now has prismamcp_delete_prisma_postgres_database and prismamcp_delete_object_store_bucket in reach. It is a cost problem, because 19 tools at roughly 200 tokens each is close to 3,800 tokens of schema in every context window before the agent reads a single row.

A Virtual MCP server fixes both. You define one scoped endpoint per agent role, declaring exactly which tools it exposes — for example prismamcp_list_prisma_postgres_databases, prismamcp_introspect_database_schema, and prismamcp_execute_sql_query for a read-only analytics agent, and nothing destructive. The endpoint is static and created once. Per-user isolation is handled at runtime by a short-lived session token minted before each run and scoped to that user's connected accounts, so one server definition serves every user without sharing credentials. The agent sees only the tools you explicitly allow, not everything the connector exposes, and there is no MCP server for you to deploy, host, or maintain.

Compatible MCP hosts connect to the generated endpoint directly with the URL and session token as bearer auth.

{ "mcpServers": { "scalekit": { "transport": "streamable-http", "url": "your-scalekit-mcp-url" } } }

Observability: who called what, with whose credentials

Because every authorization and every executeTool call is tied to a specific user identifier and a specific connected account, you get a downstream record of which user's Prisma credential executed which tool, rather than a shared service account that flattens every action into one identity. That is the audit trail security teams ask for when they move an agent from beta to production, and it is the difference between answering "under whose credentials did the agent drop that database" and guessing. If you are assembling a database-touching agent, the DevOps assistant agent and the incident response agent template are useful starting points.

Which one to build against

If your agent is interactive, user-facing, and acts inside each user's own Prisma workspace during a session, the remote MCP server is the right path: it is OAuth-native, it bundles SQL and docs Q&A, and Prisma maintains the server. If your agent is headless, provisions databases for users, or needs the account hierarchy and the claim flow, the REST API is the only path that reaches those capabilities, and its versioned contract is the safer foundation for a deterministic pipeline. The single question that usually settles it: does the agent need to act without a browser in the loop? If yes, the REST API. If no, the MCP server is on the table. Either way, the credential you end up holding is the same problem, and that is the part that needs production-grade token management infrastructure rather than a token in a database row.

Build your Prisma agent

Start from the Scalekit Prisma connector docs, or browse the connector on the Scalekit Prisma connector page.

Building a Prisma agent and want a second pair of eyes on the auth model? Join the Scalekit Slack community, or explore why MCP is sometimes more expensive than CLI alternatives before you finalize your architecture.

No items found.
Agent
Auth Quickstart
On this page
Share this article
Agent
Auth Quickstart

Acquire enterprise customers with
zero upfront cost.

Every feature unlocked. No hidden fees.