Connect Directus to ChatGPT using the native Directus MCP Server. This episode demonstrates how to set up the MCP integration with ChatGPT, enabling AI-powered content management and data operations directly from your ChatGPT conversations.
Speaker 0: Hi there. Bryant here for Directus. In this video, we are gonna connect the Directus MCP to ChatGPT. Amazing. All the acronyms we have these days.
Alright. So the first thing that we're going to do is basically go into the AI settings inside Directus and make sure that MCP is enabled. So we'll just click the MCP server and, you know, this template, which you can load in Directus cloud or self hosted, has everything you need to get started with CMS. It also has this reusable template prompts collection already enabled. So we're gonna make sure that is connected.
The next step in the process is basically, we're we're just gonna go in and create a new user. So we'll call this chat GPT. Now you could use your existing user. We don't recommend it, simply for security reasons. And in this case, I wanna work with the full set of tools.
You know, maybe we're gonna adjust the schema in this CMS instance, so I'm just going to add them as an administrator. So the next thing we're gonna do, we will create a access token. I'm just gonna copy that because we're gonna need it, and I'm gonna hit save. So now with that done, we're gonna go over to chat g p t, and we're gonna go into our settings down here. Inside the settings, we're gonna go to the apps and connectors.
We're gonna click on advanced settings. And to use the Directus MCP inside chat GPT, again, with all the acronyms, you have to set up and enable developer mode, which is currently in beta. Alright. So with that, we're gonna go back up to the top. We're gonna hit create a custom connector and we're just gonna call this Directus CMS.
It's magic. And then we're gonna take our MCP URL. So this is gonna be the URL of your Directus instance. My simple cmsstarter.directus.app. And then we're gonna add slash m c p to the end, and where it says o auth, we're gonna hit no authentication.
Now the last piece here, we're gonna add a question mark access underscore token, and then we're gonna paste that token that we generated. So this is our static access token. Cool. Now custom MCP servers may introduce risk. Obviously, you you should be aware of that going into this.
But once you do that, you hit, create. There we go. And now we can see we've got our Directus CMS. We can see all the different tools that are available to us, then we can go out, And now it shows we are in developer mode. Right?
So now I can start working with chatGPT. What does my Directus schema look like? And this should go out, connect to our direct assistance, and pull back the, available schema. So it's gonna show, hey, we're gonna call the tool here, look for the direct to schema tool, which should return a list of raw collections that we could see here. This is just all the collections in our system, and then it's going to summarize that for us.
Right? Pretty easy. We got different blocks. We got a website. Here's our primary collection.
Cool. Can you create a new blog post for us about how fun it is to keep pet rabbits. Alright. So we're just gonna hit stop here. There we go.
And now it is going to call some more tools. And we can see it's trying to create a new post inside the post collection. And there's our data, the joy of keeping pet rabbits. Right? So I can remember for this individual conversation to allow ChatGPT to call these tools over again, or I can simply just allow it for that one post.
Alright. So now we can click here, open this link, and oh. I didn't get the URL correct, but there we go. We can see we have the joy of keeping pet rabbits. Here's a super short blog post.
Now there are tons of things you could do with the Directus MCP. This is just scratching the surface, but that is how you connect it to chat GPT. Stay tuned for the next video.