Part of the MCP ecosystem · 11 projects
MCP Server Key Auth adds per-user API key authentication to the MCP Server HTTP endpoint using Key Auth. AI assistants and automation clients send a user's API key in a request header and operate with that user's Drupal permissions.
Use this module with MCP clients that support manually configured HTTP headers, when you want a simple API key connection without setting up an OAuth authorization server.
Features
- Reuses Key Auth for user API key generation, rotation and revocation.
- Requires header credentials on every MCP request, including requests carrying a session ID. Supports custom header names.
- Rejects query-string keys, cookie-only logins and session-ID-only requests at the MCP endpoint, without changing global Key Auth settings.
- Retains MCP Server endpoint permissions and tool-specific access checks.
- Isolates MCP session storage by the acting Drupal user.
- Returns JSON-RPC authentication errors with HTTP 401/403 status codes.
- Works without Tool Bridge, Tool API or an AI provider dependency.
Post-installation
- Enable this module and its dependencies.
- At
/admin/config/services/key-auth, enable Header detection. The default header name isapi-key. - Grant the intended account Access MCP server and Use key authentication, plus the permissions needed by its tools.
- Generate a user key at
/user/{uid}/key-auth. Grant the own-key management permissions if users should manage their keys. - Configure the MCP client with
https://example.com/mcpand anapi-keyheader. Send the header on every request and use HTTPS remotely.
Requirements
- Drupal 11 and PHP 8.3 or later within PHP 8.x.
- MCP Server 2.x, version 2.0.0-beta6 or later.
- Key Auth 2.2.4 or later in the 2.x series.
Related projects and authentication policy
MCP Server OAuth provides OAuth authentication and tool scope checks. Choose it when clients require an OAuth login/discovery flow. While MCP Server Key Auth is enabled, the MCP HTTP endpoint is key-only; cookie and OAuth authentication do not authorize that endpoint. Other routes and STDIO authentication are unchanged.
Enabling or uninstalling this module changes session storage IDs. Reconnect clients to initialize fresh sessions. See the repository README for installation, configuration, session behavior and testing instructions.
Ask your assistant about MCP Server Key Auth
Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works
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.
More in the MCP ecosystem
Most installed first
Activity
Releases
| Version | Type | Core | PHP | Release date | |
|---|---|---|---|---|---|
| 1.0.0-alpha1 | Pre-release | 11 | PHP ^8.3 | Oct 20, 2026 | |
| 1.0.x-dev | Dev | 11 | PHP ^8.3 | Oct 20, 2026 |