mcpField
D
Druxt docs

Druxt docs

Remote
druxtjs.orgDeveloper Tools1Updated 6d ago

About Druxt docs

Druxt docs is the documentation website and working example site for Druxt, aimed at developers building Drupal-backed Nuxt frontends. It combines Drupal-authored pages with a Nuxt rendering layer and includes module, API, and component references.

Key features

  1. 01Druxt documentation and API reference
  2. 02Drupal-authored documentation pages
  3. 03Nuxt frontend example
  4. 04Component and module references

Use cases

  1. 01Look up Druxt APIs and modules
  2. 02Study a Druxt and Nuxt site structure
  3. 03Edit and preview documentation locally

Configuration

Remote servers need no local install. Pick your client, then copy the config or install in one click.

Endpointhttps://druxtjs.org/mcp
Copy install command
Claude CodeTerminal
Cursor.cursor/mcp.json
VS Code.vscode/mcp.json
Claude Desktopclaude_desktop_config.json
Windsurf~/.codeium/windsurf/mcp_config.json

Run commands in a terminal; paste JSON into the client’s MCP config and restart. Servers that need sign-in will prompt on first connect.

Tools

Details

From the project README
druxtjs.org: Nuxt frontend and Drupal backend, built with Druxt

druxtjs.org

Nuxt frontend and Drupal backend, built with Druxt.

This repository is the source of druxtjs.org, the documentation site for Druxt. It is also a working example of a Druxt site: its pages are Drupal content, rendered by Nuxt.

The site is two applications in one repository. nuxt/ is the frontend. It renders the documentation with Druxt, through DruxtEntity and its wrapper components. drupal/ is the Drupal 11 backend that editors write in.

Get involved

Run the whole site on your machine, frontend and backend together. Pick one of three ways.

WayYou need
Dev containerVS Code with Dev Containers, GitHub Codespaces, or DevPod
misemise, and three PHP extensions
By handPHP 8.3 or later, Composer and Node 16.20.1
Dev container

Open in DevPod!

ToolHow
VS CodeClone the repository, open it, then choose Reopen in Container
GitHub CodespacesOn the repository page, open Code and choose Codespaces
DevPodClick the badge, or run devpod up https://github.com/druxt/druxtjs.org

The container has Node 16.20.1, PHP 8.4, Composer and mise. Creating it runs npm install and npm run setup, so Drupal is running when it opens. Then run npm run dev.

mise

.mise.toml pins Node 16.20.1 and PHP 8.4. PHP needs the gd, pdo_sqlite and sodium extensions.

mise install
npm install
npm run setup
npm run dev
By hand

Install PHP 8.3 or later with the gd, pdo_sqlite and sodium extensions, Composer, and Node 16.20.1. Then run:

npm install
npm run setup
npm run dev
What you get
CommandWhat it does
npm installInstalls the root tooling and enables the git hooks
npm run setupInstalls Drupal on a throwaway SQLite database, fetches the pinned druxt.js for the API pages, then starts Drupal
npm run devStarts the Nuxt dev server against that Drupal. The first run installs the frontend's packages
npm run loginPrints a one-time login link for Drupal
ServiceAddress
Drupalhttp://127.0.0.1:8888, or the next free port. npm run info shows which
Nuxthttp://localhost:3000

npm run setup writes Drupal's address to .env, and npm run dev reads it from there. Setup needs network access, for Composer packages and the pinned documentation on GitHub.

Write documentation

  1. Run npm run login, and open the link it prints.
  2. In Drupal, go to Content and edit a page, or add one. The layout paragraphs editor builds a page from sections of text, code and images.
  3. Save, then reload the page on http://localhost:3000.

Preview, on the edit form, shows unsaved changes. docs/backend.md explains its tabs.

An edit made here is local to this machine's database: it previews and tests the site, and is not how page text is published. See Where changes go for what belongs where.

Editors can also sign in on http://localhost:3000 and see a page's latest draft on its own URL. docs/backend.md covers the workflow and the sign-in.

The Modules, API reference and Components pages come from the druxt.js packages. npm run docs:generate builds them locally, in the pinned druxt.js checkout. It installs and builds druxt.js first, so the first run is slow.

Where changes go
ChangeWhere it goes
The content model, the editor or the site's settingsExport them with vendor/bin/drush config:export in drupal/, and commit drupal/config/sync/ in a pull request
The frontendA pull request with the change in nuxt/
The text of a pageDrupal, where editors change it. The database is the source of truth, and page text is not taken as a pull request yet

The site's content is stored in production's database. A local Drupal starts with no pages, and edits in it stay local.

Druxt in the frontend

nuxt/ is a Nuxt 2 app built with Druxt, and it is written to be read as an example of a Druxt site.

WhatHow
PagesEach section page resolves its path with the Druxt router, then renders the Drupal page with <DruxtEntity mode="full">.
Wrappersnuxt/components/druxt/ holds the wrapper components Druxt finds by name. The page is entity/node/DocPageFull.vue, with one component per paragraph type in entity/paragraph/. The rest are fields (field/), layout sections (layout-paragraph/), blocks (block/), block regions (block-region/) and menus (menu/).
Display settingsdruxt-schema reads Drupal's view and form displays when the app builds, so the frontend follows the display settings editors change in Drupal.
Layoutdruxt-layout-paragraphs renders the page's layout sections.
Header, sidebar and footerdruxt-blocks renders the blocks placed in the druxtjs theme's regions in Drupal. The theme and the site's name and logo come from the druxtjs_org consumer's decoupled settings, read at build by nuxt/modules/decoupled-settings.
UInuxt/components/dui/ holds presentational components with no Drupal dependency: code blocks, diagrams, rich text and columns. They will move to the shared Druxt UI library.
Playgroundnuxt/components/global/DruxtExample.vue renders any Druxt component under a runtime of its own for the chosen backend (nuxt/utils/druxt-runtime.js), with what it knows about each component in nuxt/utils/live-examples.js. The same card sits on the module and component reference pages.

To change how something looks, find the wrapper name Druxt looked for (the Vue devtools show it), and add a component at the matching path under nuxt/components/druxt/. Component resolution explains the naming.

Deployment

The site runs on Lagoon as one environment, Drupal beside Nuxt. Nuxt serves pre-rendered pages first, and renders live any page it has not stored or that has aged past its time to live. docs/hosting.md covers what a deployment does.

Commands

CommandWhat it does
npm run setupInstall the backend, then start it
npm run devNuxt dev server against the backend
npm run storybookStorybook on port 3030, against the backend
npm run start / stopStart or stop Drupal
npm run infoWhere Drupal is, and the versions it runs
npm run loginOne-time login link for Drupal
npm run docs:generateBuild the Modules, API reference and Components pages
npm run lintEvery linter except prose
npm run lint:proseVale, after npm run lint:prose:install once
npm testNode tests for the scripts and the frontend's modules

Contributing

See CONTRIBUTING.md for commit messages, checks and what never goes in a file. Open issues and pull requests on druxt/druxtjs.org. docs/backend.md covers page history and previews.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.