{"_id":"@archawat/mcp-directus","_rev":"4-5ed05874a0a2bbd2059baf16a2fb4fb9","name":"@archawat/mcp-directus","dist-tags":{"latest":"2.0.3"},"versions":{"1.0.0":{"name":"@archawat/mcp-directus","version":"1.0.0","keywords":["ai","directus","mcp","modelcontextprotocol","model-context-protocol","mcp-server","cms","headless-cms"],"license":"MIT","_id":"@archawat/mcp-directus@1.0.0","maintainers":[{"name":"archawat","email":"archawat.l@gmail.com"}],"contributors":[{"name":"Rijk van Zanten","email":"rijkvanzanten@me.com"},{"name":"Bryant Gillespie"}],"homepage":"https://github.com/archawat/mcp-directus#readme","bugs":{"url":"https://github.com/archawat/mcp-directus/issues"},"bin":{"mcp-directus":"dist/index.js"},"dist":{"shasum":"ca259db2ea526311925c8fa4b9977332be43f28a","tarball":"https://registry.npmjs.org/@archawat/mcp-directus/-/mcp-directus-1.0.0.tgz","fileCount":89,"integrity":"sha512-TxQffJL5ouVWxtrj5LaK/ecmUlBFsTlLzKLSECIkVKAgL+yN4Fth92GSjphQzLRFTH/NKlDD7tMkSnurv14Iew==","signatures":[{"sig":"MEYCIQCOnihmqPqSDRzmC/PMyYgeYrSpgyp4+sQuyQJTcdQxeAIhAKBqrOoV1uPiZYnlAhbpp4zkMUGog/+jjl3FBXYz0h5v","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":317192},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"44af41479caaefdfdd029f6e0b91b89719987e43","scripts":{"dev":"tsc --project tsconfig.json --watch & node --watch dist/index.js","lint":"eslint .","build":"tsc --project tsconfig.json","start":"node dist/index.js","lint:fix":"eslint --fix .","prepublishOnly":"pnpm build"},"_npmUser":{"name":"archawat","email":"archawat.l@gmail.com"},"repository":{"url":"git+https://github.com/archawat/mcp-directus.git","type":"git"},"_npmVersion":"11.6.2","description":"Model Context Protocol server for Directus projects.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"zod":"4.0.0-beta.20250424T163858","dotenv":"16.5.0","marked":"^15.0.11","@directus/sdk":"19.1.0","isomorphic-dompurify":"^2.24.0","@modelcontextprotocol/sdk":"1.10.2"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.4.1","devDependencies":{"eslint":"^9.25.1","typescript":"5.8.3","@types/node":"22.15.3","@directus/types":"^13.1.0","@directus/tsconfig":"3.0.0","@directus/eslint-config":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-directus_1.0.0_1770829691313_0.3654598828489244","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@archawat/mcp-directus","version":"2.0.0","keywords":["ai","directus","mcp","modelcontextprotocol","model-context-protocol","mcp-server","cms","headless-cms"],"license":"MIT","_id":"@archawat/mcp-directus@2.0.0","maintainers":[{"name":"archawat","email":"archawat.l@gmail.com"}],"contributors":[{"name":"Rijk van Zanten","email":"rijkvanzanten@me.com"},{"name":"Bryant Gillespie"}],"homepage":"https://github.com/archawat/mcp-directus#readme","bugs":{"url":"https://github.com/archawat/mcp-directus/issues"},"bin":{"mcp-directus":"dist/index.js"},"dist":{"shasum":"fce713026dee120e8f9e56a25e0de387fde2442c","tarball":"https://registry.npmjs.org/@archawat/mcp-directus/-/mcp-directus-2.0.0.tgz","fileCount":91,"integrity":"sha512-U29yTj2DI3qJIyepritBjZ44GTtOXi+iRDnhWKfcHnjOYqCEsuHGcCKEEBiN3hqIZN2DypIElJRCJVrzYUk2sw==","signatures":[{"sig":"MEYCIQCYLMvPTVWY1gtkschK13BPOh3kvA6qD0Msx49XVc0xVgIhAJyhEyyyhkPqBNbtmVrbfOmNpp42cEdxpY+P5Tnm+voV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":260211},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"ad5c3e612a267e32463561559085fea288c0b417","scripts":{"dev":"tsc --project tsconfig.json --watch & node --watch dist/index.js","lint":"eslint .","build":"tsc --project tsconfig.json","start":"node dist/index.js","lint:fix":"eslint --fix .","prepublishOnly":"pnpm build"},"_npmUser":{"name":"archawat","email":"archawat.l@gmail.com"},"repository":{"url":"git+https://github.com/archawat/mcp-directus.git","type":"git"},"_npmVersion":"11.6.2","description":"Model Context Protocol server for Directus projects.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"zod":"^3.25.1","dotenv":"16.5.0","marked":"^15.0.11","@directus/sdk":"19.1.0","isomorphic-dompurify":"^2.24.0","@modelcontextprotocol/sdk":"^1.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.4.1","devDependencies":{"eslint":"^9.25.1","typescript":"5.8.3","@types/node":"22.15.3","@directus/types":"^13.1.0","@directus/tsconfig":"3.0.0","@directus/eslint-config":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-directus_2.0.0_1774275766134_0.738160210355141","host":"s3://npm-registry-packages-npm-production"}},"2.0.2":{"name":"@archawat/mcp-directus","version":"2.0.2","keywords":["ai","directus","mcp","modelcontextprotocol","model-context-protocol","mcp-server","cms","headless-cms"],"license":"MIT","_id":"@archawat/mcp-directus@2.0.2","maintainers":[{"name":"archawat","email":"archawat.l@gmail.com"}],"contributors":[{"name":"Rijk van Zanten","email":"rijkvanzanten@me.com"},{"name":"Bryant Gillespie"}],"homepage":"https://github.com/archawat/mcp-directus#readme","bugs":{"url":"https://github.com/archawat/mcp-directus/issues"},"bin":{"mcp-directus":"dist/index.js"},"dist":{"shasum":"c9618c8f7434cf7fbb7a0a8f51c7ce48c1f24b5b","tarball":"https://registry.npmjs.org/@archawat/mcp-directus/-/mcp-directus-2.0.2.tgz","fileCount":93,"integrity":"sha512-V0RpNQDbLNtXr5iHbsYp0Lh0hYJNzCpKEGK8O6ATGViHm+92U9LAqVCKBvDoU/b53tA8nh0j76xQ4vOluKwctQ==","signatures":[{"sig":"MEUCIQCJf8d+D2Nh1KohpbKJaO5SPc5TqfcySqi2pRYa84qMnAIgD5d9d9XqB2X1sX3qSg9RGMaf1+FZGf5r4ZwG03scYuQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":262171},"main":"dist/index.js","type":"module","types":"./dist/index.d.ts","engines":{"node":">=18.0.0"},"gitHead":"776da2a06f7cb162fd1ccee4bbcf51b13cc1ddaf","scripts":{"dev":"tsc --project tsconfig.json --watch & node --watch dist/index.js","lint":"eslint .","build":"tsc --project tsconfig.json","start":"node dist/index.js","lint:fix":"eslint --fix .","prepublishOnly":"pnpm build"},"_npmUser":{"name":"archawat","email":"archawat.l@gmail.com"},"repository":{"url":"git+https://github.com/archawat/mcp-directus.git","type":"git"},"_npmVersion":"11.6.2","description":"Model Context Protocol server for Directus projects.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"zod":"^3.25.1","dotenv":"16.5.0","marked":"^15.0.11","@directus/sdk":"19.1.0","isomorphic-dompurify":"^2.24.0","@modelcontextprotocol/sdk":"^1.27.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"packageManager":"pnpm@10.4.1","devDependencies":{"eslint":"^9.25.1","typescript":"5.8.3","@types/node":"22.15.3","@directus/types":"^13.1.0","@directus/tsconfig":"3.0.0","@directus/eslint-config":"^0.1.0"},"_npmOperationalInternal":{"tmp":"tmp/mcp-directus_2.0.2_1779285974960_0.36150324214681384","host":"s3://npm-registry-packages-npm-production"}},"2.0.3":{"name":"@archawat/mcp-directus","type":"module","version":"2.0.3","packageManager":"pnpm@10.4.1","description":"Model Context Protocol server for Directus projects.","contributors":[{"name":"Rijk van Zanten","email":"rijkvanzanten@me.com"},{"name":"Bryant Gillespie"}],"license":"MIT","homepage":"https://github.com/archawat/mcp-directus#readme","repository":{"type":"git","url":"git+https://github.com/archawat/mcp-directus.git"},"bugs":{"url":"https://github.com/archawat/mcp-directus/issues"},"keywords":["ai","directus","mcp","modelcontextprotocol","model-context-protocol","mcp-server","cms","headless-cms"],"main":"dist/index.js","bin":{"mcp-directus":"dist/index.js"},"engines":{"node":">=18.0.0"},"publishConfig":{"access":"public"},"scripts":{"prepublishOnly":"pnpm build","build":"tsc --project tsconfig.json","dev":"tsc --project tsconfig.json --watch & node --watch dist/index.js","start":"node dist/index.js","lint":"eslint .","lint:fix":"eslint --fix ."},"dependencies":{"@directus/sdk":"19.1.0","@modelcontextprotocol/sdk":"^1.27.1","dotenv":"16.5.0","isomorphic-dompurify":"^2.24.0","marked":"^15.0.11","zod":"^3.25.1"},"devDependencies":{"@directus/eslint-config":"^0.1.0","@directus/tsconfig":"3.0.0","@directus/types":"^13.1.0","@types/node":"22.15.3","eslint":"^9.25.1","typescript":"5.8.3"},"gitHead":"0b911ef7133623737d655e103622096979b3bead","types":"./dist/index.d.ts","_id":"@archawat/mcp-directus@2.0.3","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-qdZVHpxHJCoTFYYl8TBk0zQvl/EqykUnnLzmTkh2Jbq0rE1AywHH4tISFf61wL3TO6dor69haTgxqOiwGVUvlg==","shasum":"1b3b894b39bf8b7f0c42ea84f5f51ea7a060ae4a","tarball":"https://registry.npmjs.org/@archawat/mcp-directus/-/mcp-directus-2.0.3.tgz","fileCount":93,"unpackedSize":265997,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD3l2dAAKibFtpkAV8144+HaOqOhEyGd7pGhIatFzL+CwIhAKN1njIGj893+mjOawSuy54pxCLNbYSkfX7Ex/Jr5Sy3"}]},"_npmUser":{"name":"archawat","email":"archawat.l@gmail.com"},"directories":{},"maintainers":[{"name":"archawat","email":"archawat.l@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/mcp-directus_2.0.3_1779761928894_0.1648317162664763"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T17:08:11.256Z","modified":"2026-05-26T02:18:49.149Z","1.0.0":"2026-02-11T17:08:11.479Z","2.0.0":"2026-03-23T14:22:46.283Z","2.0.2":"2026-05-20T14:06:15.150Z","2.0.3":"2026-05-26T02:18:49.039Z"},"bugs":{"url":"https://github.com/archawat/mcp-directus/issues"},"license":"MIT","homepage":"https://github.com/archawat/mcp-directus#readme","keywords":["ai","directus","mcp","modelcontextprotocol","model-context-protocol","mcp-server","cms","headless-cms"],"repository":{"type":"git","url":"git+https://github.com/archawat/mcp-directus.git"},"description":"Model Context Protocol server for Directus projects.","contributors":[{"name":"Rijk van Zanten","email":"rijkvanzanten@me.com"},{"name":"Bryant Gillespie"}],"maintainers":[{"name":"archawat","email":"archawat.l@gmail.com"}],"readme":"# Directus MCP Server\n\nAn [MCP (Model Context Protocol)](https://modelcontextprotocol.io/introduction) server that connects your AI assistant (Claude, Cursor, etc.) to a Directus instance. Ask your AI to read content, manage schema, create automation flows, and more — all through natural language.\n\n## Features\n\n- **Content Management** — Read, create, and update items across your Directus collections\n- **Schema Management** — Create and modify collections, fields, and relations\n- **Flow Automation** — Build and trigger Directus flows with operations and conditions\n- **File Management** — Read, update, and import files and assets\n- **User & Comments** — Read users and manage comments on collection items\n- **Content Conversion** — Convert between HTML and Markdown\n- **Prompt Management** — Serve LLM prompts from a Directus collection (optional)\n- **Safe Defaults** — Destructive operations (delete) are disabled by default\n- **Scoped Access** — Exclude sensitive collections from AI access via configuration\n\n## Quick Start\n\n### Prerequisites\n\n- A running Directus instance ([Directus Cloud](https://directus.cloud/register) or self-hosted)\n- A Directus API token or user credentials\n\n### Installation\n\n#### Using npx (Recommended)\n\nNo installation needed. Add to your MCP client configuration (Claude Desktop / Claude Code / Cursor):\n\n```json\n{\n  \"mcpServers\": {\n    \"directus\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@archawat/mcp-directus\"],\n      \"env\": {\n        \"DIRECTUS_URL\": \"https://your-instance.com\",\n        \"DIRECTUS_TOKEN\": \"your-token\"\n      }\n    }\n  }\n}\n```\n\n#### Global Install\n\n```bash\nnpm install -g @archawat/mcp-directus\n```\n\nThen configure your MCP client:\n\n```json\n{\n  \"mcpServers\": {\n    \"directus\": {\n      \"command\": \"mcp-directus\",\n      \"env\": {\n        \"DIRECTUS_URL\": \"https://your-instance.com\",\n        \"DIRECTUS_TOKEN\": \"your-token\"\n      }\n    }\n  }\n}\n```\n\n## Available Tools\n\n### Discovery\n\n| Tool | Description |\n|------|-------------|\n| `directus_help` | Overview of available tools and token-efficiency guidance |\n| `directus_list_collections` | List all collection names (lightweight) |\n| `directus_count_items` | Count items in a collection without fetching data |\n| `directus_get_item_summary` | Quick summary of items with key fields only |\n\n### Schema\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_collection_schema` | Schema for a single collection (preferred) |\n| `directus_read_collections` | Full schema for all collections (large response — use sparingly) |\n| `directus_create_collection` | Create a new collection or folder |\n\n### Fields\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_fields` | All fields for a collection |\n| `directus_read_field` | A single field's details |\n| `directus_create_field` | Add a field to a collection |\n| `directus_update_field` | Modify an existing field |\n\n### Relations\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_relations` | List relations, optionally filtered by collection |\n| `directus_read_relation` | Details of a specific relation |\n| `directus_create_relation` | Create a relation (M2O, O2M, M2M, M2A) |\n| `directus_update_relation` | Update an existing relation |\n| `directus_delete_relation` | Delete a relation *(disabled by default)* |\n\n### Items\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_items` | Read items from a collection with filtering, sorting, and pagination |\n| `directus_create_item` | Create a new item *(system collections protected by default)* |\n| `directus_update_item` | Update an existing item *(system collections protected by default)* |\n| `directus_delete_item` | Delete an item *(disabled by default)* |\n\n### Flows\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_flows` | List all flows, optionally filtered by trigger type |\n| `directus_read_flow` | Details of a specific flow |\n| `directus_create_flow` | Create a new automation flow |\n| `directus_update_flow` | Update an existing flow |\n| `directus_delete_flow` | Delete a flow *(disabled by default)* |\n| `directus_trigger_flow` | Manually trigger a flow |\n\n### Operations (Flow Steps)\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_operations` | List operations, optionally filtered by flow |\n| `directus_read_operation` | Details of a specific operation |\n| `directus_create_operation` | Add an operation to a flow |\n| `directus_update_operation` | Modify an existing operation |\n| `directus_delete_operation` | Delete an operation *(disabled by default)* |\n\n### Users\n\n| Tool | Description |\n|------|-------------|\n| `directus_users_me` | Current authenticated user info |\n| `directus_read_users` | Read user data with filtering and field selection |\n\n### Comments\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_comments` | Read comments on collection items |\n| `directus_upsert_comment` | Create or update a comment on an item |\n\n### Files & Assets\n\n| Tool | Description |\n|------|-------------|\n| `directus_read_files` | Read file metadata or raw file content |\n| `directus_update_files` | Update file metadata (batch supported) |\n| `directus_import_file` | Import a file from a URL |\n| `directus_read_folders` | List file folders |\n\n### Utilities\n\n| Tool | Description |\n|------|-------------|\n| `directus_markdown` | Convert between HTML and Markdown |\n\n### Prompts (Optional)\n\n| Tool | Description |\n|------|-------------|\n| `directus_system_prompt` | Retrieve system prompt with operational guidelines *(enabled by default)* |\n| `directus_get_prompts` | Retrieve LLM prompts from a Directus collection *(disabled by default)* |\n\n## Configuration\n\n### Environment Variables\n\n```bash\n# Required — Directus instance URL\nDIRECTUS_URL=https://your-instance.com\n\n# Authentication (use token OR email/password)\nDIRECTUS_TOKEN=your-token\nDIRECTUS_USER_EMAIL=user@example.com\nDIRECTUS_USER_PASSWORD=password\n\n# Disable specific tools (comma-separated, uses full tool names)\n# Default: directus_delete_item\nDISABLE_TOOLS=directus_delete_item,directus_delete_flow,directus_delete_operation,directus_delete_relation\n\n# Exclude collections from AI access (comma-separated)\nSCHEMA_EXCLUDE_COLLECTIONS=logs,cache,temp_data\n\n# Allow modifying Directus system collections (disabled by default)\nALLOW_SYSTEM_MODIFICATIONS=false\n\n# System prompt configuration\nMCP_SYSTEM_PROMPT_ENABLED=true          # Enable the system prompt tool (default: true)\nMCP_SYSTEM_PROMPT=                       # Custom system prompt override (optional)\n\n# LLM Prompts collection (disabled by default)\nDIRECTUS_PROMPTS_COLLECTION_ENABLED=false\nDIRECTUS_PROMPTS_COLLECTION=prompts              # Collection name storing LLM prompts\nDIRECTUS_PROMPTS_NAME_FIELD=name                 # Field for prompt name\nDIRECTUS_PROMPTS_DESCRIPTION_FIELD=description   # Field for prompt description\nDIRECTUS_PROMPTS_SYSTEM_PROMPT_FIELD=system_prompt  # Field for system prompt text\nDIRECTUS_PROMPTS_MESSAGES_FIELD=messages          # Field for prompt messages\n```\n\n### `SCHEMA_EXCLUDE_COLLECTIONS`\n\nExcludes specific collections from schema loading and all tool operations. Useful for:\n\n- **Performance** — Skip large log or cache collections\n- **Security** — Prevent AI access to sensitive data\n- **Focus** — Limit the AI to only relevant collections\n\n```bash\nSCHEMA_EXCLUDE_COLLECTIONS=activity_logs,cache,temp_uploads,user_sessions\n```\n\n### `ALLOW_SYSTEM_MODIFICATIONS`\n\nControls whether the AI can modify Directus system collections (`directus_users`, `directus_roles`, `directus_permissions`, etc.). **Disabled by default.**\n\n- `false` (default) — Blocks create/update on system collections (read is always allowed)\n- `true` — Allows system collection modifications. Use with caution; incorrect changes can break your Directus instance\n\n### `DISABLE_TOOLS`\n\nComma-separated list of tool names to disable. Default: `directus_delete_item`.\n\n```bash\n# Disable all destructive operations\nDISABLE_TOOLS=directus_delete_item,directus_delete_flow,directus_delete_operation,directus_delete_relation\n```\n\n### `DIRECTUS_PROMPTS_COLLECTION_ENABLED`\n\nWhen enabled, exposes the `directus_get_prompts` tool which reads LLM prompts from a Directus collection. Requires `DIRECTUS_PROMPTS_COLLECTION` to specify the collection name. The field mapping variables (`*_FIELD`) let you customize which fields store the prompt name, description, system prompt, and messages.\n\n## Local Development\n\n```bash\ngit clone https://github.com/archawat/mcp-directus\ncd mcp-directus\npnpm install\npnpm build\npnpm dev\n```\n\nFor local MCP client testing, use the local path:\n\n```json\n{\n  \"mcpServers\": {\n    \"directus\": {\n      \"command\": \"node\",\n      \"args\": [\"/absolute/path/to/mcp-directus/dist/index.js\"],\n      \"env\": {\n        \"DIRECTUS_URL\": \"https://your-instance.com\",\n        \"DIRECTUS_TOKEN\": \"your-token\"\n      }\n    }\n  }\n}\n```\n\n## Contributing\n\nPlease open issues for bugs or suggestions.\n\n## License\n\nMIT\n\n## Acknowledgments\n\n- Original project by [@rijkvanzanten](https://github.com/rijkvanzanten) and the Directus team\n","readmeFilename":"README.md"}