# Directus MCP for AI Agents AI Agent Connect

> Directus MCP lets you manage your SQL database and headless CMS through your AI agent. It handles everything from provisioning JSON payloads to writing rows, auditing your PostgreSQL schemas, and managing user permissions. It also lets you track media storage and inspect field configurations without leaving your chat or IDE.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Endpoint:** https://edge.vinkius.com/vk_preview_Bfvn0YkOAhH7MFw8q7LeRL9p3SPkzaigqleLEiMg/ai-agent-connect
- **Tags:** sql-database, graphql, rest-api, content-management, data-modeling, backend-as-a-service

## Description

Directus lets you connect your instance to your AI agent to take full control of your data platform and headless CMS through natural conversation. This Connector lets you skip the manual work of clicking through dashboards to update records or check permissions. You can ask your agent to pull a list of users, update specific entries in a collection, or even audit your entire schema to see what's actually happening under the hood. It bridges the gap between your data platform and your workflow, so you don't have to hunt through nested menus or write custom scripts just to manage your content. Because it's hosted on Vinkius, you can get this connected to your favorite tools in minutes. Instead of manually entering data or worrying about complex SQL queries, you just describe what needs to happen in plain English. If you need to wipe old records, check file upload routes, or verify RBAC boundaries, your agent handles the specifics while you stay focused on building.

## Tools

### create_item
Create an item

### delete_item
Delete an item

### get_collection
Get collection details

### get_file
Get file details

### get_item
Get item details

### list_activity
List recent activity

### list_collections
List collections

### list_fields
List fields

### list_files
List files

### list_items
List items

### list_users
List users

### search_items
Search items

### update_item
Update an item

### check_directus_status
Verify connectivity

### get_me
Get current user

### list_roles
List roles

## Prompt Examples

**Prompt:** 
```
List all users in the admin group.
```

**Response:** 
```
I've checked the admin identities for you. Here are the active users:

| Name | ID | Role |
| :--- | :--- | :--- |
| **Admin_User_1** | `uuid_9921` | Super Admin |
| **Editor_Jane** | `uuid_4432` | Content Manager |

Would you like me to pull the full profile for any of these?
```

**Prompt:** 
```
Update the price for the 'Gaming Mouse' in the products collection to 45.
```

**Response:** 
```
I've updated that for you. The price for the **Gaming Mouse** in the products collection has been changed to **45**. 

**Status:** Success
**Record ID:** `prod_882` 
**Updated Value:** 45
```

**Prompt:** 
```
What fields are in the 'orders' table?
```

**Response:** 
```
The `orders` collection contains the following fields:

*   **customer_id** (UUID)
*   **order_date** (Timestamp)
*   **total_amount** (Decimal)
*   **status** (String)
*   **shipping_address** (Text)

Let me know if you need the specific formatting rules for any of these.
```

## Capabilities

### Write and update database records
Provision new rows or modify existing data using JSON payloads.

### Audit database schemas
Enumerate the rules and structures defining your PostgreSQL tables.

### Manage user identities
Identify and manage active admin identities within your database layer.

### Track media storage
Retrieve structural matches for file uploads and download routes.

### Inspect field configurations
Analyze internal arrays to see which fields accept specific formatting.

### Wipe records
Irreversibly delete specific rows to clear out internal database allocations.

## Use Cases

### Bulk updating product prices
A developer needs to update 50 product prices. They ask the agent to use patch_cms_record to loop through IDs and update values.

### Finding specific media assets
A content editor needs to find a specific image. They ask the agent to use list_directus_files to find the correct download route.

### Verifying admin permissions
A DBA needs to check permissions. They ask the agent to use list_directus_users to verify who is in the admin group.

### Auditing schema for new features
A product manager needs to see what fields are available. They use list_collection_fields to see the exact schema for a new feature.

## Benefits

- Stop manual data entry by using create_cms_record to push JSON payloads directly via chat.
- Audit your entire PostgreSQL structure quickly using list_schema_collections to ensure data integrity.
- Manage user permissions and identities without SQL by using list_directus_users to see who has access.
- Handle media assets effortlessly with list_directus_files to verify upload routes and storage.
- Quickly update existing data using patch_cms_record to modify specific database values by ID.
- Clear out old data instantly with wipe_cms_record to manage your database allocations.

## How It Works

The bottom line is you get a direct conversational interface for your entire Directus data platform.

1. Subscribe to the Directus MCP on Vinkius.
2. Enter your Directus Base URL and Static Token.
3. Start managing your data and CMS content via your AI client.

## Frequently Asked Questions

**Can I use Directus MCP to update my database?**
Yes. You can use it to write new records, update existing values, or even wipe records to clear space. It handles the communication with your database so you can just use natural language.

**Does Directus MCP support PostgreSQL?**
Yes, it works with your PostgreSQL tables. It allows your AI agent to audit your schema, list collections, and manage the data stored within those tables.

**How do I manage my media files with Directus MCP?**
You can use it to retrieve structural matches for your media storage. This helps you find file paths and download routes quickly without browsing the CMS.

**Can I use it to check user permissions?**
Yes, you can use it to identify active admin identities and oversee the users authorized within your database layer, helping you manage access more easily.

**Is there a way to delete records easily?**
Yes, you can ask your agent to wipe specific records. This will irreversibly remove them from your database to help manage your data allocations.

**Can my agent list all collections and their fields in Directus?**
Yes. Use the 'list_schema_collections' tool to see all tables, and then use 'list_collection_fields' for a specific collection. The agent retrieves the absolute structural details defining precisely which fields accept formatting.

**How do I create a new record in a specific Directus collection?**
Use the 'create_cms_record' tool. Provide the collection name and a JSON payload mapping the columns. Your agent will orchestrate the request to drop the formatted endpoint into your database and return the new UUID.

**Can I audit authorized users and their roles via the agent?**
Absolutely. The 'list_directus_users' tool retrieves the explicitly mapped profile arrays iterating the exact users authorized within the database layer. This helps you monitor RBAC boundaries and organizational identities.

**Can I create, update, and delete content items in any collection?**
Yes! Use `create_item` with a collection name and JSON payload to add new items. Use `update_item` with the collection, item ID, and updated fields to modify existing items. Use `delete_item` to remove items. All operations respect the permissions assigned to your Static Token's user role.

**How does Directus authentication work with a Static Token?**
Directus uses a non-expiring Static Token associated with a specific user account. Generate it from your **User Profile** in the Data Studio. The token is sent as a `Bearer` token in the Authorization header. Its permissions match the role assigned to that user — use an admin role for full access or a restricted role for read-only operations.

**Can I audit what changes have been made to my database?**
Yes. The `list_activity` tool retrieves the audit log of recent database operations, showing who made changes, which collections were affected, timestamps, and the type of operation (create, update, delete). Combine with `list_users` and `list_roles` for full accountability tracking.