Connect your AI agent to WordPress.
Site Agent is a free WordPress MCP plugin. Claude, ChatGPT, Cursor and other AI clients sign in with OAuth, read your real content and code, and change only what you’ve switched on.
Version 1.0.0 · Requires WordPress 6.9 · Requires PHP 8.0 · GPL
The intro on my hosting guide runs too long. Tighten it and stage the change so I can review it.
I’ll read the post first, so I’m working from what’s actually published.
Done. The new intro is two sentences. It’s saved as an autosave on the live post, so visitors still see the old version until you publish it.
There is an autosave of this post that is more recent than the version below. View the autosave
An AI agent that can’t see your site works from guesses and pasted snippets. Site Agent gives it the real thing: your posts, media, templates and code, through 18 tools you switch on one group at a time.
Reads before it writes
The agent checks the actual post, file or setting first, and every write must carry the hash from that read.
Edits wait for you
Changes to a published post are saved as an autosave. The live page changes only when you say publish.
Code has a safety net
PHP is checked before it’s saved, and a change that still causes a fatal error is swapped back for the old file.
You decide what each client can do.
Clients sign in through WordPress with OAuth. On the consent screen you tick the tool groups that client gets, and nothing else. Access tokens last an hour, refresh tokens rotate, and revoking a connection in Tools > Site Agent ends it everywhere, including sessions that are already open.

Everything starts switched off.
New installations start with Site Agent disabled. Turn it on and your agent can read the site. Content writes, source files, PHP and WP-CLI each have their own switch, and each stays off until you need it.
In wp-config.php, SITE_AGENT_DISABLED blocks every tool and DISALLOW_FILE_EDIT blocks every source and developer tool.
Site Agent Tools > Site Agent
- Enable Site AgentLet administrators connect to this site.
- OAuth connectionsSign in to WordPress and approve each client.
- Content writesDrafts, posts, pages, terms and media.
- Source editingCreate, change, move or delete source files.
- PHP executionRun PHP with full server privileges.
- WP-CLI executionRun foreground WordPress commands.
It knows where your page builder keeps the page.
Block markup written into an Elementor or Bricks page changes nothing visitors see. Site Agent tells the agent where each layout lives, and a bundled skill shows how that builder expects it to change.
Skills also ship for Page Blocks Builder and GT Link Manager, with workflow guides for MailerHive, Core Support, FluentCart and Stackless.
| Builder | Layout lives in |
|---|---|
| Gutenberg | Block markup in the post |
| Block markup with its own CSS | |
| Elementor | JSON in post meta, saved through Elementor |
| Bricks’ own abilities, on 2.4 and later | |
| Shortcodes or Divi 5 blocks |
Built for the day your agent gets it wrong.
Six checks run on every change, so the common mistakes are caught or easy to undo before visitors see them.
- Content
Live posts stay live
Edits to published posts are saved as an autosave you review in the editor.
- Code
Broken PHP gets reverted
Site Agent loads your site after a save and puts the old file back on a fatal error.
- Content
No silent overwrites
If you or another tool changed something since the agent’s last read, the write is refused.
- Code
Errors the agent can fix
Failed calls return the real message and line number, so the agent corrects its own code.
- Access
Permissions per client
A client can use only the groups you approved, and only if they’re on for the site.
- Access
Call history
The last 100 calls with tool, target, client and result. Content and credentials stay out.
18 core tools, in groups you control.
Only the read tools work once Site Agent is enabled. Every other group stays off until you switch it on and approve it for a client.
| Tool group | What the agent can do | Default |
|---|---|---|
| Read the site 7 tools | Site context, posts and pages, terms, media and builder skills | On once enabled |
| Content writes 3 tools | Save drafts and updates, upload and update media | Off |
| Source inspection 2 tools | List and read plugin, theme and must-use plugin files | Off |
| Source editing 4 tools | Write, create, move and delete files, with hash checks | Off |
| PHP execution 1 tool | Run PHP with WordPress loaded and get the output back | Off |
| WP-CLI execution 1 tool | Run foreground commands as the signed-in user, no shell | Off |
| Bricks tools Optional | Bricks’ own abilities on Bricks 2.4 and later | Off |
| Core Support tools Optional | Tickets, activity, team alerts and the roadmap. Never customer replies. | Off |
Set up in four steps. No token to copy.
OAuth is on by default. The only thing you paste into your client is the endpoint.
Install the plugin
Upload the ZIP from your account in Plugins > Add New, then open Tools > Site Agent.
Choose the tools
Enable Site Agent and the tool groups your task needs, then save.
Add the endpoint
Add it to your client as a remote MCP server, with no credentials.
Approve the client
Sign in to WordPress, tick its tool groups and choose Allow.
MCP server URL
https://your-site.com/wp-json/site-agent/v1/mcp | Client | How to connect |
|---|---|
| Turn on Developer mode (paid plans), add an app with the endpoint and choose OAuth. | |
| Customize > Connectors > Add custom connector, paste the endpoint, then Connect. | |
claude mcp add --transport http site-agent plus the endpoint, then /mcp to sign in. | |
Add the URL to ~/.cursor/mcp.json and sign in from Cursor Settings > MCP. | |
| VS Code | Add the server to .vscode/mcp.json. Copilot agent mode opens the sign-in. |
codex mcp add site-agent --url plus the endpoint, then codex mcp login site-agent. | |
Add httpUrl to ~/.gemini/settings.json, then run /mcp auth site-agent. | |
Add the URL under context_servers in settings.json. The agent panel opens the sign-in. |
Remote clients need your site on HTTPS. Connecting needs an administrator account, or a super administrator on multisite.
Site Agent is free.
Every tool, every safety check and automatic updates with the free license. The code is GPL and public on GitHub, and every tool works without activating the license.
The download and license key appear in your account right after the free checkout.
Questions
Which AI clients can connect?
Any client that supports remote MCP over Streamable HTTP with OAuth. Add the endpoint, sign in to WordPress and approve the client’s tool groups. The endpoint URL is the only thing you paste.
Is it safe to give an AI agent write access?
For content work on most sites, yes, because edits to live posts are staged and every update is checked against the last read. The developer tools run with server privileges, so I’d keep them on staging and give production clients content access only.
What happens when the agent edits a published post?
The change is saved as your autosave. WordPress shows it in the editor next to the live version, and you decide whether to publish it. The agent changes the live post only by passing a status.
Where does my site’s data go?
Your AI client connects straight to WordPress. Site Agent has no hosted proxy and no telemetry. Automatic updates send gauravtiwari.org your license key, site URL and the plugin, WordPress and PHP versions.
What can the file tools reach?
Only plugins, themes and mu-plugins inside wp-content. Hidden files, symlinks and credential files such as wp-config.php are blocked, and Site Agent can’t edit its own files.
How do updates work?
Complete the free checkout, then activate the license on the Site Agent screen. New versions appear in your Plugins screen like any other update, and you can always install a release ZIP by hand.
Straight talk
Site Agent runs on gauravtiwari.org, and I use it for my own content and page work. That’s a real record on one busy site, not a promise about yours.
The developer tools run with server privileges and aren’t a sandbox. PHP can change your database, source edits change executable code, and WP-CLI can change the installation. Give production clients content access only, and keep developer tools for a trusted client on a staging site with a current backup.
Built and supported by Gaurav Tiwari. When you email about Site Agent, the person reading it wrote the code. 18+ years building websites and plugins, and my plugins run on 10,000+ WordPress sites. More about me
Start with a staging site.
Connect your agent, check what it can read, then switch on more tools when the task needs them.