Drupal is a registered trademark of Dries Buytaert
Protected Pages 3.0.0 Major update available for module protected_pages (3.0.0). Commerce Core 3.3.8 Minor update available for module commerce (3.3.8). Search API HTML Element Filter 1.0.7 Minor update available for module search_api_html_element_filter (1.0.7). Layout Builder Reorder 2.0.1 Minor update available for module layout_builder_reorder (2.0.1). Ban 1.1.0 Minor update available for module ban (1.1.0). Field Formatter Range 2.0.0 Major update available for module field_formatter_range (2.0.0). Field Formatter Range 8.x-1.8 Minor update available for module field_formatter_range (8.x-1.8). UI Patterns (SDC in Drupal UI) 2.0.18 Minor update available for module ui_patterns (2.0.18). Search API Solr 4.3.11 Module search_api_solr updated after 14 months of inactivity (4.3.11). Provus Mega Menu Module provus_mega_menu crossed 1,000 active installs.

This module exposes Drupal capabilities to AI systems through a configuration-driven approach. It allows any Tool API plugin to become an AI tool and supports both STDIO (for command-line) and HTTP transports, secured by OAuth 2.1 authentication.

Built by a human using an AI assistant: 🤖 ➕ 🧠

A lot of the code in this module has been created using an AI assistant using Strikethroo & Kenkeep for improved Drupal code generation.

Overview

MCP Server supports both a configuration-driven, and a static approach to exposing Drupal capabilities to AI systems.

This module supports both the STDIO transport, as well as the HTTP transport.

Key Capabilities

No-code MCP tools

Any Tool API plugin becomes an MCP tool through configuration.

OAuth 2.1 authentication

Secure API access using the latest OAuth 2.1 protocol via Simple OAuth 2.1.

Dual transport

STDIO for CLI integration, HTTP for web-based clients.

  • Admin UI - Full CRUD interface for managing tool configurations at /admin/config/services/mcp-server/tools
  • Dynamic discovery - Tools are discovered from configuration entities, not hardcoded attributes

FULL protocol support

Thanks to the Official PHP MCP SDK, this module provides full support of the MCP protocol.

Support for MCP resources Support for saved prompts Support for LLM sampling Support for authentication

Architecture

This module provides an integrated, configuration-driven architecture, using:

  • Official SDK integration - Built on modelcontextprotocol/php-sdk, a collaboration between the PHP Foundation and Symfony project
  • Tool API foundation - Leverages Tool API for plugin discovery and execution
  • Configuration entities - MCP tools are managed through Drupal's configuration system, not PHP attributes
  • Modern authentication - OAuth 2.1 protocol implementation for secure API access

OAuth 2.1 Integration

MCP Server implements granular authentication controls using Simple OAuth 2.1, providing secure, token-based API access. Each tool configuration supports two authentication modes:

  • Required - OAuth2 Bearer token with specified scopes is mandatory (HTTP 401 without auth, HTTP 403 with insufficient scopes)
  • Disabled - No authentication checks (use only for public, read-only tools)

This implementation uses the Simple OAuth 2.1 module, which provides full OAuth 2.1 protocol support in Drupal. The OAuth integration enables:

  • Per-tool scope requirements
  • Token-based authentication for HTTP transport
  • Graceful handling of anonymous protocol requests (e.g., initialize)
  • Integration with Drupal's authentication system

Note: The author of MCP Server also authored and maintains Simple OAuth and Simple OAuth 2.1, ensuring deep integration between these systems.

Quick Start

STDIO Transport (Command-line)

Configure your AI assistant to use the Drush command.


Example for Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "drupal": {
      "command": "vendor/bin/drush",
      "args": ["mcp:server"],
      "cwd": "/path/to/your/drupal/site"
    }
  }
}

Test using Claude Desktop, or the MCP Inspector:

npx @modelcontextprotocol/inspector vendor/bin/drush mcp:server

HTTP Transport (Web-based)

The HTTP endpoint is available at https://your-drupal-site.com/_mcp.


Configure your MCP client:

{
  "mcpServers": {
    "drupal-http": {
      "url": "https://your-drupal-site.com/_mcp",
      "transport": "http"
    }
  }
}

Test using Claude Code:

claude mcp add drupal-mcp http://your-drupal-site.com/_mcp --transport http --scope project

Creating MCP Tools

MCP Server selects Tool plugins, in order to create MCP tools.

Workflow

  1. Create a Tool API plugin in your custom module (see Tool API documentation, or install tools from the Tool Belt module.
  2. Navigate to /admin/config/services/mcp-server/tools
  3. Add an MCP Tool Configuration:
    • Enter the MCP tool name and machine name
    • Select Tool API tool ID (autocomplete)
    • Configure authentication mode and OAuth scopes
  4. The tool is now available to AI assistants via MCP protocol

Screenshots

MCP Tool Configuration List

The admin interface at /admin/config/services/mcp-server/tools provides a complete overview of configured MCP tools, including status, Tool API source, and authentication settings.

Tool Configuration Form

Configuration form with Tool API autocomplete, authentication mode selection, and OAuth scope configuration.

MCP Inspector Integration

Testing MCP tools using the official MCP Inspector (npx @modelcontextprotocol/inspector).

Requirements

Related Projects

Resources

Contributing

Submit issues and patches through the issue queue. Contributions are welcome.

Credits

This module integrates the official MCP PHP SDK, a collaboration between the PHP Foundation and the Symfony project. Architectural inspiration from the Symfony MCP Bundle.

Activity

Total releases
3
First release
Nov 2025
Latest release
1 month ago
Releases (12 mo)
3 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Release date
2.0.0-alpha1 Pre-release Jun 11, 2026
2.x-dev Dev Apr 19, 2026
1.x-dev Dev Nov 15, 2025