stack-directus-nextjs
Directus + Next.js architecture plugin. How Directus (content, files, access) and a Next.js App Router frontend fit together: who holds the token, how the cache is invalidated, how assets and types cross the boundary, who owns the session, and a production checklist. Tool knowledge comes from its dependencies.
v2.0.5Updated
- stack
- directus-nextjs
- architecture
- agents-store
- directus
- nextjs
- headless-cms
- app-router
Install
Pick your agent for the steps.
Install on Claude Code
1.Add the marketplace
/plugin marketplace add Agents-Store/claude-plugins2.Install the plugin
/plugin install stack-directus-nextjs@agents-store-claude-pluginsType it inside Claude Code.
Install on GitHub Copilot CLI
1.Add the marketplace
copilot plugin marketplace add Agents-Store/claude-plugins2.Install the plugin
copilot plugin install stack-directus-nextjs@agents-store-claude-plugins
GitHub Copilot CLI does not receive: commands, agents.
Install on Cursor
1.Manual install
Cursor has no install command for a single plugin. Copy the plugin's folder from its place in the mirror on GitHub into the place Cursor reads plugins from.
Cursor’s plugin documentation now lives at docs.grok.com (cursor.com/docs/plugins redirects there). Plugins come from its marketplace, a team marketplace or a local folder.
Install on Codex
1.Add the marketplace
codex plugin marketplace add Agents-Store/codex-plugins2.Install the plugin
codex plugin add stack-directus-nextjs@agents-store-codex-plugins
Codex does not receive: commands, agents.
Install on Gemini CLI
1.Clone the mirror
git clone https://github.com/Agents-Store/gemini-extensions2.Install the plugin
gemini extensions link ./gemini-extensions/stack-directus-nextjsRun it from the folder you cloned into.
Consumer access to Gemini CLI ended on 2026-06-18. This target serves enterprise Gemini Code Assist; Antigravity is the consumer successor.
Install on Antigravity
1.Clone the mirror
git clone https://github.com/Agents-Store/antigravity-skills2.Install the plugin
agy plugin install ./antigravity-skills/stack-directus-nextjsRun it from the folder you cloned into.
Antigravity does not receive: commands.
Install on Kimi Code
1.Clone the mirror
git clone https://github.com/Agents-Store/kimi-plugins2.Install the plugin
/plugins install ./kimi-plugins/stack-directus-nextjsRun it from the folder you cloned into, and type it inside Kimi Code.
Kimi Code does not receive: commands, agents, hooks, MCP servers.
Install on Devin
1.Install the plugin
devin plugins install Agents-Store/devin-plugins#stack-directus-nextjs
Devin does not receive: commands, agents, hooks, MCP servers.
Install on Hermes Agent
1.Install the plugin
hermes plugins install Agents-Store/hermes-plugins/stack-directus-nextjs
Hermes Agent does not receive: commands, agents, hooks, MCP servers.
Install on OpenCode
1.Manual install
OpenCode has no install command for a single plugin. Copy the plugin's folder from its place in the mirror on GitHub into the place OpenCode reads plugins from.
OpenCode does not receive: hooks.
Install on Pi
1.Manual install
Pi has no install command for a single plugin. Copy the plugin's folder from its place in the mirror on GitHub into the place Pi reads plugins from.
Pi does not receive: commands, agents, hooks, MCP servers.
Install on OpenClaw
1.Clone the mirror
git clone https://github.com/Agents-Store/openclaw-generated-plugins2.Install the plugin
openclaw plugins install ./openclaw-generated-plugins/stack-directus-nextjsRun it from the folder you cloned into.
OpenClaw does not receive: commands, agents, hooks, MCP servers.
Install on Agent Plugins 1.0
1.Manual install
Agent Plugins 1.0 has no install command for a single plugin. Copy the plugin's folder from its place in the mirror on GitHub into the place Agent Plugins 1.0 reads plugins from.
Agent Plugins 1.0 does not receive: commands, agents, hooks.
What is inside
Skills (6)
- authentication
This skill should be used when the user wants to "add authentication to Directus + Next.js", "implement Directus login in Next.js", "use NextAuth with Directus", "use Better Auth with Directus", "protect Next.js pages with Directus auth", "choose an auth approach for Directus and Next.js", "decide who owns the session", or needs to decide who owns the end-user session and the tokens across Directus and Next.js.
- deployment
This skill should be used when the user wants to "set up Docker for Directus with Next.js", "run Directus locally for a Next.js app", "configure content-change webhooks", "set up revalidation when Directus content changes", "auto-update the site on content change", "production checklist for Directus + Next.js", or needs the pipeline that connects Directus edits to Next.js pages and the checks before production. For platform-specific deployment (Vercel, Dokploy, etc.), see the respective deployment plugin.
- directus-to-nextjs
This skill should be used when the user wants to "fetch Directus data in Next.js", "display Directus content in Next.js pages", "render Directus images in Next.js", "use Directus SDK with Server Components", "create Next.js pages from Directus collections", "add TypeScript types for Directus", "cache Directus data in Next.js", "revalidate after Directus content changes", "fix 403 on Directus images", or needs the rules where Directus data meets Next.js rendering: who holds the token, what is cached, how files are served, and how types follow the schema.
- examples
End-to-end scenario walkthroughs for the Directus + Next.js stack. This skill should be used when the user asks for "Directus Next.js examples", "how to build a blog with Directus and Next.js", "Directus Next.js product catalog", "show me a complete example", or needs implementation references for common application types.
- full-feature
This skill should be used when the user wants to "build a complete feature with Directus and Next.js", "create an end-to-end page from Directus data", "implement a full CRUD feature across Directus and Next.js", "build a new section of the site", "create a page that shows Directus data", "build a dashboard with Directus content", "display Directus collection in Next.js", "add a new page with CMS data", or needs a step-by-step recipe for building features that span both Directus and Next.js.
- init-project
This skill should be used when the user asks to "set up Directus + Next.js project", "initialize Directus Next.js stack", "configure Directus with Next.js", "connect Directus to Next.js", "bootstrap Directus Next.js app", "create Next.js app with Directus", "scaffold Directus + Next.js", "start new project with Directus", "create a new Directus Next.js project", or needs to set up environment variables and verify connections for the Directus + Next.js stack.
Agents (1)
- stack-orchestrator
Use this agent when the user needs help coordinating work across Directus and Next.js — building pages that display Directus content, deciding who owns the user session, configuring cache revalidation, or implementing features that span both services. <example> Context: User wants to build a page that displays Directus content user: "Build a blog listing page that fetches posts from Directus and displays them with images" assistant: "I'll use the stack-orchestrator agent to build the blog page with Directus data fetching and image handling." <commentary> Feature requires Directus SDK data fetching in a Next.js Server Component with image optimization — spans Data and Interface layers. </commentary> </example> <example> Context: User wants to add authentication user: "Set up user login for the site that uses Directus" assistant: "I'll use the stack-orchestrator agent to decide who owns the session and wire the matching authentication path." <commentary> Authentication spans Directus (user store, token management) and Next.js (session library, proxy) — orchestrator decides who owns the session and coordinates both sides. </commentary> </example> <example> Context: User wants to set up content-change revalidation user: "Set up auto-rebuild when Directus content changes" assistant: "I'll use the stack-orchestrator agent to configure the Directus Flow + tag revalidation pipeline." <commentary> Revalidation wiring spans Directus Flows and Next.js route handlers and cache tags — cross-service coordination. </commentary> </example> <example> Context: User encounters a cross-service issue user: "My Directus images aren't loading in production" assistant: "I'll use the stack-orchestrator agent to diagnose the image loading issue across Directus CORS, Next.js image config, and hosting settings." <commentary> Cross-service debugging requires understanding Directus file permissions, next.config.ts image patterns, and environment variables. </commentary> </example>
MCP servers (1)
- directus http
README
Directus + Next.js architecture plugin for Agents Store. It describes how Directus (content, files, access) and a Next.js App Router frontend fit together: who holds which token, how the cache is invalidated when content changes, how assets and types cross the boundary, who owns the user session, and what to check before production. It names its parts in dependencies; what one tool does and how to drive it is taught by that tool's own plugin.
Architecture
| Layer | Service | Role |
|---|---|---|
| Data | Directus | Content, REST API, file storage, users and policies |
| Interface + Logic | Next.js | App Router, Server Components, Server Actions, Route Handlers |
The boundary between them is what this plugin owns:
| Boundary | Rule |
|---|---|
| Token | The server holds a service token of a dedicated Directus user; the browser holds nothing of Directus |
| Cache | Every Directus read is tagged with its collection; a Directus Flow expires the tag through a Route Handler |
| Assets | A file URL never carries a token: public files, or a server route that adds the token |
| Types | types/directus.ts follows the Directus schema, and tsc is the drift check |
| Session | One owner of the end-user session, chosen once (see authentication) |
Deployment is handled by a separate plugin (for example dokploy-dev, vercel-dev).
Dependencies
Declared in plugin.json and installed together with the stack. They hold the tool-level knowledge:
| Plugin | Teaches |
|---|---|
directus-dev | Directus MCP tools, REST API, @directus/sdk (sdk-patterns, including server-side use), local Docker Compose (docker-local-dev), flows (flow-automation), schema design |
nextjs-dev | App Router, data fetching and caching (data-fetching), authentication (auth-patterns), proxy.ts, images, Cache Components |
nextjs-provision (shadcn/ui setup) is optional: install it separately if you want it. Pick the plugin that matches your hosting for deployment (dokploy-dev, vercel-dev).
Prerequisites
- Directus 12 (MCP needs 11.12 or later and is switched on in Settings → AI)
- Next.js 16,
next@^16.3.8 - Node.js 22 or later (
@directus/sdk26 requires it) - Docker, for a local Directus
Installation
claude plugin install stack-directus-nextjs@agents-store-claude-plugins
The two technology plugins above come with it.
MCP Server
This plugin's .mcp.json connects Claude to Directus. Tools are named mcp__plugin_stack-directus-nextjs_directus__<tool> (schema, collections, fields, items, files, flows and the rest of the Directus MCP surface).
| Server | Transport | Address |
|---|---|---|
directus | HTTP | ${NEXT_PUBLIC_DIRECTUS_URL}/mcp with Bearer ${DIRECTUS_ADMIN_TOKEN} |
MCP acts with the permissions of the token's user, so a token of a dedicated user with a narrow policy also narrows what the model can change.
Environment Variables
Copy templates/.env.example to your project root as .env.local:
| Variable | Purpose | Client-side |
|---|---|---|
NEXT_PUBLIC_DIRECTUS_URL | Directus address | Yes |
DIRECTUS_ADMIN_TOKEN | Static token of a dedicated Directus user (the name is historical; an administrator token is for local development only) | No |
DIRECTUS_URL, DIRECTUS_TOKEN, NEXT_PUBLIC_CMS_URL | The names the directus-dev and nextjs-dev recipes read. In .env.local they expand to the two variables above (DIRECTUS_URL=${NEXT_PUBLIC_DIRECTUS_URL}, DIRECTUS_TOKEN=${DIRECTUS_ADMIN_TOKEN}, NEXT_PUBLIC_CMS_URL=${NEXT_PUBLIC_DIRECTUS_URL}); without them the NextAuth login calls undefined/auth/login and the images config fails | NEXT_PUBLIC_CMS_URL: yes |
NEXTAUTH_URL | NextAuth base URL (NextAuth path only) | No |
NEXTAUTH_SECRET | NextAuth encryption secret (NextAuth path only) | No |
REVALIDATION_SECRET | Shared secret for /api/revalidate, sent by a Directus Flow in a header | No |
PUBLIC_ASSET_FOLDER_ID | Directus folder whose files the asset proxy may serve (proxy path only) | No |
Skills
| Skill | Description |
|---|---|
init-project | Versions, environment, dependencies, client and types, verification |
directus-to-nextjs | The boundary: token, cache, assets, types |
authentication | Who owns the user session and the tokens; three paths |
deployment | Local development pointers, the revalidation pipeline, production checklist |
full-feature | Step-by-step recipe for building a feature across both layers |
examples | Scenario walkthroughs (blog, product catalog) |
Agent
stack-orchestrator — Coordinates work across Directus and Next.js: content pages, the session, revalidation, and cross-service debugging.
Source
- Source on GitHub
- Mirror: Agents-Store/claude-plugins
- Mirror: Agents-Store/cursor-plugins
- Mirror: Agents-Store/codex-plugins
- Mirror: Agents-Store/gemini-extensions
- Mirror: Agents-Store/antigravity-skills
- Mirror: Agents-Store/kimi-plugins
- Mirror: Agents-Store/devin-plugins
- Mirror: Agents-Store/hermes-plugins
- Mirror: Agents-Store/opencode-plugins
- Mirror: Agents-Store/pi-extensions
- Mirror: Agents-Store/openclaw-generated-plugins
- Mirror: Agents-Store/agentplugins