Get the FREE Ultimate OpenClaw Setup Guide →

mcp -drupal

TS based companion MCP server for the Drupal MCP module that works with the STDIO transport.

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio omedia-mcp-server-drupal bun run dev \
  --env DRUPAL_BASE_URL=""

How to use

This MCP server provides a Drupal-based Model Context Protocol server. On startup, it initializes by loading the resources, tools, and prompts defined by the Drupal API, making them available to clients via the MCP protocol over stdio. You can interact with the server to explore the Drupal-defined resources, invoke tools, and follow prompts that are auto-generated during initialization. The server is designed to work within Claude-style workflows, enabling you to plug Drupal data and capabilities into your MPC-driven automation.

To use it, start the server in development mode (bun run dev). Once running, you can access the MCP endpoints through your client or workflow runner, issuing requests to retrieve Drupal resources, execute Drupal-provided tools, or present prompts for context-aware guidance. The available resources will mirror the Drupal API definitions detected at initialization, and tools will be those exposed by Drupal during the same phase. When debugging, you can leverage the MCP Inspector to inspect the communication between your client and the server and to surface debugging information via a browser-based UI.

How to install

Prerequisites

  • Node.js-compatible runtime (bun is used in this project; ensure Bun is installed: https://bun.sh)
  • Access to a Drupal instance if you intend to point the server at a live API (base URL).
  • A development environment capable of running Bun and your preferred editor.
  1. Install dependencies
bun install
  1. Build the server
bun run build
  1. Run in development mode (with auto-rebuild on changes)
bun run dev
  1. (Optional) Debug with MCP Inspector
bun run inspector
  1. Configure MCP server in Claude (example config)
  • Use the provided template and replace placeholders. For Drupal, you typically provide the Drupal base URL and any needed environment variables.
{
  "mcpServers": {
    "mcp-server-drupal": {
      "command": "__BINARY_PATH__",
      "args": ["--drupalBaseUrl", "__DRUPAL_BASE_URL__"],
      "env": {
        "DRUPAL_BASE_URL": "__DRUPAL_BASE_URL__"
      }
    }
  }
}

Notes:

  • The server communicates over stdio, so any integration should capture stdout/stderr accordingly.
  • Adjust the DRUPAL_BASE_URL to point to your Drupal instance if needed.

Additional notes

Environment variables to consider:

  • DRUPAL_BASE_URL: The base URL for your Drupal API (e.g., https://example.com/drupal). This may be required for the initialization phase where Drupal resources/tools/prompts are discovered.
  • Any other Drupal-auth related variables if your instance requires authentication.

Common issues:

  • If the server fails to initialize resources/tools/prompts, verify that the Drupal API is reachable from where the MCP server runs and that the base URL is correct.
  • When debugging, the MCP Inspector can help trace the flow of requests and responses and surface initialization details.

Configuration tips:

  • Keep the dev config separate from production; ensure production uses a built/packaged binary as appropriate for your deployment.
  • Ensure the environment contains any secrets or tokens required by Drupal APIs in a secure manner.

Related MCP Servers

Sponsor this space

Reach thousands of developers