Skip to main content
Drupal is a registered trademark of Dries Buytaert
Release: OpenID Connect / OAuth client 3.0.0-alpha9 New alpha version released for module openid_connect (3.0.0-alpha9). Usage Milestone: Google Analytics Module google_analytics crossed 1,000 active installs. Release: Timelinr 1.0.1 Minor update available for module timelinr (1.0.1). Release: GraphQL Compose Codegen 1.1.2 Minor update available for module graphql_compose_codegen (1.1.2). Release: Mapy.com 1.1.3 Minor update available for module mapycom (1.1.3). Release: Ckeditor5 entity browser 3.0.3 Minor update available for module ckeditor5_entity_browser (3.0.3). Release: Ckeditor5 entity browser 3.0.1 Minor update available for module ckeditor5_entity_browser (3.0.1). Release: Ckeditor5 entity browser 3.0.2 Minor update available for module ckeditor5_entity_browser (3.0.2). Release: Teamleader Integration 4.0.2 Minor update available for module teamleader (4.0.2). Module Revived: Entityqueue Buttons 1.1.2 Module entityqueue_buttons updated after 8 months of inactivity (1.1.2).

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).

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.

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
4
Tracked since
Nov 2025
Latest release
1 month ago
Releases (12 mo)
4 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core Release date
2.0.0-beta1 Pre-release 10โ€“11 Jul 29, 2026
2.0.0-alpha1 Pre-release 10โ€“11 Jun 11, 2026
2.x-dev Dev 10โ€“11 Apr 19, 2026
1.x-dev Dev 10โ€“11 Nov 15, 2025