# Directus MCP for AI Agents MCP

> Directus connects your open-source data platform and headless CMS to any AI agent. It lets you manage complex structured data—creating records, auditing schemas, and reading collections—all through natural conversation. You get full programmatic control over your PostgreSQL database without writing SQL queries.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** headless-cms, database-management, sql-interface, api-generation, asset-management, rbac

## Description

Working with a large database often means jumping between dashboards, running complicated SQL, or asking a developer for a simple change. This MCP lets you skip that headache entirely.

Instead of digging into the Directus UI or drafting complex queries, you talk to your AI client and it handles the data layer. You can ask your agent to list all items from a specific collection, audit the structure of a table, or update a user profile by name—all in plain language. It’s like giving your AI agent direct, safe access to the backend truth.

Because this MCP exposes every core function of Directus, you can manage everything from creating new content records to deleting old ones and verifying file uploads. When you plug it into Vinkius, you get a single connection point that lets any compatible client read, write, and audit your entire data platform without the usual friction points.

It's pure backend control delivered through chat.

## Tools

### create_cms_record
Creates a new record in any Directus collection using structured JSON input.

### wipe_cms_record
Permanently deletes and removes an existing database row from the specified collection.

### get_collection_details
Extracts structural details, showing all properties associated with a specific data collection.

### list_collection_fields
Inspects the deep internal arrays that define which fields accept formatting and validate against your database links.

### get_single_item
Retrieves all explicit data for one specific row using its unique UUID identifier.

### list_schema_collections
Lists every structured rule defining the PostgreSQL tables that power your CMS.

### list_directus_files
Verifies and retrieves structural data about all files uploaded to the media storage.

### list_collection_items
Identifies the available collections, showing which tables exist inside your CMS mappers.

### list_directus_users
Lists all active user accounts and administrative identities within the database layer.

### patch_cms_record
Updates an existing record in a collection by submitting new values via its unique ID.

## Prompt Examples

**Prompt:** 
```
What are the current articles published in the blog and what fields do they use?
```

**Response:** 
```
**Articles Collection Schema**

*   ID: (UUID)
*   Title: Text field, required.
*   Author: Reference to User UUID.
*   Publication Date: Timestamp.
*   Body Content: Rich text editor. 

I found 14 records in this collection. The most recent is 'The Future of AI' (ID: a5b8c...).
```

**Prompt:** 
```
I need to update the product 'X-700'. The new price is $199 and it's out of stock. Can you do that?
```

**Response:** 
```
The record for 'X-700' was successfully updated.

*   **Product ID:** 8c4d... 
*   **Status:** Out of Stock (Updated)
*   **Price:** $199.00 (Updated)
*   **Last Modified:** [Current Timestamp]

The database is now consistent with the new inventory data.
```

**Prompt:** 
```
Show me the structure of the user profile collection.
```

**Response:** 
```
**User Profile Collection Schema**

*   `user_uuid`: UUID (Primary Key)
*   `first_name`: String (Required)
*   `last_name`: String
*   `department`: Dropdown selection.
*   `avatar`: Media file reference. 

This collection is used to track user details across the entire application.
```

## Capabilities

### Create new CMS records
Write a new record to a collection by providing a JSON payload.

### Delete CMS records permanently
Irreversibly delete an existing record from the database.

### Check collection structure details
Inspect the properties and tables that make up a specific data collection.

### List all field configurations
See every detailed column configuration for any given table.

### Get a single item record
Retrieve the full details of one specific database row using its ID.

### List all available collections
See an enumeration of every structured table defined in your PostgreSQL instance.

### Get media file metadata
Verify and retrieve information about uploaded files stored by Directus.

## Use Cases

### Content audit for a new feature
A product team needs to know what collections exist before building a new page. They ask their agent, and it runs 'list_collection_items', providing a complete list of all available tables so they can map out the data structure.

### Updating bulk pricing data
The e-commerce team needs to change the price for 50 products. Instead of manually editing them, they ask their agent to use 'patch_cms_record' with a list of IDs and new prices.

### Investigating data inconsistencies
A developer finds mismatched user entries. They run 'get_single_item' on the suspicious UUIDs, allowing them to compare records side-by-side in the chat interface for quick validation.

### Onboarding a new admin
The operations manager needs to check which users have access. They ask their agent to run 'list_directus_users', getting an immediate, comprehensive list of authorized administrative identities.

## Benefits

- You eliminate writing complex SQL. Instead of crafting `SELECT * FROM...` queries, you simply ask your agent to find the data you need.
- Full control over content lifecycle: Use tools like 'create_cms_record' and 'patch_cms_record' to update or modify records instantly without UI clicks.
- Audit everything. Need to know what fields exist? Running 'list_collection_fields' gives you the schema details fast, helping development teams plan updates.
- Manage digital assets programmatically. Use tools like 'list_directus_files' to check file uploads and generate download paths for your front-end builds.
- Simplify user management. Easily see who has access by running 'list_directus_users', keeping track of system identities without logging into the admin panel.
- Faster iteration cycles. Quickly validate database integrity or retrieve single items using 'get_single_item' so you can confirm data points immediately.

## How It Works

The bottom line is, you're giving your AI agent a structured, conversational API layer for your existing database.

1. Subscribe to this MCP, then provide your specific Directus Base URL and Static Token.
2. Connect the credentials within your preferred AI client (Claude, Cursor, etc.).
3. Start asking questions or making requests about your data platform using natural language conversation.

## Frequently Asked Questions

**How can I use the Directus MCP to read my CMS data?**
You can ask your agent to retrieve specific records or list all contents of a collection. It's as simple as asking, 'Show me the articles from last month,' and getting structured JSON results back immediately.

**Does this Directus MCP help me manage my database structure?**
Yes, it lets you audit your entire data platform. You can list all available collections or run field discovery checks to understand exactly what fields are available in a table without logging into the backend.

**Can I use Directus MCP to update records in bulk?**
Absolutely. You can instruct your agent to modify multiple existing rows at once, such as changing inventory counts or updating status fields across dozens of products using a single command.

**Is this enough for developers who write code with Directus?**
Yes. This MCP acts like an API wrapper in plain language. It allows you to test data writes, read schemas, and manage content directly from your chat or IDE, making the development loop much faster.

**What if I need to delete a record using Directus MCP?**
The tool handles permanent deletion for you. You just tell it which record ID needs to be vaporized, and it executes the irreversible drop safely within your agent's context.