diff --git a/content/200-orm/800-more/350-ai-tools/500-chatgpt.mdx b/content/200-orm/800-more/350-ai-tools/500-chatgpt.mdx new file mode 100644 index 0000000000..374c1e31a0 --- /dev/null +++ b/content/200-orm/800-more/350-ai-tools/500-chatgpt.mdx @@ -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 +``` diff --git a/content/200-orm/800-more/350-ai-tools/index.mdx b/content/200-orm/800-more/350-ai-tools/index.mdx index 5d1b0e6d75..8b33bbe3ad 100644 --- a/content/200-orm/800-more/350-ai-tools/index.mdx +++ b/content/200-orm/800-more/350-ai-tools/index.mdx @@ -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 --- diff --git a/content/250-postgres/350-integrations/400-mcp-server.mdx b/content/250-postgres/350-integrations/400-mcp-server.mdx index 4d3a2d1bfa..e1c263571f 100644 --- a/content/250-postgres/350-integrations/400-mcp-server.mdx +++ b/content/250-postgres/350-integrations/400-mcp-server.mdx @@ -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: diff --git a/content/800-guides/160-tanstack-start.mdx b/content/800-guides/160-tanstack-start.mdx index 87e847d759..f65cd8dda4 100644 --- a/content/800-guides/160-tanstack-start.mdx +++ b/content/800-guides/160-tanstack-start.mdx @@ -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. @@ -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 diff --git a/content/900-ai/index.mdx b/content/900-ai/index.mdx index 507fd52b0c..223005e1d8 100644 --- a/content/900-ai/index.mdx +++ b/content/900-ai/index.mdx @@ -34,28 +34,28 @@ Prisma ORM and Prisma Postgres integrate seamlessly with your AI coding tools. C diff --git a/sidebars.ts b/sidebars.ts index 8ac2dc638d..cd9409623a 100644 --- a/sidebars.ts +++ b/sidebars.ts @@ -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", ], }, { diff --git a/src/data/indexData.ts b/src/data/indexData.ts index eb0a0d056b..29bc26ad8d 100644 --- a/src/data/indexData.ts +++ b/src/data/indexData.ts @@ -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?", @@ -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 - } + }, ]; diff --git a/static/img/orm/chatgpt-demo.gif b/static/img/orm/chatgpt-demo.gif new file mode 100644 index 0000000000..5ced96688e Binary files /dev/null and b/static/img/orm/chatgpt-demo.gif differ