Set up the Directus MCP Server with Cursor IDE for AI-powered development workflows. This episode covers the complete installation process and configuration steps to integrate Directus with Cursor for enhanced coding and content management.
Speaker 0: Hey. What's up, guys? Brian here at Directus. In this video, I'm gonna show you how to install the Directus Content MCP into Cursor. So Cursor supports two different ways to install MCP servers, and we're gonna show you what I actually prefer.
Now before we start, you're gonna obviously make sure that you have Node. Js installed on your computer. If you're already running Cursor, there's a good chance you already have Node installed, but, again, just to run these MCP servers locally, you will wanna make sure that you've got that installed. You could go to nodejs.org slash download, just to pick that up. So, if we take a look, the, configuration locations for Cursor.
I highly recommend the project configuration which, basically we create a Cursor directory and add m c p dot json. Now you could do globally, but if you are working with several different Directus projects, you're probably gonna want that to be, per project. So we'll create a new folder in cursor. We'll just call it dot cursor and we'll create a new file called MCP dot JSON. Now the next thing that we're gonna do is just load up the standard configuration here.
I'm pulling this from the repo. You can grab it from the docs. We'll copy the configuration. We've got MCP servers, then we have Directus inside here. We've got our commands and our arguments.
And then the two pieces that you are going to supply is your Directus URL and your Directus token. You can also use username and password here. All that is detailed in the documentation or the read me. So for this I'm just going to add my directus URL, simplecmsstarter.directus.app. If you're on directus cloud, you will have this format, directus.app.
If you are self hosting, obviously, that's gonna be your own URL. The next piece of the puzzle here, I'm gonna go in to my specific user. I'm gonna scroll down the page to admin token. I'm gonna generate a static token to use here. Hit save.
Make sure you save. That's important. And I'm just going to paste that token here. So now once I'm done, hit save. This should enable the MCP server, and now I can go in over here when I chat with this.
Make sure you're on agent mode, And I don't know the specific models. Let's just try Claude Sonnet three five. What does my Directus schema look like? Alright. So fingers crossed, this should, prompt some tool calls like the system prompt to get information about it, and then it will call read collections to pick up the schema.
Alright. And away we go. So, you know, you could potentially use this to update content, but the content MCP server does not have destructive actions enabled like creating collections or dropping collections or, anything that could harm your data. Alright. That's it for installing one of the other things that you may want to look at inside the cursor settings.
So if we go to cursor settings, we go to features, there is a protection for, chat, like agents running tools. Where is this at? MC tool MCP Tools Protection, you may want to enable this, you know, in case, you don't want it to automatically run these tools. So by default, I think this is checked by default, maybe it's not. Make sure that you look for this if you want to be aware and approve all the individual tool calls.
Again, the Content MCP does not have any destructive actions enabled by default, but could be an extra piece of protection that you look at. So that is it for this video. Stay tuned for more on the MCP.