Skip to content

drupal index

Paulo Maia Carvalho edited this page Oct 2, 2026 · 1 revision

drupal-index

Builds a code intelligence index of your Drupal project with GitNexus and registers it as an MCP server. Once active, the agent can answer questions such as "what calls this service?" or "what breaks if I change this class?" with one query instead of several grep/find calls.

Usage

/drupal-index

To force a full rebuild (after a large refactor, or if results look stale), ask for it explicitly: "re-index with --force".

What it does

  1. Checks that npx is available and that a Drupal project exists at /workspace/drupal
  2. Runs npx -y gitnexus@latest analyze /workspace/drupal. The first run can take several minutes and the progress streams into the chat
  3. Adds a gitnexus entry to /workspace/.pi/mcp.json, merging with whatever is already configured (it never overwrites the file blindly)
  4. Reminds you to activate the server

Activating the MCP server

Send /restart in the chat to load the new MCP server. If the tools are not available yet, the agent falls back to the GitNexus command line, which works the same way.

Scope

The skill only ever indexes /workspace/drupal. It never indexes /workspace as a whole, /config or any other path.

When to use

  • You are exploring an unfamiliar codebase and want an overview of relationships between classes and services
  • Before a refactor, to see what depends on the code you are about to change
  • After large changes, to refresh the index

Related

Clone this wiki locally