# Directus MCP MCP

> Directus MCP connects your AI client straight to your SQL database, turning complex content models into natural conversation. Instead of writing API calls or navigating a dashboard, you talk to it and get data back instantly. Check collection schemas, create new articles, manage user roles, and run audit reports—all through your agent. It's direct, conversational control over structured data.

## Overview
- **Category:** loved-by-devs
- **Price:** Free
- **Tags:** sql-database, graphql, rest-api, content-management, data-modeling, backend-as-a-service

## Description

Manage the core content structure of your application without touching a dashboard or writing boilerplate code. This MCP lets you treat your database like a conversation partner. You ask your AI client for something specific—say, 'Show me all articles published last month that mention AI'—and it handles the necessary reads and filters. It’s pure data interaction via natural language. When you connect this through Vinkius, your agent gets access to thousands of other tools, making it a central hub for managing content from any MCP-compatible client. You can inspect what fields exist in a collection using `list_fields` or even build out new records by calling `create_item`. Whether you're a developer debugging data issues or a content manager pushing out an update, this connection gives you immediate control over your entire content ecosystem.

## Tools

### check_directus_status
Verifies that the connection to your Directus database is working correctly.

### create_item
Creates a new record or item in any specified content collection.

### delete_item
Permanently deletes an existing record from a collection.

### get_collection
Retrieves detailed information about a specific data collection model.

### get_file
Gets the metadata and details for an uploaded media asset.

### get_item
Retrieves all available field data for a single record by its ID.

### get_me
Returns the profile details and information for the currently authenticated user.

### list_activity
Lists recent operations across the database, acting as an activity log.

### list_collections
Returns a list of all available data collections in your system.

### list_fields
Lists every field and its data type for a specific, chosen collection.

### list_files
Retrieves a list of all uploaded media files in the system.

### list_items
Fetches a paginated list of items from a designated content collection.

### list_roles
Lists all user roles defined in the system (e.g., Admin, Editor).

### list_users
Retrieves a list of every user account and their current status.

### search_items
Searches for content items across collections using specific keywords or criteria.

### update_item
Modifies the data fields of an existing record by its ID.

## Prompt Examples

**Prompt:** 
```
Show me all collections in my Directus instance and the fields for the 'articles' collection.
```

**Response:** 
```
Your Directus instance has 8 collections: 'articles' (24 fields), 'categories' (6 fields), 'authors' (12 fields), 'media' (8 fields), 'pages' (15 fields), 'settings' (10 fields), 'comments' (9 fields), and 'tags' (4 fields). Fields for 'articles': id (uuid), title (string), slug (string), body (text), status (string: draft/published/archived), featured_image (file), author (m2o → authors), category (m2o → categories), tags (m2m → tags), date_published (datetime), sort (integer). Would you like to list items or create a new article?
```

**Prompt:** 
```
Create a new article titled 'AI in Healthcare 2025' with status 'draft' and search for existing articles about AI.
```

**Response:** 
```
Article created! ID: a3f8c291, Title: 'AI in Healthcare 2025', Status: draft, Slug: ai-in-healthcare-2025. Searching existing articles for 'AI'... Found 3 matches: 1) 'AI-Driven Drug Discovery' (published, 2024-11-15). 2) 'Machine Learning in Diagnostics' (published, 2024-09-22). 3) 'AI Ethics Framework' (draft, 2025-01-08). Would you like to update the new article's body or assign it to an author?
```

**Prompt:** 
```
Show me the recent activity log and list all users with their roles.
```

**Response:** 
```
Recent activity (last 24h): 14 operations. Top actions: 8 item updates (articles, pages), 3 item creates (articles, media), 2 logins, 1 role change. Most active user: 'editor@example.com' (9 operations). Users: 1) Admin User (admin role, active). 2) Sarah Editor (editor role, active). 3) Mike Writer (writer role, active). 4) API Bot (api-readonly role, active). 3 roles configured: admin (full access), editor (content CRUD), writer (create/read only). Would you like to inspect a specific user or see more activity?
```

## Capabilities

### Read Content Data
Fetch specific records, list all items in a collection, or search across content by keyword.

### Manage Collection Structure
View which data collections exist and inspect the specific fields (the schema) for any chosen model.

### Modify Content Records
Create new content entries or update existing ones by providing structured JSON payloads.

### Handle Files and Media
Browse uploaded media assets, get file lists, and retrieve the metadata for any specific file.

### Control User Access
List all registered users, view their assigned roles, or check your own profile status.

### Review System Activity
Access the audit trail to see a log of recent database operations for compliance checks.

## Use Cases

### Content writer blocked on a new article draft.
The writer asks the agent, 'Find all articles about finance that are currently published.' The agent runs `search_items` and provides a list of three links. They then use `get_item` to pull the raw text body from one of those drafts for reference.

### Developer needs to add a new content type.
The developer runs 'What collections do I have?' (using `list_collections`). Seeing the missing 'Podcast' collection, they then use `get_collection` on an existing model like 'articles' to understand how field types are structured before creating the new one.

### Admin needs to onboard a new team member.
The admin asks the agent to check user roles. The agent calls `list_users` and identifies that the new hire only has 'Reader' status, so the admin uses conversational instructions to update their role.

### System audit after a data breach scare.
The auditor asks for all database changes in the last 24 hours. The agent calls `list_activity` and summarizes every operation, providing an immediate compliance log without leaving the chat interface.

## Benefits

- Instead of writing raw API calls, you can use your agent to run `list_collections` and instantly see every data model available in the system. It's faster than navigating the dashboard.
- Need to publish an article? You don't have to open Directus; simply instruct your agent to `create_item`, supplying all necessary fields, like title and body content, through conversation.
- Debugging a complex data issue is easier when you can call `list_fields` to inspect the exact schema of any collection. This prevents guessing what data types are available.
- When reviewing compliance, instead of running manual reports, ask your agent to use `list_activity` to summarize all changes made in the last few hours.
- You gain full control over user accounts; you can list who needs access via `list_users` and then manage their roles using other tools within Vinkius.

## How It Works

The bottom line is, you use your AI client's chat interface to manage complex backend operations without needing to open a single administrative dashboard.

1. Subscribe to this MCP and enter your Directus Static Token into the Vinkius catalog.
2. Connect your AI client (Claude, Cursor, etc.) to the MCP. The agent now knows how to talk to your database.
3. Ask a natural language question: 'What are the fields in my articles collection?' or 'Create an item with title X.' You get instant data results.

## Frequently Asked Questions

**How do I use `create_item` with the Directus MCP?**
You provide the required fields and values in natural language, letting the agent structure the JSON payload for you. You don't need to know the exact API body; just tell it what data needs creating.

**What is the difference between `list_items` and `search_items`?**
`list_items` gives you a paginated list of content from an entire collection. Use `search_items` when you know specific keywords or criteria, allowing for much finer filtering.

**Can I check the connection using `check_directus_status`?**
Yes, calling `check_directus_status` simply confirms that your AI client has a live and working connection to your Directus instance. It's a quick health check.

**How does `list_users` help me manage content?**
`list_users` helps by showing who can access the data, which is critical when you need to know if an account has permission to create or modify a specific type of record.

**How do I use `list_fields` to map out a collection's full data model?**
It immediately lists every field and its data type within a specified collection. This lets you inspect the entire schema, which is essential before writing any update or creation payload.

**If I run `delete_item`, what steps should I take to avoid accidentally deleting critical content?**
The tool requires specific IDs and collection names for targeted deletion. Always verify the item details first using `get_item` so you know exactly what data you're about to remove.

**What is the best way to browse and retrieve metadata for uploaded assets using `list_files`?**
It provides a comprehensive list of all stored files. You get details like file names, sizes, and metadata without needing to interact with the visual dashboard.

**Does `list_activity` help me track compliance or debug recent database issues?**
Yes, it generates an activity log of operations that occurred recently. You can see who did what, when they logged in, and which collections were modified.