Drupal MCP Server
Provides tools to interact with Drupal 10+ sites via the JSON:API, allowing for content querying, searching across all content types, and retrieving detailed node information including relationships.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Drupal MCP Server search for content with 'tutorial' in the title"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: Axolot MCP Server
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/nodeProject 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.jsonBuilding
# Compile TypeScript
npm run build
# Watch mode (optional)
npm run watchThe 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 URLDRUPAL_USERNAME(optional): Basic auth usernameDRUPAL_PASSWORD(optional): Basic auth passwordDRUPAL_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.jsYou should see:
Drupal MCP Server running
Connected to: https://your-site.comPress Ctrl+C to stop.
Test Connection to Drupal
Verify your Drupal site is accessible:
curl -I https://your-site.com/jsonapiShould return a 200 OK status.
Testing in Claude Desktop
Restart Claude Desktop after updating the configuration
Look for the 🔌 icon at the bottom of the interface
Click it to see connected MCP servers
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 siteQuery content:
Show me 5 published articlesSearch content:
Search for content with "tutorial" in the titleGet 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 articleAvailable 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 nodeinclude(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 titleslimit(optional): Maximum results (default: 10)
Troubleshooting
"Server disconnected" error
Check that the server starts manually
Verify the path in the configuration is absolute
Check Claude Desktop logs:
# macOS tail -f ~/Library/Logs/Claude/mcp*.log
SSL Certificate errors (DDEV/local development)
If using self-signed certificates, the server automatically disables certificate verification for local development.
Permission errors
Ensure your Drupal user has permission to access JSON:API endpoints. The "View published content" permission is usually sufficient for read operations.
JSON:API not enabled
JSON:API is enabled by default in Drupal 10+. If you get 404 errors, verify it's enabled at:
/admin/modules → Search for "JSON:API"
Development
Adding new tools
Define the tool schema in
TOOLSarray insrc/index.tsImplement the handler in the
CallToolRequestSchemaswitch statementAdd any new methods to
DrupalClientclass as neededRebuild:
npm run build
Extending functionality
Potential enhancements:
Create/update content (POST/PATCH requests)
Manage taxonomy terms
Query users
Execute Views
Upload media/files
Manage menus
License
MIT
Contributing
Contributions are welcome! Please feel free to submit issues or pull requests.
Available Tools
4 toolsget_nodeB
Retrieve complete details of a specific Drupal node by its ID
Inputs: nodeType (required), nodeId (required), include.
list_content_typesB
List all available content types on the Drupal site
Inputs: no named parameters.
query_contentB
Search and filter Drupal content by type. Returns a list of nodes matching the criteria.
Inputs: contentType (required), limit, title, status.
search_contentA
Search across all content types by title. Useful when you don't know the specific content type.
Inputs: searchTerm (required), limit.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
There is some overlap between query_content and search_content, as both involve searching for content, though their descriptions clarify that query_content filters by type while search_content searches by title across all types. get_node and list_content_types are distinct, but the two search tools could cause confusion without careful reading of descriptions.
Tool names follow a consistent verb_noun pattern (get_node, list_content_types, query_content, search_content), with clear and readable conventions. There are no deviations in style, making them predictable and easy to understand.
With only 4 tools, the set feels thin for a Drupal content management server, lacking essential CRUD operations like create, update, or delete nodes. While the tools cover basic retrieval and listing, the scope seems incomplete for typical content management workflows.
The tool surface is significantly incomplete for a Drupal content management domain. It includes retrieval and search functions but lacks any create, update, or delete operations, which are core to content lifecycle management. This gap will likely cause agent failures when trying to perform full content management tasks.
Related MCP Connectors
Read and write Drupal JSON:API nodes, taxonomy terms, users and files.
Web search and page reading for AI agents, including JSON APIs, RSS feeds and YouTube.
Find, write, publish and check pages and API references in your DeveloperHub docs from an AI client
AI-operated knowledge-graph CMS for business websites: entities, pages, blocks, media, domains.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact directly with Strapi v5 CMS content through full CRUD operations, media uploads, and content type exploration using Strapi's Document Service API.858 npm1MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to interact with Axolot CMS for content, design tokens, media, and module management with site context awareness.16 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI clients to read and query content from a Progress Sitefinity CMS instance via its OData API. Tools are dynamically generated from the live service metadata, supporting filtering, searching, and navigation across content types.MIT
- AlicenseNot gradedqualityCmaintenanceEnables AI models to manage a Drupal-shaped content store over MCP, including nodes, vocabularies, terms, tag filtering, and trigram/semantic search, while logging every tool call for observability.MIT