Drupal MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
npm init -y
npm install @modelcontextprotocol/sdk axios
npm install -D typescript @types/node
2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add -e "DRUPAL_BASE_URL=${DRUPAL_BASE_URL}" drupal-mcp-server -- node "<FULL_PATH_TO_DRUPAL_MCP_SERVER>/dist/index.js"

Replace <FULL_PATH_TO_DRUPAL_MCP_SERVER>/dist/index.js with the actual folder you prepared in step 1.

Required:DRUPAL_BASE_URL+ 3 optional
README.md

Enables AI models to interact with Drupal 10+ sites via JSON:API

Drupal MCP Server

A Model Context Protocol (MCP) server that enables Claude to interact with Drupal 10+ sites via JSON:API. This server allows Claude to query, search, and retrieve content from your Drupal installation.

Features

  • Query Content: Search and filter nodes by content type with flexible options
  • Get Node Details: Retrieve complete node information including relationships
  • List Content Types: Discover all available content types on your site
  • Search Across Types: Search for content across all content types by title

Prerequisites

  • Node.js 18+ and npm
  • TypeScript 5+
  • A Drupal 10+ site with JSON:API enabled (enabled by default)
  • Valid Drupal credentials (username/password or OAuth token)

Installation

# Clone or create the project directory
mkdir drupal-mcp-server
cd drupal-mcp-server

# Initialize and install dependencies
npm init -y
npm install @modelcontextprotocol/sdk axios
npm install -D typescript @types/node

Project Structure

drupal-mcp-server/
├── src/
│   ├── index.ts          # Main MCP server
│   ├── drupal-client.ts  # Drupal API client
│   └── types.ts          # TypeScript type definitions
├── dist/                 # Compiled JavaScript (generated)
├── package.json
└── tsconfig.json

Building

# Compile TypeScript
npm run build

# Watch mode (optional)
npm run watch

The compiled JavaScript files will be output to the dist/ directory.

Configuration

For Claude Desktop

Edit your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
Linux: ~/.config/Claude/claude_desktop_config.json

Add the following configuration:

{
  "mcpServers": {
    "drupal": {
      "command": "node",
      "args": ["/absolute/path/to/drupal-mcp-server/dist/index.js"],
      "env": {
        "DRUPAL_BASE_URL": "https://your-drupal-site.com",
        "DRUPAL_USERNAME": "your-username",
        "DRUPAL_PASSWORD": "your-password"
      }
    }
  }
}

Note: Replace /absolute/path/to/drupal-mcp-server with the actual path on your system. Use pwd in the project directory to get the full path.

For Cline (VS Code)

Add to your VS Code settings.json:

{
  "cline.mcpServers": {
    "drupal": {
      "command": "node",
      "args": ["/absolute/path/to/drupal-mcp-server/dist/index.js"],
      "env": {
        "DRUPAL_BASE_URL": "https://your-drupal-site.com",
        "DRUPAL_USERNAME": "your-username",
        "DRUPAL_PASSWORD": "your-password"
      }
    }
  }
}

Environment Variables

  • DRUPAL_BASE_URL (required): Your Drupal site URL
  • DRUPAL_USERNAME (optional): Basic auth username
  • DRUPAL_PASSWORD (optional): Basic auth password
  • DRUPAL_ACCESS_TOKEN (optional): OAuth access token (alternative to username/password)

Testing

Manual Server Test

Test the server directly from the command line:

cd /path/to/drupal-mcp-server

DRUPAL_BASE_URL="https://your-site.com" \
DRUPAL_USERNAME="admin" \
DRUPAL_PASSWORD="password" \
node dist/index.js

You should see:

Drupal MCP Server running
Connected to: https://your-site.com

Press Ctrl+C to stop.

Test Connection to Drupal

Verify your Drupal site is accessible:

curl -I https://your-site.com/jsonapi

Should return a 200 OK status.

Testing in Claude Desktop

  1. Restart Claude Desktop after updating the configuration
  2. Look for the 🔌 icon at the bottom of the interface
  3. Click it to see connected MCP servers
  4. Start a new conversation and try:
What tools do you have available?

Example Queries

List content types:

List all available content types on my Drupal site

Query content:

Show me 5 published articles

Search content:

Search for content with "tutorial" in the title

Get node details:

Get the full details of node [UUID]

Complex query:

1. List all content types
2. Find 3 articles
3. Show me the complete details of the first article

Available Tools

`query_content`

Search and filter Drupal content by type.

Parameters:

  • contentType (required): Machine name of the content type (e.g., "article", "page")
  • limit (optional): Maximum results to return (default: 10)
  • title (optional): Filter by title (partial match)
  • status (optional): Filter by publication status (true/false)

`get_node`

Retrieve complete details of a specific node.

Parameters:

  • nodeId (required): UUID or numeric ID of the node
  • include (optional): Array of related entities to include (e.g., ["field_image", "uid"])

`list_content_types`

List all available content types on the site.

Parameters: None

`search_content`

Search across all content types by title.

Parameters:

  • searchTerm (required): Text to search for in titles
  • limit (optional): Maximum results (d

Tools (4)

query_contentSearch and filter Drupal content by type.
get_nodeRetrieve complete details of a specific node.
list_content_typesList all available content types on the site.
search_contentSearch across all content types by title.

Environment Variables

DRUPAL_BASE_URLrequiredYour Drupal site URL
DRUPAL_USERNAMEBasic auth username
DRUPAL_PASSWORDBasic auth password
DRUPAL_ACCESS_TOKENOAuth access token

Configuration

claude_desktop_config.json
{"mcpServers": {"drupal": {"command": "node", "args": ["/absolute/path/to/drupal-mcp-server/dist/index.js"], "env": {"DRUPAL_BASE_URL": "https://your-drupal-site.com", "DRUPAL_USERNAME": "your-username", "DRUPAL_PASSWORD": "your-password"}}}}

Try it

List all available content types on my Drupal site
Show me 5 published articles
Search for content with "tutorial" in the title
Get the full details of node [UUID]

Frequently Asked Questions

What are the key features of Drupal MCP Server?

Query and filter nodes by content type. Retrieve complete node information including relationships. Discover all available content types on a Drupal site. Search for content across all content types by title.

What can I use Drupal MCP Server for?

Quickly retrieving specific node data for content auditing. Automating content discovery and research across a Drupal site. Assisting developers in debugging content structure and relationships. Generating summaries of published articles based on specific search criteria.

How do I install Drupal MCP Server?

Install Drupal MCP Server by running: npm init -y && npm install @modelcontextprotocol/sdk axios && npm install -D typescript @types/node

What MCP clients work with Drupal MCP Server?

Drupal MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Drupal MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare