Set up the native Directus MCP Server with Claude Code for powerful command-line AI workflows. Learn how to configure the MCP integration to enable direct content management and schema operations from your terminal with Claude's autonomous coding capabilities.
Speaker 0: Welcome, friends. Brian here from Directus. In this video, we're gonna show you how to connect the Directus native MCP to Claude code. So we're gonna start our journey inside our Directus instance, and we're gonna go to the AI settings to make sure that we have enabled the MCP server. We're gonna go ahead and add our AI prompts collection because we've already loaded that from a template.
If you don't have an AI prompts collection, it will prompt you to create one. So we're gonna save those settings, and the next thing we're gonna do is go to our users. It's highly recommended we create a new user for this. In this case, I'm probably gonna wanna work with the schema locally in my development environment, so I'm gonna make sure that we give it, admin role access as well in my direct assistance. When you go to production, highly recommend stripping that out, and using a more scoped access policy, with these AI actors.
Alright. So with that out of the way, we've got everything we need. Then we're just gonna pop over to the Directus documentation, and I'm just gonna copy this one liner and we're gonna go in and change our Directus URL. So this is gonna be HTTP, HTTP local host eight zero five five, and then I'm gonna go in and we're gonna copy paste that token that we generated. So I'm just gonna paste that right there.
We'll hit, cool. Added MCP server and now we can start up cloud code just by running the cloud command. Cool. And now we're ready. Right?
If I look for MCP, we could see we've got our different prompts here that are coming from the prompts collection inside our Directus instance. So I can look there. We could see those three prompts. Or I can just ask it, you know, can you tell me a little about my Directus schema? Alright.
This should pick up on the tools that are available through the MCP server and ask to run them for us. You know, we can choose to always allow. You know, here we go. We could see, some of that. Cool.
And now we could see it actually calling the schema tool so we can start getting some of the information about the Directus instance. Alright. So here it goes. It comes back with a summary of that. One of the other nice ways I can use this, you know, maybe we've got a page and we wanna add a new field to it.
Add a new field to our pages collection for an AI generated summary. Cool. So one of the nice things about the MCP inside Directus is it does have schema tools, so we can create new fields, relationships, and even new collections inside our direct instance, not just read those things. Alright. So here's the information it's gonna send.
Cool. We'll allow it to do so, and then once it's done, I should just be able to hit refresh over here on the left, and we'll see that new AI summary field. There are lots more capabilities baked into the Directus MCP, but that is it for this video on how to connect to Cloud Code. Stay tuned for more videos in this series.