Directus MCP Server
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| NODE_ENV | No | Environment mode (development/production) | |
| DIRECTUS_URL | Yes | Your Directus instance URL (e.g., http://localhost:8065) | |
| DIRECTUS_TOKEN | Yes | Static API token with appropriate permissions | |
| DIRECTUS_RESOURCES_ENABLED | No | Enable resources feature (true/false) | |
| DIRECTUS_PROMPTS_COLLECTION | No | Collection name for AI prompts | ai_prompts |
| DIRECTUS_RESOURCES_EXCLUDE_SYSTEM | No | Exclude system collections from resources (true/false) | |
| DIRECTUS_PROMPTS_COLLECTION_ENABLED | No | Enable AI prompts collection (true/false) |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {} |
| prompts | {} |
| resources | {} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| list_collectionsA | Lists every collection in the Directus instance with its metadata, so the data model can be discovered before anything is read or written. Start here when the collection name is unknown; use get_collection_schema for the fields of one collection and get_collection_items to read its rows. Folders (grouping elements with no table behind them) and inactive collections (Directus 12.4 refuses to read or write their contents) are flagged in the result. System collections are omitted unless include_system is true. Returns one entry per collection with its name, metadata and those flags. |
| get_collection_schemaA | Returns the field-level schema of one collection: field names, database types, interfaces, required and unique constraints, defaults and relation metadata. Use it before create_item or update_item to learn which fields exist and which are mandatory; use list_collections to find the collection name first, analyze_collection_schema when relationship mapping and constraint checks are also wanted. Read-only. Fails when the collection does not exist or the token cannot read it, and diagnose_collection_access tells those two apart. |
| get_collection_itemsA | Reads items (rows) from one collection with Directus filtering, sorting, field selection, full-text search and pagination. This is the read path for content: use get_users, get_files or get_flows for those system collections, and get_collection_schema when the shape rather than the data is wanted. Returns at most 25 items unless limit says otherwise, so paginate with offset over large collections. Results are scoped to what the token may read, so a filter can legitimately return fewer rows than exist. On versioned collections, version reads one draft and version_raw returns the delta instead of the merged item. Since Directus 12.6.1 search also matches related fields through a many-to-many junction. |
| create_collectionA | Creates a collection, either a real database table or a grouping folder. A table gets an auto-increment integer id when no fields are passed; folder: true makes a grouping element, which has no schema and can hold neither items nor fields. Use create_field to add fields afterwards, apply_schema to provision several collections from a snapshot. The table is created immediately and is not rolled back when a later field in the same call fails. A fresh collection can take a moment to become readable: validate_collection_creation confirms it, refresh_collection_cache clears a stale cache. Returns the created collection. |
| delete_collectionA | Drops a collection and every item in it, permanently. Requires confirm: true; without it nothing is deleted and the call reports what it would have done. Irreversible and not transactional: related items elsewhere may be left orphaned and a RESTRICT foreign key can make the drop fail halfway. Use delete_items to remove rows and keep the collection, delete_field to remove a single field. Take get_schema_snapshot first when the data model may need restoring. |
| create_itemA | Inserts one item (row) into a collection and returns it, including the generated primary key. Use bulk_operations for many rows in one call, import_data for a CSV or JSON file, update_item to change a row that exists. Directus validates the payload, so a missing required field or a failed validation rule comes back as a tool error and nothing is written. Fields the token may not write are rejected rather than silently dropped. The payload may include relational fields, which Directus resolves against the related collection. |
| update_itemA | Updates fields of one item by primary key and leaves fields absent from data untouched: a PATCH, not a replace. Use create_item for a new row, bulk_operations for many rows, delete_items to remove them. In versioned collections the published item is read-only, so pass version with a draft key to write into a draft; without it Directus refuses the write. Overwrites whatever the field held, so read it with get_collection_items first when the previous value matters. Returns the updated item. |
| delete_itemsA | Deletes items from a collection, by explicit ids or by a Directus query, permanently. Requires confirm: true, and passing neither ids nor query deletes nothing. ids and query are mutually exclusive. Since Directus 12.4 a query resolves its targets under the read permissions of the token: read access to the primary key is required and only readable items are deleted, so the deleted count can be lower than the matching count. Use { "limit": -1 } in query to deliberately target every item. cascadeDelete also removes related items and works only with ids. Use delete_collection to drop the whole collection instead. |
| create_fieldA | Adds a field to an existing collection: a database column plus its Directus interface metadata. Use create_relationship for relational fields, since this tool creates a plain column and no foreign key, and update_field for a field that already exists. The column is added immediately; on a non-empty table a required field without default_value can fail or leave existing rows invalid, so add it optional first and backfill. type is the Directus type (string, integer, boolean, dateTime, json, uuid and so on) while interface only affects how the admin app renders it. Returns the created field definition. |
| update_fieldA | Changes an existing field, either its Directus metadata (interface, note, validation, options) or its database schema (type, required, unique, default_value). Metadata changes are safe; a type change rewrites the column and can fail or lose precision on existing data, and turning on required or unique fails on rows that already violate it. Idempotent: the same body applied twice leaves the same result. Use create_field to add a field, delete_field to remove one, and update_field with a hidden interface to retire a field without destroying data. Returns the updated field definition. |
| delete_fieldA | Drops one field and its column from a collection, discarding the data in it permanently. Requires confirm: true. Relations pointing at the field can be left dangling, so check analyze_relationships first; use update_field to hide a field in the admin app instead of destroying it, delete_collection to drop the whole table. Not reversible, so take get_schema_snapshot beforehand when the model may need restoring. |
| bulk_operationsA | Applies many writes to one collection in a single call: creates, updates and deletes together. Prefer it to repeated create_item or update_item calls when the row count is high; use import_data for a CSV or JSON file and delete_items when deleting by query rather than by id. Not a transaction: the phases run in order (create, update, delete) and a failure partway leaves earlier writes committed, so the result reports what succeeded per phase. validate: true checks the payload against the collection schema before anything is written. This tool writes data and has nothing to do with analyze_relationships, which only inspects the data model. |
| analyze_collection_schemaA | Inspects one collection and reports its fields with types and constraints, optionally mapped against its relationships and checked for schema problems. Use it when deciding how to query or extend a collection; get_collection_schema returns the raw field list alone, validate_collection_schema returns only the problems, analyze_relationships gives the cross-collection view. Read-only. includeRelations adds inbound and outbound relations and validateConstraints adds constraint findings; each costs extra requests against Directus, so leave them off for a quick look. |
| analyze_relationshipsA | Maps relationships across the instance: which collections point at which, through which fields, and of which type (o2o, o2m, m2o, m2m, m2a). Pass collection to narrow it to one collection and its neighbours, or omit it for the whole graph. Use it before create_relationship, before deleting a field or collection, or when a nested query returns an unexpected shape; analyze_collection_schema covers one collection in depth. Read-only, and it reads the data model only, never items. System collections are excluded unless includeSystemCollections is true. |
| create_relationshipA | Creates a relationship between collections together with the schema it needs: a m2o or o2o foreign key, an o2m reverse field, a m2m junction collection, or a m2a any-collection link. Use create_field for a plain non-relational column and analyze_relationships to see what already exists. Which parameters are required depends on type: m2m needs junction_collection and both junction fields, m2a needs allowed_collections and collection_field. Creates real tables and constraints and does not roll back when a later step fails, so a half-created m2m may need manual cleanup. on_delete and on_update set the referential actions, where CASCADE means deleting a parent deletes its children. |
| validate_collection_schemaA | Checks one collection for schema problems and returns the findings: missing primary key, one-sided or broken relations, a database type that disagrees with its interface, constraints the stored data violates. Read-only, and it reports rather than repairs. Use it after create_collection or apply_schema, or when writes fail for no obvious reason; use diagnose_collection_access when permissions rather than schema are the suspicion. strict: true also reports conventions and warnings instead of errors alone. |
| diagnose_collection_accessA | Explains why a collection cannot be read or written with the current token: whether it exists, whether it is active, whether the token holds item, field and relation permissions, and which of those is the blocker. Read-only and safe against production. Reach for it first when a tool returns an empty result or a forbidden error, before concluding the data is missing; validate_collection_schema covers a suspect schema and refresh_collection_cache a collection that was just created. Each include flag adds targeted probe requests against Directus. |
| refresh_collection_cacheA | Flushes the Directus server cache so recent schema changes become visible, then optionally verifies that one collection is readable. Use it after create_collection, create_field or apply_schema when a collection or field is reported as missing; validate_collection_creation answers the narrower question of whether a new collection is ready. Mutating but not destructive: it discards cached data, never stored data, though the next requests are slower while the cache refills. Needs a token allowed to flush the cache, and it affects every client of the instance, not just this session. |
| validate_collection_creationA | Confirms that a newly created collection is usable: present in the schema, active, and readable with the current token, retrying once after waitTime milliseconds (default 2000) because Directus can lag a moment behind a create. Read-only. Use it right after create_collection and before writing items; refresh_collection_cache when it still reports the collection as missing, diagnose_collection_access for the full permission breakdown. |
| get_usersA | Lists Directus users (directus_users) with filtering, sorting, field selection, search and pagination. Use get_user to fetch one user when the id is known. Returns at most 25 users unless limit says otherwise. Results are scoped to the permissions of the token, so a token without access to directus_users gets an empty list rather than an error. Directus never returns password hashes or static tokens; pass fields to keep responses small. |
| get_userA | Fetches one Directus user by id, with optional field selection. Use get_users to search or list when the id is unknown. Read-only. Fails when the id does not exist or the token cannot read directus_users. The password hash and static token are never returned. The shorthand id me is not resolved here, so pass the actual user id. |
| get_filesA | Lists files in the Directus file library (directus_files) with filtering, sorting, field selection, search and pagination, returning their metadata rather than their binary contents. Use import_data to load rows from a CSV or JSON file, and get_collection_items for files referenced from a content collection. Returns at most 25 files unless limit says otherwise. Each entry carries the file id, filename, type, size and storage location, which is what an asset URL is built from. |
| get_flowsA | Lists Directus automation flows with filtering, sorting, search and pagination. Use get_flow for one flow and its operations, get_operations for operations across flows, trigger_flow to run one. status narrows to active or inactive flows; folder (Directus 12.4+) narrows to one flow folder, where an empty string means root-level flows. Returns at most 25 flows unless limit says otherwise, and flow metadata only: operations are omitted unless get_flow asks for them. |
| get_flowA | Fetches one automation flow by id, optionally with its operations expanded so the whole pipeline can be read in a single call. Use get_flows to find the id and get_operations to list operations across several flows. Read-only: reading a flow never runs it, trigger_flow does that. include_operations costs an extra request and makes the response large on long flows. |
| create_flowA | Creates an automation flow and, optionally, its first operations in the same call. trigger selects what starts the flow (manual, schedule, event, webhook) and options carries the trigger-specific configuration, so a schedule flow needs its cron expression in options. A flow created with status active starts reacting immediately, events included, so create it inactive when that is not wanted. Each operations entry needs key, type and editor coordinates; operations are created but not chained, so wire the resolve and reject paths with update_flow or in the admin app. Use update_flow to change a flow and trigger_flow to run one. |
| update_flowA | Updates one flow by id: name, status, trigger, description or trigger options. Idempotent, and it replaces the keys present in data while leaving the rest alone. Switching status to active makes the flow start reacting to its trigger at once, and changing trigger or options can leave the flow inconsistent with operations built for the old trigger. Operations themselves are not edited here, so read them with get_flow or get_operations. This tool writes an automation and has nothing to do with analyze_relationships, which inspects the data model. |
| delete_flowA | Deletes a flow and all of its operations, permanently. Requires confirm: true. Whatever depended on the flow stops working, including a webhook URL that pointed at it, its schedule and any flow that triggered it, and the run history goes with it. Use update_flow with status inactive to switch a flow off and keep it. Not reversible. |
| trigger_flowA | Runs one flow now and returns whatever its last operation produced. The side effects are whatever the flow does, which can mean writing items, sending mail or calling external services, so treat it as destructive unless the flow is known to be read-only. Flows with a manual trigger accept this reliably; others may refuse it or ignore the payload. data becomes the trigger payload and must match what the flow expects. Read the flow with get_flow before running it. |
| get_operationsA | Lists the operations (steps) that make up flows, optionally narrowed to one flow with flow_id. Use get_flow with include_operations for the whole pipeline of a single flow, and this tool to scan across flows, for example to find every step of a given type. Read-only: listing an operation never runs it. Returns at most 50 operations unless limit says otherwise, each with its key, type, editor position and options. |
| get_schema_snapshotA | Exports the data model (collections, fields and relations, with no item data) as a snapshot object that diff_schema and apply_schema accept. Use it to back up the model before a destructive change, to move a model between environments, or to version it in git. Read-only. include_collections and exclude_collections are mutually exclusive and produce a partial snapshot, which on apply can read as a request to delete everything left out, so prefer a full snapshot for migrations. |
| diff_schemaA | Compares a snapshot against the live data model and reports the operations that applying it would perform. Read-only, nothing is modified, which makes it the safe way to preview a migration before apply_schema, the tool that consumes the { hash, diff } object returned here. mode mirror (default) includes deletions so the live model would end up matching the snapshot exactly; merge drops them for a strictly additive diff. force bypasses the Directus version and database vendor checks and risks producing a diff that cannot be applied. An empty diff means the model already matches. |
| apply_schemaA | Applies a diff from diff_schema to the live data model, creating, altering and dropping collections and fields. Requires confirm: true. Destructive and not transactional: a mirror-mode diff drops whatever is missing from the snapshot, and a failure partway leaves the model half-migrated. The hash ties the diff to the model it was computed against and the call is refused when the model has moved since; force bypasses that check and can corrupt the model. Always run diff_schema first and keep a get_schema_snapshot backup. |
| import_dataA | Imports rows from a CSV or JSON file into one collection, or into several related collections at once from a flat multi-collection file. Use it when the data is in a file; bulk_operations takes payloads already in memory and create_item a single row. Subject to the Directus IMPORT_MAX_FILE_SIZE limit (50mb by default). Single-collection: pass collection, and the file is a plain array of rows. Batch (Directus 12.2+): omit collection, and the file MUST be a JSON array of { "collection": string, "items": object[] } entries, e.g. [{"collection":"authors","items":[{"name":"Ann"}]},{"collection":"articles","items":[{"title":"Hi","author":1}]}] Writes immediately and is not a transaction, so a failure partway leaves earlier rows imported. mode merge upserts instead of inserting, dry_run reports the changes without writing, and only dangerously_allow_delete together with confirm lets rows absent from the file be deleted. |
| search_toolsA | Finds the tools on this server that match a task description and returns their full definitions, so the right one can be called straight away. Use it first when unsure which tool fits, rather than guessing a name. Read-only and local: it searches the definitions this server already advertises, reaches Directus not at all, and so costs nothing against the instance. Matching runs over tool names, descriptions and keywords. Returns up to 10 tools unless limit says otherwise, best match first. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 34 tools
Most tools target clearly distinct resources and actions, and the descriptions explicitly distinguish adjacent tools such as get_collection_schema, analyze_collection_schema, and validate_collection_schema. Some overlap remains among the schema inspection, validation, access diagnosis, and cache-refresh helpers, which can make tool selection harder in a 34-tool surface.
Names are overwhelmingly snake_case and follow a verb_noun pattern, such as get_user, create_item, delete_flow, and validate_collection_creation. Minor inconsistencies exist, including list_collections versus get_users/get_files/get_flows, and noun-style names like bulk_operations.
At 34 tools, the surface is well above the practical 3-15 range and feels heavy even for a broad platform like Directus. Several fine-grained schema validation, diagnosis, cache, and creation-check tools could likely be consolidated or exposed as options on fewer tools.
The server covers core Directus areas such as items, fields, collections, flows, relationships, schema snapshots, and imports. However, notable lifecycle gaps remain: users and files are read-only, relationships lack update/delete, flow operations cannot be edited directly, and collection metadata updates are absent.