Bring Your Own AI: Connecting Claude to Drupal Over MCP

Want AI to help run your website? Pick a platform with an assistant built in. One button, one subscription, and it writes your pages for you. Why wire anything up yourself?

Because the assistant you rent from your platform works only on that platform, with that vendor's model, on that vendor's terms. When something better comes along, and something better comes along every few months, you wait for your vendor to catch up, or you move.

We went the other way. Our website lets the AI of our choice in through a door we built, and lets it touch only what we decided it should.

Inside AI and outside AI

Drupal's AI initiative splits this work in two. Dries Buytaert, Drupal's founder, put it simply: with Inside AI, "a person uses Drupal, and Drupal uses AI to help." With Outside AI, "a person uses an agent, and the agent uses Drupal."

Inside AI is the assistant in the editor: Drupal's AI module suggesting alt text, translating a page, tidying a summary while you work. We'll get to that later this month. This door is about the other one, where you bring your own agent and Drupal is one of the places it can work.

A hundred components in a few minutes

Last month we answered a public agency's request for information about modernizing its website, then published every answer. The page uses tabs, accordions and a lot of interactive pieces so a long document stays easy to read. By the time it was done, it held well over 100 individual components from our Drupal Canvas theme. Laying that out by hand in the editor would have taken days.

Instead, Claude assembled it right on our site in a matter of minutes.

We built drupal-matrix.dev almost entirely the same way. Even this Advent calendar: every door you've opened this month was drafted, illustrated and filed through the same connection.

It's not simply set and forget. There's a certain spark to most of my writing that the AI doesn't necessarily get, particularly when it comes to hot takes, to controversial opinions - it routinely waters down my more blunt points. Some posts are more hands on, some are less, but even those where the AI did much of the actual drafting, I set the direction, make sure the overall story makes sense, spend a substantial amount of time crafting to make it more than just "slop".

It brings the rest of your work with it

An assistant built into your website only knows your website. An outside agent knows whatever else you're working on.

The conversation drafting this post also holds the spreadsheet where we plan all 24 doors, the research behind each one, and the code for the animated illustrations. When a post is ready, it goes straight from that conversation into a draft on our site. Writing a proposal in a Word document, building a budget in a spreadsheet, answering an RFI from a stack of PDFs: the same agent session can work across all of it, and put the result on your website when you're ready, without anyone copying and pasting between tabs.

Your website stops being a separate place you have to go. It becomes one more tool your agent can reach, alongside your documents, your calendar and everything else you've connected.

How it works

Almost all of it is shared Drupal code, with one small module of our own on top:

  • MCP Server connects AI assistants to the site using the Model Context Protocol, an open standard that assistants from Anthropic, OpenAI and others support. We run the 2.x version.
  • MCP Server OAuth handles sign-in, so each assistant gets a token that's checked against the specific tools it's allowed to use.
  • Tool API lets a site define specific actions, such as "save a draft of this page" or "upload an image," each with its own permissions. The MCP Server Tool Bridge module offers those actions to the agent without writing any connection code.
  • Tool Belt and Canvas Tools add ready-made actions, including building Drupal Canvas pages component by component. That's how the RFI page got built.

Our own module, freelock_mcp, is the part that knows how Freelock works. It offers a handful of tools for our specific content: edit an Advent door as a draft while leaving the live version untouched, clean up SVG illustrations as they're uploaded, and leave publishing and scheduling to a person. The shared modules handle the connection, the sign-in and letting the agent discover what it can do. Our module decides what those tools are allowed to do.

That split is the useful part. The plumbing is shared with every other Drupal site and maintained by the community. The rules are ours.

This is something any Drupal site can set up now, thanks to the work of Matt Glaman, Jürgen Haas and many others. Dries Buytaert showed these tools in action in his DriesNote at DrupalCon Rotterdam 2026.

The AI side is rented. Today it's Claude. Tomorrow it could be a different model in a different app, and the site wouldn't care: same tools, same rules. We rent the model. We own the door. I often get different models to review, particularly when I want to fact-check areas I'm less confident in. These drafts and the animated images are being done in Claude Web - I've often had ChatGPT Sol running in T3 Code, using OpenCode, review the same articles or graphics and make suggestions. I'm constantly asking what I've left out, what holes are in my arguments, how I could make it better (and often then disregarding the advice).

What the robot isn't allowed to do

The interesting part isn't what the AI can do on our site. It's what it can't.

  • It writes drafts. It can't publish. Every page goes live because a person reviewed it and pressed the button. This is a choice we've made through the tool setup - it's possible to give models full access, we just choose not to.
  • It can upload images, but they stay unpublished until someone approves them. (This is an annoying consequence of the previous...)
  • There's no tool for settings, templates or user accounts, so it can't change them, and it never sees customer data.
  • Once a post is scheduled, it's locked out entirely.

Those limits earned their keep this week. While attaching an illustration to door 3, the AI uploaded an image that came through garbled. It noticed, told me, and I deleted it; since uploads stay unpublished and nothing goes live without a person, it never made it onto a page. Later I scheduled the same post, then asked for one more change, and the AI couldn't open it until I unscheduled it. Mildly annoying. Exactly right.

Rent the model, own the rules

Putting AI to work on your website isn't really a question of which model is smartest. That changes every few weeks. The lasting decisions are the ones you make on your own side of the door: which actions exist, who can approve them, and what happens when the AI gets something wrong.

Make those decisions in a platform you control, and you can swap models as often as you like. Let a vendor make them, and you get the vendor's assistant, on the vendor's schedule, with the vendor's idea of what it should be allowed to touch.

Three questions before you plug an AI into your site

  1. What can it touch? List the actions it can take. If the answer is "everything an administrator can," start over.
  2. Who presses publish? Anything your visitors will see should pass through a person first.
  3. Can you switch models? If your site only works with one vendor's assistant, you've rented the door as well as the model.

Next stop

This is the fourth stop on our 2026 Advent calendar, Building for the Long Haul. Tomorrow's door opens at 9:00am Pacific. All aboard!

Want a door like this on your own Drupal site, with rules you set? Let's talk.

Advent 2026 - 24 days of owning your platform

Door number 5
5
Door number 23
23
Door number 8
8
Door number 14
14
Door number 9
9
Door number 19
19
Door number 20
20
Door number 15
15
Door number 21
21
Door number 12
12
Door number 16
16
Door number 17
17
Door number 10
10
Door number 18
18
Door number 6
6
Door number 22
22
Door number 11
11
Door number 7
7
Door number 13
13
Door number 24
24

Comments

Skip to content after comments

0 comments

0 total 0 new

Reading settings

Saved for comment discussions across this site in this browser. Apply saves your choices; Cancel discards edits. Selected comments and drafts stay open beyond the chosen depth.

No comments yet.

Add new comment

The content of this field is kept private and will not be shown publicly.

Filtered HTML

  • Web page addresses and email addresses turn into links automatically.
  • Allowed HTML tags: <a href hreflang> <em> <strong> <blockquote cite> <cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h1> <h2 id> <h3 id> <h4 id> <h5 id> <p> <br> <img src alt height width>
  • Lines and paragraphs break automatically.