- Home
- MCP servers
- Directus
Directus
- typescript
2
GitHub Stars
typescript
Language
5 months ago
First Indexed
2 months ago
Catalog Refreshed
Documentation & install
Readme and setup notes from the catalogue, plus a client-ready config you can copy for your MCP host.
Installation
Add the following to your MCP client configuration file.
Configuration
View docs{
"mcpServers": {
"staminna-mcp-server-claude": {
"command": "npx",
"args": [
"-y",
"@staminna/directus-mcp-server"
],
"env": {
"NODE_ENV": "production",
"DIRECTUS_URL": "http://localhost:8065",
"DIRECTUS_TOKEN": "your-directus-token-here",
"DIRECTUS_RESOURCES_ENABLED": "true",
"DIRECTUS_PROMPTS_COLLECTION": "ai_prompts",
"DIRECTUS_RESOURCES_EXCLUDE_SYSTEM": "true",
"DIRECTUS_PROMPTS_COLLECTION_ENABLED": "true"
}
}
}
}You set up this MCP Server to bridge Directus with a programmable interface, enabling authentication, collections, files, flows, users, schema analysis, and diagnostics through a consistent MCP client workflow.
How to use
Connect your MCP client to the Directus MCP Server using the stdio configuration shown below. You will run the server locally and point your client at your Directus instance with a static API token. Once connected, you can list collections, inspect schemas, manage items, trigger flows, handle files, and perform diagnostics from your assistant-driven commands.
How to install
Prerequisites: you need Node.js installed on your system. You also need npm for package management.
Install the MCP server globally with npm.
npm install -g @staminna/directus-mcp-server
If you prefer to build from source, clone the project, install dependencies, and build.
git clone https://github.com/staminna/mcp-server-claude.git
cd mcp-server-claude
npm install
npm run build
Configuration and usage notes
To run the MCP server with your Directus instance, you’ll provide the Directus URL and a static API token via environment variables. You can configure your development environment with a stdio-based MCP command that uses npx to start the server.
Troubleshooting
If you cannot connect, ensure Directus is reachable at the URL you supplied and that the API token has the necessary permissions. Restart your IDE or editor after changing MCP settings, and check the console for MCP-related errors.
Development
During development you can build and run the server in watch or dev mode, then start the server when ready.
Notes
The server supports a complete environment-variable configuration set. When running locally, provide the Directus URL and token, and you can also enable optional features such as AI prompts and resources through additional environment variables.
Available tools
list_collections
List all collections in Directus
get_collection_schema
Get schema for a specific collection
get_collection_items
Get items from a collection with filtering
create_collection
Create a new collection
create_item
Create a new item in a collection
update_item
Update an existing item
delete_items
Delete items from a collection
bulk_operations
Execute bulk create, update, delete
create_field
Create a new field in a collection
update_field
Update an existing field
delete_field
Delete a field from a collection
create_relationship
Create relationships between collections
analyze_collection_schema
Analyze schema with relationship mapping
validate_collection_schema
Validate schema and relationships
analyze_relationships
Analyze relationships across collections
get_flows
Get all flows with optional filtering
get_flow
Get a specific flow by ID
create_flow
Create a new automation flow
update_flow
Update an existing flow
delete_flow
Delete a flow
trigger_flow
Manually trigger a flow
get_operations
Get flow operations
get_users
Get all users with filtering
get_user
Get a specific user by ID
get_files
Get files with filtering and pagination
diagnose_collection_access
Diagnose collection access issues
refresh_collection_cache
Refresh collection cache
validate_collection_creation
Validate newly created collections