Friday, December 4, 2026

Agent Bridge: let your AI agent build your WordPress site directly

A small plugin that connects Claude Code, Codex and other AI agents to WordPress, so they can write plugins, design themes and publish pages themselves, safely.

Abstract illustration

An AI agent connected to WordPress through Agent Bridge. Illustration: ScrollTeach

Building a WordPress site with an AI assistant usually looks like this: you ask for code, copy it, open the file manager, paste it, upload, refresh, find a bug, and go back to the chat. The assistant writes the code, but you are the one moving it around.

Agent Bridge removes that loop. It is a small WordPress plugin that lets an AI coding agent, such as Claude Code or Codex, work on your site directly. The agent can write a plugin or a theme, create pages, install tools and check the result, while you watch and approve the direction.

What Agent Bridge does

Agent Bridge adds a secure endpoint to your site that speaks MCP, the Model Context Protocol. MCP is the open standard that AI agents use to connect to outside tools. Once your agent is connected, it sees a list of actions it can take on your site:

  • Files: read, create and edit files in your plugins and themes folders.
  • Plugins and themes: install from wordpress.org, activate, deactivate and switch themes.
  • Content: create and edit posts and pages in block markup, with categories, tags and featured images.
  • Settings: change site options such as the site name, home page and permalinks.
  • Media: import images from a URL into the media library.
  • Checks: load any page of the site and read the debug log, so the agent can verify its own work.

In practice

You describe the result, for example “add a newsletter box at the end of every article”, and the agent writes the code, activates it and loads a page to confirm it works.

How to set it up

  1. In WordPress, go to Plugins › Add New › Upload Plugin, upload agent-bridge.zip and activate it.
  2. Open Tools › Agent Bridge and click Create token. Copy the token: it is shown only once.
  3. Copy the ready-made command for your agent from the same page, and run it.

For Claude Code, the command looks like this:

claude mcp add --transport http my-site https://example.com/wp-json/agent-bridge/v1/mcp \
  --header "Authorization: Bearer YOUR_TOKEN"

For Codex, add these lines to ~/.codex/config.toml:

[mcp_servers.my_site]
url = "https://example.com/wp-json/agent-bridge/v1/mcp"
http_headers = { "Authorization" = "Bearer YOUR_TOKEN" }
The agent works in a loop: write a change, activate it, load the page, fix what it sees. Illustration: ScrollTeach

Safety: why it will not break your site

Giving an AI agent access to a live website sounds risky, so Agent Bridge is built around a few hard rules:

  • The agent can write files only in wp-content/plugins, wp-content/themes and wp-content/mu-plugins. It cannot touch wp-config.php or server configuration files.
  • Every file it changes or deletes is copied to a backup folder first.
  • PHP code is checked for syntax errors before it is saved. Broken code is refused.
  • After a code change or an activation, the plugin loads your home page. If the site returns an error, the change is undone automatically.
  • Every action is written to an activity log under Tools › Agent Bridge, and one click switches access off.

Use staging first

Connect your agent to a staging copy of your site, not the live one, until you trust the workflow. Treat the token like a password and revoke it when you are done.

Get Agent Bridge

Install the plugin on a fresh WordPress site and connect your agent in two minutes.

What you can ask the agent to build

Some requests that work well as a first project:

  1. “Build a block theme for this site based on this screenshot.”
  2. “Create a plugin that adds a reading-time badge and share buttons to every post.”
  3. “Set up categories for News, Guides and Tools, and create an About page.”
  4. “Install Advanced Ads and add a banner placement after the second paragraph.”

Ask for one thing at a time, and look at the result before the next request. The agent works fastest when each step is small and easy to check.

The bottom line

Agent Bridge turns your AI assistant from an advisor into a builder. You stay in charge of what gets built; the agent does the typing, the uploading and the checking. This very site was set up that way.

Found this useful? Share it with a colleague.

Written by

ScrollTeach Editorial

The ScrollTeach team covers AI news and writes practical guides for people who want to use AI well at work. Every article is checked by an editor before it goes live.

View all posts (13) →

Leave a Reply

Your email address will not be published. Required fields are marked *

You might also like

The week in AI, in five minutes

One email every Friday with the news that matters and one guide you can use. No spam.