Claude Agent SDK Brings Claude Code Runtime to Drupal via Experimental Module
Drupal contributor and AI lead James Abrahams has released an early-stage experimental module that brings Claude Code’s agent runtime directly into Drupal. The project, published on Drupal.org as AI Claude Agent SDK, uses a new PHP-based implementation of the Claude Agent SDK that mirrors the original Python version.
The module allows Drupal sites to run Claude Code as an agent runtime, enabling capabilities such as file operations, chat-based tool execution, and real-time streaming responses. In an early demo shared by Jamie on LinkedIn, the agent was able to list and inspect files within a Drupal installation, highlighting both the technical potential and the security risks of the current approach.
Jamie has repeatedly emphasised that the module is highly experimental and currently exposes unrestricted file access. The project page includes a warning that it is not covered by Drupal’s security advisory policy and should be treated as insecure. Planned improvements include restricting the agent to operate on a limited folder of Markdown files and introducing integration through Model Context Protocol (MCP) for safer interactions.
The SDK provides an API bridge for Claude Code’s agent features, including tool use, file operations, streaming output, interrupt controls, and permission mode handling. It also supports integration with Drupal AI ecosystem modules such as ai_agents and DeepChat, allowing developers to experiment with conversational agents and automated workflows inside Drupal.
The module requires the Claude Code CLI to be installed on the server, along with valid Anthropic API credentials provided through the ANTHROPIC_API_KEY environment variable. Additional dependencies include the PHP-based Claude Agent SDK and Symfony Process for executing CLI commands.
Development is being led by James Abrahams, with technical collaboration from Roland Obermair and organisational support from FreelyGive Ltd and Roromedia GmbH. Obermair has been actively involved in shaping the SDK architecture and exploring MCP-based security models.
Unlike existing Drupal AI provider modules, which primarily connect to hosted LLM APIs, the Claude Agent SDK exposes the full Claude Code agent runtime, including local tool chains and file-level interactions. This positions the project as an experimental research effort into deeper agentic integration rather than a production-ready AI feature.
In a follow-up discussion on LinkedIn, Abrahams clarified that the project is exploring two main architectural directions: using Model Context Protocol (MCP) so that Claude Code can read from and write directly to Drupal content, and an alternative approach where Drupal content is cloned into Markdown files for automation via the standard Claude Code workflow before being synchronised back into Drupal.
He also warned developers against attempting to connect the module to personal Claude subscription accounts, noting that this violates platform policy and could result in account bans. Both James Abrahams and collaborator Roland Obermair have emphasised that sandboxing and permission isolation remain unresolved, and that the current implementation remains 'crazy dangerous' from a security perspective.


