Connect Drupal to Model Context Protocol
TypeScript STDIO companion server for Drupal's MCP module - dynamically exposes Drupal-defined resources and tools, auth via token or basic auth.
1.0.0Add to Favorites
Why it matters
Integrate Drupal content and functionality with the Model Context Protocol (MCP). This asset allows AI models to access Drupal resources, tools, and prompts, enabling sophisticated content generation and data interaction.
Outcomes
What it gets done
Expose Drupal resources, tools, and prompts via the MCP.
Enable AI models to query and utilize Drupal data.
Facilitate dynamic content generation powered by Drupal.
Bridge the gap between Drupal's CMS capabilities and AI applications.
Source
Get it from source
Spark does not host a copy of it.
Open sourceReports
Agent outcome reports
No reports yet
Overview
Drupal MCP Server
A TypeScript STDIO companion server for the Drupal MCP module, dynamically exposing whatever resources and tools a connected Drupal site defines through its own API, rather than a fixed tool set, authenticated by token or basic auth. Use it to connect an MCP client to a Drupal site over STDIO transport when the site runs the Drupal MCP module. SSE transport does not need this companion server at all.
What it does
A TypeScript-based STDIO companion server for the separate Drupal MCP module, which runs inside a Drupal site. This binary is the bridge that lets an MCP client talk to that module over STDIO transport; all of the actual MCP instruments, resources and tools, are defined by the Drupal API itself during initialization rather than hardcoded in this server, so what's available depends entirely on the connected Drupal site's configuration and module setup. If a Drupal site is set up for SSE transport instead, this companion server is not needed at all.
When to use - and when NOT to
Use it when an MCP client needs STDIO access to a Drupal site running the Drupal MCP module - the server itself is a thin transport bridge, so its actual capabilities are whatever that Drupal site's MCP module exposes, currently resources, templates and reads, and tools, calls, with no prompts exposed yet. It requires the Drupal MCP module to be installed and configured on the target site, with authentication explicitly enabled in that module's settings page - without that, the STDIO server has nothing valid to connect to. Authentication supports either a single auth token or a username and password pair; if both are configured, the token takes precedence.
Capabilities
The server dynamically discovers and exposes whatever the connected Drupal site's MCP module defines at initialization: resources (templates and reads) and tools (calls). No prompts are exposed by the server at this time. Distribution is via a Docker container, a compiled binary for multiple platforms, or a JSR package, and released binaries and container images are signed with cosign for identity-based verification against the project's GitHub release workflow.
How to install
Via Docker:
{
"mcpServers": {
"mcp-server-drupal": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/omedia/mcp-server-drupal",
"--drupal-url=__DRUPAL_BASE_URL_"
],
"env": {}
}
}
}
Set DRUPAL_AUTH_TOKEN, or both DRUPAL_AUTH_USER and DRUPAL_AUTH_PASSWORD, as environment variables to authenticate, after enabling authentication in the Drupal MCP module's settings.
Who it's for
Drupal site administrators and developers who want an MCP client to reach a Drupal site's own MCP-exposed resources and tools over STDIO transport, with the actual capabilities defined and controlled entirely on the Drupal side. The project is built with Deno 2.0.0+, and its own MCP Inspector task (deno task inspector --drupal-url) helps debug the STDIO connection during development, since stdio-based servers are otherwise hard to inspect directly.
Source README
MCP Server for Drupal
This is a typescript based companion Model Context Protocol(MCP) server for the Drupal MCP module that works with the STDIO transport. In order to use SSE transport this server is not required.
Installation
The STDIO Binary is available through multiple distribution channels to accommodate various environments:
Here is a quick example of how to use the server with docker:
{
"mcpServers": {
"mcp-server-drupal": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"ghcr.io/omedia/mcp-server-drupal",
"--drupal-url=__DRUPAL_BASE_URL_"
],
"env": {}
}
}
}
📖 For more details check the Installation section in the docs
Authentication
The server supports both authentication via environment variables. You can use either a auth token or a basic auth with username and password combination . The following environment variables are supported:
DRUPAL_AUTH_TOKEN: The authentication token.DRUPAL_AUTH_USER: The username for authentication.DRUPAL_AUTH_PASSWORD: The password for authentication.
📖 Check the Authentication section in the docs for more details
MCP
- All instruments are defined by the Drupal API during the initialization phase
Development
This project is built with Deno.
Install dependencies:
deno install
For development with auto-rebuild:
bun task dev
Build the server:
deno task build --output build/mcp-server-drupal
Debugging
Since MCP servers communicate over stdio, debugging can be challenging. We
recommend using the
MCP Inspector, which is
available as a deno task:
deno task inspector --drupal-url [DRUPAL_BASE_URL]
Verifying the binaries and images
drupal_mcp_server binaries and container images are signed by cosign using identity-based signing.
You can verify your binary by downloading the signatures.tar.gz file from the release page, extracting the signature and running the following command:
cosign verify-blob ${YOUR_BINARY_NAME} \
--bundle signatures/${YOUR_BINARY_NAME}.bundle \
--certificate-oidc-issuer https://token.actions.githubusercontent.com \
--certificate-identity-regexp https://github.com/Omedia/mcp-server-drupal/.github/workflows/release.yml@refs/tags/v \
--certificate-github-workflow-repository Omedia/mcp-server-drupal
On the container side you can verify the image by running the following command:
cosign verify ghcr.io/omedia/mcp-server-drupal:latest \
--certificate-oidc-issuer "https://token.actions.githubusercontent.com" \
--certificate-identity-regexp "https://github.com/Omedia/mcp-server-drupal/.github/workflows/release.yml@refs/tags/v"
FAQ
Common questions
Discussion
Questions & comments · 0
Sign In Sign in to leave a comment.