Integrate the native Directus MCP Server with Cursor IDE for enhanced AI-powered development workflows. This episode shows you how to configure the MCP connection in Cursor, enabling seamless content management and database operations while you code.
Speaker 0: What's up, friends? Brian here for Directus. And in this video, we're gonna show you how to connect the Directus native MCP to your cursor IDE. Love all the acronyms. Alright.
The first thing we're gonna do is go into the AI settings inside your Directus Instance. Now I've got this Instance running locally. You know, you could connect either way to a local Instance or to a cloud based instance. So we're also going to enable our AI prompts collection, which it comes out of the gate with the CMS template. And cool.
We'll make sure we save that. We can allow deletes. So next up on the list, we're gonna go in and I can create a new user here or I could just grab the token for our admin user. Great. We're gonna do that.
I'll hit save. Amazing. Okay. Next, what we're going to do is just gonna pop over to the documentation, and we're gonna look for the AI guides. We got a quick setup on the MCP.
We'll scroll down. And I do this because we have this one click install to cursor, or I could just copy paste this. We'll just open up cursor, and we can see here's the Directus MCP. I'm just gonna change this to my URL, which in this case is just local host eight zero five five, and I'm gonna paste in that token that we created. Now once I hit install, we can see now we've got six tools.
I can go in and enable all the other tools. I've also got three prompts. That's coming from the AI prompts collection inside this Directus instance. Now we're ready to go. Right?
Locally here, I've got a Next. Js website running. This is, again, just a template that you could get access to through the cloud or self hosted. But now we're ready to fire up a conversation. Right?
So I'm gonna open up the cursor agent. We'll just make this larger. You know, let's use one of the the newer models, ClaudeSonic. And let's start this conversation with the agent. What can you tell me about my Directus schema?
So if you're vibe coding anything up, this is a super helpful tool, the schema tool that's within the native MCP. It is going to run our system prompt. You could see it run the schema. We can get all the information about the collections. It's gonna grab some extra information about that, and we could see here that it is summarizing what's going on.
Right? Maybe we want to add a new collection or or change a field within an existing collection. Right? Let's take a look at our blog post. Maybe we want an AI summary.
Can you add an AI summary field to our blog post? Cool. So now we're working with the MCP. Do we want to allow it to run this field tool? Yeah.
We'll enable that. And now we could see that it has added an AI summary field for us, which we could see right there. There's lots more that you can do with the Directus MCP inside cursor, but that's it for this video. Right? Stay tuned for more in this MCP series.