Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions content/200-orm/800-more/350-ai-tools/500-chatgpt.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
---
title: 'ChatGPT'
metaTitle: 'Using the Prisma MCP Server with ChatGPT'
metaDescription: 'Learn how to add the remote Prisma MCP server to ChatGPT to manage your Prisma Postgres databases.'
tocDepth: 3
toc: true
---

[ChatGPT](https://openai.com/chatgpt) is a large language model-based chatbot developed by OpenAI. You can extend its capabilities by connecting it to external tools, such as the Prisma MCP server, to interact with your Prisma Postgres databases.

This guide explains how to add the remote Prisma MCP server to ChatGPT, allowing you to create and manage your databases using natural language prompts.

:::tip[ChatGPT MCP integration is experimental]

This feature is still in development by OpenAI and might look or work a little differently over time. Some users may not have access to it yet.

If you notice that something has changed or doesn't match this guide, please [open an issue](https://github.com/prisma/docs/issues) or submit a pull request to update our docs.
:::

Here is an end to end demo of setting up the remote Prisma MCP server and using it in ChatGPT:

![Using the remote Prisma MCP server in ChatGPT](/img/orm/chatgpt-demo.gif)


## Features of the Prisma MCP server

By connecting the Prisma MCP server to ChatGPT, you can perform a variety of database management tasks directly from the chat interface. Here are some of the key features available:

- **Database management**: Create, list, and delete your Prisma Postgres databases.
- **Connection strings**: Generate, list, and revoke database connection strings.
- **Backup and recovery**: Create and list database backups, and restore a database from a backup.
- **Schema and Data interaction**: Execute SQL queries, introspect your database schema to understand its structure, and apply schema updates.
- **Workspace information**: Fetch details about your Prisma workspace.

## Prerequisites

To use the Prisma MCP server with ChatGPT, you need access to ChatGPT's Developer Mode. This feature is available on specific ChatGPT plans. For the most up-to-date information on supported plans, please refer to the [official OpenAI documentation](https://platform.openai.com/docs/guides/developer-mode).

## Enable Developer mode in ChatGPT

1. Go to **Settings** in your ChatGPT account.
2. Click **Apps & Connectors**.
3. Scroll down and locate **Advanced settings**, then click it.
4. Toggle the **Developer mode** button on.
5. Click **Back**.

## Add the remote Prisma MCP server

1. Make sure "Developer mode" is enabled.
2. Go to the **Apps & Connectors** section of your **Settings**.
3. On the top right, locate and click **Create**.
4. A "New Connector" popup will open. Fill in the text fields as follows:
- **Icon**: You can download and use the [Prisma favicon](https://www.prisma.io/favicon.ico).
- **Name**: `Prisma MCP server`
- **Description**: `Manage Prisma Postgres databases`
- **MCP Server URL**: `https://mcp.prisma.io/mcp`
- **Authentication**: `OAuth`
5. Check the "I trust this application" box and click **Create**.

You will be redirected to authenticate with your Prisma Data Platform account and choose your desired workspace. After successful authentication, you will be redirected back to ChatGPT.

## Using the remote Prisma MCP server

Once Developer Mode is enabled and the Prisma MCP server is added, you can use it in your chats.

1. In ChatGPT, click the **+** icon to the left of the chat input box.
2. Click **More**.
3. Select the **Prisma MCP server** to add it to your chat as a connector.

Now you can use natural language prompts to manage your database. For example:

```
Create a DB called pet-app for me near Paris
```
2 changes: 1 addition & 1 deletion content/200-orm/800-more/350-ai-tools/index.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: 'AI tools'
metaTitle: 'AI tools'
metaDescription: 'Learn tips and best practices for using Prisma ORM in AI coding tools, like Cursor, Tabnine, Lovable, v0 and more.'
metaDescription: 'Learn tips and best practices for using Prisma ORM in AI coding tools, like Cursor, ChatGPT, Tabnine, Lovable, v0 and more.'
hide_table_of_contents: true
---

Expand Down
4 changes: 4 additions & 0 deletions content/250-postgres/350-integrations/400-mcp-server.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,10 @@ Alternatively, you can add the _remote_ MCP server as an [integration](https://w
- **Integration URL**: `https://mcp.prisma.io/mcp`
1. Click **Add**

### ChatGPT

You can add the remote Prisma MCP server to ChatGPT to manage your Prisma Postgres databases using natural language. Learn more about setting it up in our [ChatGPT integration guide](/orm/more/ai-tools/chatgpt).

### OpenAI Agents SDK

Here's an example for using the Prisma MCP servers in a Python script via the OpenAI Agents SDK:
Expand Down
4 changes: 2 additions & 2 deletions content/800-guides/160-tanstack-start.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ community_section: true

## Introduction

Prisma ORM simplifies database interactions, and [TanStack Start](https://tanstack.com/start/latest/docs/framework/react/overview) offers a robust framework for building modern React applications. Together with [Prisma Postgres](https://www.prisma.io/postgres), they provide a seamless full-stack development experience with type-safe queries and efficient data management.
Prisma ORM simplifies database interactions, and [TanStack Start](https://tanstack.com/start/latest/docs/framework/react/guide/server-functions) offers a robust framework for building modern React applications. Together with [Prisma Postgres](https://www.prisma.io/postgres), they provide a seamless full-stack development experience with type-safe queries and efficient data management.

This guide will walk you through integrating Prisma ORM with a Prisma Postgres database in a TanStack Start project from scratch.

Expand Down Expand Up @@ -504,7 +504,7 @@ If you choose not to use one, **avoid** instantiating `PrismaClient` globally in

### 3.2 Fetch users and posts on load

First, import the necessary modules. Then, create a server function using the [`createServerFn`](https://tanstack.com/start/latest/docs/framework/react/server-functions#defining-server-functions) function. This function will fetch the users from the database using the `.findMany()` method. Use the [`include`](/orm/prisma-client/queries/relation-queries#include-a-relation) option to fetch the related posts:
First, import the necessary modules. Then, create a server function using the [`createServerFn`](https://tanstack.com/start/latest/docs/framework/react/guide/server-functions) function. This function will fetch the users from the database using the `.findMany()` method. Use the [`include`](/orm/prisma-client/queries/relation-queries#include-a-relation) option to fetch the related posts:

```typescript file=app/routes/index.tsx
// add-start
Expand Down
16 changes: 8 additions & 8 deletions content/900-ai/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -34,28 +34,28 @@ Prisma ORM and Prisma Postgres integrate seamlessly with your AI coding tools. C
<LinkCard
icon="fa-brands fa-cursor"
title="Cursor"
desc="Set up Prisma ORM from scratch with a SQLite database in 5 minutes."
desc="Define project-specific rules and use your schema as context to generate accurate queries and code."
link="/orm/more/ai-tools/cursor"
/>
<LinkCard
icon="fa-brands fa-windsurf"
title="Windsurf"
desc="Explore our ready-to-run examples with your favorite frameworks and libraries."
desc="Automate your database workflows by generating schemas, queries, and seed data in this AI-powered editor."
link="/orm/more/ai-tools/windsurf"
/>
</Grid>
<Grid>
<LinkCard
icon="fa-brands fa-openai"
icon="fa-brands fa-github"
title="Github Copilot"
desc="Set up Prisma ORM from scratch with a SQLite database in 5 minutes."
desc="Get Prisma-aware code suggestions, run CLI commands from chat, and query the Prisma docs."
link="/orm/more/ai-tools/github-copilot"
/>
<LinkCard
icon="fa-brands fa-tabnine"
title="Tabnine"
desc="Explore our ready-to-run examples with your favorite frameworks and libraries."
link="/orm/more/ai-tools/tabnine"
icon="fa-brands fa-openai"
title="ChatGPT"
desc="Learn how to connect the Prisma MCP server to ChatGPT to manage your databases with natural language."
link="/orm/more/ai-tools/chatgpt"
/>
</Grid>

Expand Down
2 changes: 1 addition & 1 deletion sidebars.ts
Original file line number Diff line number Diff line change
Expand Up @@ -544,7 +544,7 @@ const sidebars: SidebarsConfig = {
"orm/more/ai-tools/cursor",
"orm/more/ai-tools/windsurf",
"orm/more/ai-tools/github-copilot",
"orm/more/ai-tools/tabnine",
"orm/more/ai-tools/chatgpt",
],
},
{
Expand Down
6 changes: 3 additions & 3 deletions src/data/indexData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,8 @@ export const how_do_i = [
{
title: "Get started with Prisma & AI?",
description:
"Learn how to get started with Prisma and AI, from setting up Prisma ORM in tools like ChatGPT, Cursor, Windsurf, GitHub Copilot, and Tabnine to using the Prisma MCP server for database automation. Explore step-by-step guides, real-world examples with Next.js, and integrations with Vercel AI SDK and Firebase Studio. Build faster, stay type-safe, and connect Prisma Postgres with thousands of apps to power your AI-driven workflows.",
url: "/ai"
"Learn how to get started with Prisma and AI, from setting up Prisma ORM in tools like ChatGPT, Cursor, Windsurf, GitHub Copilot and Tabnine to using the Prisma MCP server for database automation. Explore step-by-step guides, real-world examples with Next.js, and integrations with Vercel AI SDK and Firebase Studio. Build faster, stay type-safe, and connect Prisma Postgres with thousands of apps to power your AI-driven workflows.",
url: "/ai",
},
{
title: "Model my schema?",
Expand Down Expand Up @@ -280,5 +280,5 @@ export const how_do_i = [
// tags: ["guides", "schema", "orm"],
url: "/orm/prisma-client/setup-and-configuration/generating-prisma-client",
// time: 15
}
},
];
Binary file added static/img/orm/chatgpt-demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading