MCP for 4SEF is a Pro add-on for MCP for J that lets your AI client fix and audit the addresses Weeblr's 4SEF gives your articles. It restores addresses that an old find-and-replace damaged, and it reclaims addresses still held by trashed articles, which is the usual reason a perfectly good live article 404s. Every change is a dry run first, and the result is checked on the live site rather than taken on trust. 4SEF itself is a separate paid extension from Weeblr, and without it every tool here refuses with an explanation.
Why this exists
4SEF doesn't work out an article's address from its alias each time. It works it out once, stores it in its own table against the article's id, and serves that stored address from then on. That's fast, but it means two common repairs don't do what you'd expect. Fix a damaged alias and the address doesn't change: the old one keeps working and the new one 404s. Trash a duplicate article and its address stays reserved, so the live article that should have it can't. Both are fixable in 4SEF's admin one URL at a time, if you know where to look. This add-on finds every case on the site and fixes them in batches.
What Claude can do
Eleven tools.
| Area | Tools | What you can do |
|---|---|---|
| Audit | 1 | check_forsef_health is read-only. It lists articles whose address no longer matches their alias, addresses held by trashed or deleted articles, paths with two competing rows, and redirects that can never fire, point nowhere or loop. |
| Articles | 2 | get_forsef_article_urls shows every address 4SEF holds for an article and who holds each one. set_forsef_article_url is the restore tool: it gives an article the address it should have in one call, adds a 301 from the old address, and handles up to 25 articles per call. Dry run by default. |
| URLs | 2 | check_forsef_url works out what 4SEF will do with up to 50 paths, and can fetch them live to compare. purge_forsef_urls deletes address rows by id, article or path so 4SEF rebuilds them, and can request the article's page straight away so the address doesn't 404 in between. |
| Tables | 6 | List, describe, query, insert, update and delete rows in 4SEF's own tables, with guards: no two canonical rows for one path, paths normalised the way 4SEF stores them, redirect loops refused, config tables only with an explicit confirmation, and the download key redacted. |
Installing it
You'll need Joomla 5 or 6, PHP 8.1 or later, MCP for J, and 4SEF, which you buy from Weeblr. There's no free edition of 4SEF, and nothing in it checks a licence at runtime, so there's no second paywall to worry about here. If 4SEF is installed, the tools work.
- Subscribe on the sign-up page ($9.95 a year), or get this and every other Pro add-on with MCP for J Pro โ All Access.
- Install it from Components โ MCP for Joomla โ Browse MCP Add-Ons, or download the ZIP and install it through System โ Install โ Extensions.
- That's the whole install. The plugin switches itself on, and the tools show up in your AI client the next time it lists them.
Using it
Start with "Check my 4SEF health". It's read-only, and it tells you how many articles have drifted away from their alias and how many addresses are being held by trashed articles. On the site this was built for, there were 70 of the first and 162 of the second.
Then fix them. "Give this article the address its title implies" or "Move these articles back to the addresses their aliases say they should have" comes back as a plan: the old address, the new one, the 301 that will be added, any redirects that will be repointed, and anything standing in the way. Nothing changes until you confirm it. If the new address belongs to another article, the plan names that article and its state. It's only taken over when you say so and the owner is trashed or deleted. A live owner always refuses.
How 4SEF handles addresses
Four things about 4SEF are worth knowing, because the add-on is built around them.
- The address is stored against the article id, not the alias. So fixing an alias never changes the address. The row itself has to change, and that's what
set_forsef_article_urldoes. - Only the main row for an address routes. 4SEF can store several rows for one path, but it only follows the one marked as the main, or canonical, row, and it doesn't check whether that article is published. If a trashed article holds that row, a live article that wants the address only gets a spare copy that never routes, so the address 404s. A redirect from that address never fires either, because 4SEF only looks at redirects when no row matches.
- There's no separate URL cache. Purging means deleting rows, and 4SEF rebuilds them from the current alias the next time Joomla generates a link to the article. Until then the address 404s, which is why the purge tool can request the page for you straight away.
- 4SEO records are reported, not edited. When you change an address in 4SEF's own admin, 4SEO can move its records for that page along with it. That only happens inside 4SEF's admin screen, so it doesn't happen here. The add-on adds the 301 itself, and lists 4SEO's records for both the old and new address (canonical, sitemap and custom meta) so you can update them with MCP for 4SEO.
How it was tested
Version 1.0.0 was run against 4SEF 4.0.0.747 on Joomla 6.2, on a live site with about 86,000 stored addresses. Every write tool was called on throwaway test articles, then checked in the database and fetched from outside the site. A damaged address was restored and its old address returned a 301. An address held by a trashed article was reclaimed. The guards refused what they should, and everything was put back afterwards. Multi-page articles, sites with a URL suffix, multilingual sites and articles with several addresses haven't been tried yet. If your site uses any of those, start with the health check and a dry run, and I'd like to hear how it goes.
Permissions and security
The tools use your existing Joomla permissions, checked for the person whose MCP connection makes each request. Writes to 4SEF's configuration tables need an explicit confirmation, and the download key stored in 4SEF's settings is never handed back.
Open source
GPL-2.0-or-later, the same license as Joomla itself. The full source is in the ZIP you download.
Add comment