Transform your Directus CMS with intelligent automation, smart data interpretation, and natural language processing

:robot: AI Agent for Directus

Transform your Directus CMS with intelligent automation, smart data interpretation, and natural language processing.

:sparkles: Features

  • :speech_balloon: Natural Language Commands
    Interact with your Directus CMS using plain English prompts.

  • :bar_chart: Data Insights & Querying
    Use AI to read, analyze, and summarize collections, relations, and metadata.

  • :brain: Semantic Understanding
    AI understands schema, relationships, and context β€” allowing you to insert, update, and link data intelligently.

  • :gear: Smart Automation
    Automate workflows based on AI decision trees.

  • :counterclockwise_arrows_button: Prompt-to-Action
    Instantly convert prompts into structured actions and queries within Directus.


TESTED WITH OPENAI GPT-4o MODEL

AI can make mistakes use it with your own risk.


:puzzle_piece: Extension Type

This is a Bundle Extension that includes:

  • Module β†’ Frontend UI (Chat interface, Settings, and Help)
  • Endpoint β†’ Backend AI agent server (OpenAI / OpenRouter-based)

:package: Installation

1. Install via npm

npm install directus-extension-ai-agent

Or clone manually:

https://github.com/Uncw3b-Software/directus-extension-ai-agent

:gear: Configuration

No need for .env editing.
The extension creates a settings collection after install.

  • Enter your OpenAI / OpenRouter API key
  • Choose provider (openai, openrouter, etc.)
  • Adjust model, temperature, and stream settings

Settings panel is embedded in the UI.


:test_tube: How to Use

Open the AI Agent module in Directus. Use prompts like:

  • Show me the total sales from last month
  • Add a new user named John with role editor
  • Summarize all feedback from last 7 days
  • Create 3 product entries with dummy values
  • What is the average age of users in Germany?

AI will process the prompt and return or execute it with context awareness.


:locked: Security & Sandbox

  • :shield: 100% compatible with Directus Cloud sandbox
  • :white_check_mark: No direct file system access
  • :white_check_mark: All remote calls routed via sandbox-safe fetch
  • :white_check_mark: Uses openai and openrouter public endpoints only

:camera_with_flash: Screenshots





:man_technologist: About the Developer

This extension is built by Uncw3b Software, a boutique AI & Web3 development agency.

Looking for custom AI integrations or Directus development? Reach out to us.


:page_facing_up: License

MIT License Β© Uncw3b Software

3 Likes

4 Answers

4

Awesome, I was already wondering if someone working on an integrated AI chat.

Is this capable producing visual representations like charts for example?

Hi Nik, I'm glad you liked the extension! The extension is built using Directus' official MCP server, and the limitations are outlined on this page: https://community.directus.io/t/transform-your-directus-cms-with-intelligent-automation-smart-data-interpretation-and-natural-language-processing/639 While it supports many operations such as creating, deleting, and reading items, unfortunately, chart generation is not currently available. Still, don’t hesitate to explore it, there are plenty of powerful features to try out!

–

Could you give me a brief idea what would be needed to return visuals or run code, which produces these visuals, interactively? (The link you provided points to this page)

–

I think I paste wrong link, correct link is here https://directus.io/docs/guides/ai/mcp/tools you will see the list of the methods that you can use with the official Directus MCP server. This extension using directus MCP server so the methods on the link available. About your case I can answer if you tell me what you want to achieve. You can reach me out on telegram or discord

–

Hey, I could not find it on the GitHub

Hello Ahmad, I updated the link, you can find it now :)

–

Thank you very much, I can access it now

–

Hello,

I installed the extension using a Dockerfile like this:

FROM directus/directus:11.8.0

USER root
RUN corepack enable

USER node
RUN pnpm install directus-extension-ai-agent

But it’s not working as expected. Here’s what I see in the terminal:

directus-1  | 2025-06-24T16:39:43: PM2 log: App [directus:0] online
directus-1  | πŸ”§ Creating settings table...
directus-1  | ❌ Table creation error: Invalid payload. Collection "ai_agent_settings" already exists.
directus-1  | [16:39:55.559] INFO: Extensions loaded
directus-1  | [16:39:55.571] INFO: Loaded extensions: directus-extension-ai-agent, directus-extension-custom-search-okam

Looks like db table creation interrupted and now it is not installing again. Please try to add these schemas manuelly, all of them text inputs; directus_url admin_token ai_model ai_api_key ai_base_url

–

what about the chat interface? I can not see that

–

Activate it on the settings, then you will see the icon on the left menu

–

Just did it, thanks...

–

You are very welcome, any feedbacks appriciated :)

–

Hello, it is not working, see the log

User Prompt: hello
βœ… Settings loaded
πŸ”„ Starting MCP connection...
πŸ”§ MCP connecting with URL: https://5dd1-103-211-43-213.ngrok-free.app, Token: SET (xxxxxxx-U...)
πŸš€ Initializing MCP...
MCP Request: {
  jsonrpc: '2.0',
  id: 1,
  method: 'initialize',
  params: {
    protocolVersion: '2024-11-05',
    capabilities: {},
    clientInfo: { name: 'directus-extension-ai-agent', version: '1.0.0' }
  }
}
[17:59:23] GET /users/me?fields=id 304 23ms
[17:59:28] GET /fields 200 37ms
[17:59:29] GET /relations 200 12ms
MCP stderr: No prompts collection configured, skipping prompt fetching
MCP Response: {
  result: {
    protocolVersion: '2024-11-05',
    capabilities: { tools: {}, resources: {}, prompts: {} },
    serverInfo: { name: 'Directus MCP Server', version: '0.0.1' }
  },
  jsonrpc: '2.0',
  id: 1
}
βœ… MCP initialized successfully
βœ… MCP connection ready
--- AI Iteration 1 ---
πŸ”₯ Error: Error: OpenAI API error: 404
    at b.chat (file:///directus/extensions/directus-extension-ai-agent/dist/api.js?t=1750787763269:1:6015)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async file:///directus/extensions/directus-extension-ai-agent/dist/api.js?t=1750787763269:1:14578
[17:59:30] POST /mcp-server/prompt 500 13.2s

My config

Most of free api not working on the openrouter, also you need to use the models that supports tooling

–