MCP Server

Tools

Learn about the tools available in the Directus Content MCP Server and how to configure them.

The Directus Content MCP Server provides a set of tools that allow AI assistants to interact with your Directus instance. These tools enable various operations like reading collections, managing content, working with files, and more.

This guide covers the available tools and how to configure them.

Available Tools

The MCP Server provides the following tools to interact with your Directus instance:

ToolDescriptionUse Cases
system-promptProvides context about your role as an assistantStart of a session to understand the system context
users-meGet current user informationUnderstanding permissions, personalizing responses
read-collectionsRetrieve the schema of all collectionsExploring database structure, understanding relationships
read-itemsFetch items from any collectionRetrieving content, searching for data, displaying information
create-itemCreate new items in collectionsAdding new content, records, or entries
update-itemModify existing itemsEditing content, updating statuses, correcting information
delete-itemRemove items from collectionsCleaning up outdated content
read-filesAccess file metadata or raw contentFinding images, documents, or media assets
import-fileImport files from URLsAdding external media to your Directus instance
update-filesUpdate file metadataOrganizing media, adding descriptions, tagging
read-fieldsGet field definitions for collectionsUnderstanding data structure, field types and validation
read-fieldGet specific field informationDetailed field configuration
create-fieldAdd new fields to collectionsExtending data models
update-fieldModify existing fieldsChanging field configuration, interface options
read-flowsList available automation flowsFinding automation opportunities
trigger-flowExecute automation flowsBulk operations, publishing, status changes
read-commentsView comments on itemsRetrieving feedback, viewing discussion threads
upsert-commentAdd or update commentsProviding feedback, documenting decisions
markdown-toolConvert between markdown and HTMLContent formatting for WYSIWYG fields
get-promptsList available promptsDiscovering pre-configured prompt templates
get-promptExecute a stored promptUsing prompt templates for consistent AI interactions

Disabling Tools

You can disable specific tools to restrict the capabilities of the MCP server. This is useful for limiting destructive actions or focusing the AI assistant on specific tasks.

To disable tools, add the DISABLE_TOOLS environment variable to your MCP server configuration:

{
    "mcpServers": {
        "directus": {
            "command": "npx",
            "args": ["@directus/content-mcp@latest"],
            "env": {
                "DIRECTUS_URL": "https://your-directus-instance.com",
                "DIRECTUS_TOKEN": "your_directus_token",
                "DISABLE_TOOLS": ["delete-item", "update-field", "create-field"]
            }
        }
    }
}

In this example, the delete-item, update-field, and create-field tools are disabled, preventing the AI assistant from deleting content or modifying the data structure.

System Prompt Tool

The system-prompt tool is special - it provides context to the AI assistant about its role and capabilities when working with your Directus instance. This tool is typically called at the beginning of a conversation session.

You can customize the system prompt by setting the MCP_SYSTEM_PROMPT environment variable:

{
    "env": {
        "MCP_SYSTEM_PROMPT": "You are an assistant specialized in managing content for our marketing website."
    }
}

You can also disable the system prompt entirely by setting MCP_SYSTEM_PROMPT_ENABLED to false.

Best Practices

When working with the Directus Content MCP tools:

  1. Always call the system-prompt tool at the beginning of a session to establish context.
  2. Use the read-collections tool to understand the data structure before performing operations.
  3. Keep destructive tools disabled in production environments to prevent accidental data loss.