Powering Drupal Insights: A Distributed AI POC with Qwen2.5 & MCP

At Gluebox, we are evolving how we interact with our operational knowledge. This post outlines our Proof of Concept (POC) for a distributed AI architecture designed to give select administrators the power to query Drupal CMS data using natural language.

Architecture Diagram

By leveraging the Model Context Protocol (MCP) and local LLMs, we are moving away from manual SQL exports and toward an intelligent, conversational interface.


🏗️ The Architecture

Our setup distributes the workload across three environments to ensure the "Brain" (LLM), the "Interface" (WebUI), and the "Data" (Drupal) remain decoupled and scalable.

1. The Interface: Open WebUI (Workstation A)

  • Role: The user-facing chat portal.
  • Deployment: Docker container.
  • Function: Handles user authentication and provides a ChatGPT-like experience for our admins. It connects via the network to our remote inference engine.

2. The Brain: Qwen2.5-Coder-32B (Workstation B / Mac)

  • Role: The reasoning engine.
  • Deployment: Ollama (Local macOS).
  • Why Qwen? We are using the 32B-Instruct-abliterated version. Its coding proficiency allows it to understand complex Drupal schemas and generate precise SQL without the "guardrail refusals" common in smaller models.

3. The Hands: MariaDB MCP Server (Linux Drupal Server)

  • Role: The secure bridge to our data.
  • Deployment: Python/uv-based MCP server.
  • Function: It "exposes" our Drupal SQL tables to the LLM. When an admin asks a question, the LLM uses this protocol to query the database in real-time.

🛠️ Technical Stack at a Glance

Component Technology Location
LLM Runner Ollama Workstation B (Mac)
Model Qwen2.5-Coder-32B-Abliterated Local GGUF
Orchestration Docker Workstation A
UI Open WebUI Port 3000
Protocol Model Context Protocol (MCP) Linux Server
Database MariaDB Drupal 11 Environment

🚀 The Use Case: "Ask Your Database"

Instead of writing a custom Views report or a manual SQL query, an admin can simply type:

"Show me a list of all users who haven't logged in for 6 months but have the 'Editor' role."

The LLM interprets the intent, writes the SQL join for the users_field_data and user__roles tables, executes it through the MCP bridge, and presents the formatted results in seconds.

🔒 Safety & Security

Because we are utilizing a local LLM:

  • Data Privacy: No Drupal data ever leaves our local network.
  • Read-Only Access: The MCP server connects to MariaDB via a dedicated user with SELECT permissions only—ensuring the AI can't accidentally DROP or UPDATE tables.
  • Abliterated Intelligence: Using an abliterated model ensures the AI follows technical instructions precisely without getting stuck in safety loops during complex debugging.

📈 Next Steps: Scaling to NVIDIA Spark

This POC is our "Working Model." Once we have validated the utility of these AI-driven queries, we intend to migrate the inference workload from our local workstations to a high-end NVIDIA Spark cluster. This will allow for multi-user concurrency and even faster response times for larger datasets.