This module allows Drupal to connect to Model Context Protocol (MCP) servers, enabling AI modules to access external tools and data. It supports both HTTP and local process connections and integrates with other Drupal AI modules for seamless tool usage.
Note that extensive parts of this module was generating via AI coding agents under human supervision.
INTRODUCTION
The MCP Client module enables Drupal to connect to Model Context Protocol (MCP) servers and expose their tools to AI modules. MCP is a standardized protocol for communication between AI applications and external tools/data sources.
This module integrates with the Drupal AI module or ECA to provide seamless access to MCP server capabilities, allowing AI agents to use external tools like file systems, databases, APIs, and more.
REQUIREMENTS
This module requires the following:
- Drupal core 10.3+ or 11+
- Tool module (https://www.drupal.org/project/tool)
- Key module (https://www.drupal.org/project/key) 1.18 or higher
- MCP SDK MCP Client library (modelcontextprotocol/php-sdk automatically installed via Composer)
INSTALLATION
Install as you would normally install a contributed Drupal module. For further information, see: https://www.drupal.org/docs/extending-drupal/installing-drupal-modules
composer require drupal/mcp_client
drush en mcp_client -y
CONFIGURATION
HTTP Transport (Remote MCP Server)
Use this transport type for MCP servers accessible via HTTP/HTTPS.
- Navigate to Administration > Configuration > AI > MCP Servers (
/admin/structure/mcp-server) - Click "Add MCP Server"
- Fill in the following fields:
- Label: A descriptive name (e.g., "GitHub MCP Server")
- Transport Type: Select "HTTP (Streamable HTTP)"
- Endpoint URL: Your MCP server URL (e.g.,
https://example.com/mcp) - Timeout: Connection timeout in seconds (default: 30)
- Click "Save"
- Edit the server configuration to enable specific tools
- Enabled tools are now available in the AI API Explorer
STDIO Transport (Local Process)
Use this transport type for running MCP servers as local processes (Node.js, Python, etc.).
- Navigate to Administration > Configuration > AI > MCP Servers
- Click "Add MCP Server"
- Fill in the following fields:
- Label: A descriptive name
- Transport Type: Select "STDIO (Process)"
- Command: Full command to execute (e.g.,
node /path/to/server.js) - Working Directory: Optional working directory for the process
- Environment Variables: Add environment variables as name-value pairs
- For sensitive values (API keys, tokens), use Key module references
- For non-sensitive values, use plain text
- Click "Save"
- Edit the server configuration to enable specific tools
Environment Variables with Key Module
For secure handling of API keys and other sensitive data:
- Install and enable the Key module (automatically required by this module)
- Create keys at Administration > Configuration > System > Keys
- When configuring environment variables in MCP Server settings:
- Name: The environment variable name (e.g., API_KEY)
- Type: Select "Key"
- Key: Choose the key you created
- For non-sensitive variables, select "Plain text" and enter the value directly
FEATURES
- Multiple Transport Types: Supports both HTTP and STDIO (local process) connections
- No Middleware Required: Direct connection to MCP servers for HTTP transport
- AI Module Integration: Seamlessly integrates with Drupal AI module's function calling system
- Tool Management: Easy-to-use UI for enabling/disabling specific tools per server
- Multiple Servers: Connect to multiple MCP servers simultaneously
- Secure Credential Management: Integration with Key module for secure storage of API keys and sensitive environment variables
- Dynamic Plugin System: Tools from MCP servers are automatically discovered and exposed as AI function call plugins
DOCUMENTATION
For more details, look at the ๐ Complete Documentation.
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
Release Timeline
Releases
| Version | Type | Core | Notes | Release date | |
|---|---|---|---|---|---|
| 1.0.0-alpha3 | Pre-release | 10โ11 | Bump mcp/sdk to ^0.7.1 for CVE-2026-53965 | Aug 22, 2026 | |
| 1.0.0-alpha2 | Pre-release | 10โ11 | Switched to the official MCP PHP SDK | Jul 20, 2026 | |
| 1.0.0-alpha1 | Pre-release | 10โ11 | First testable release. | Dec 16, 2025 | |
| 1.0.x-dev | Dev | 10โ11 | Apr 9, 2025 |