MCP for J add-on

MCP for 4SEF

Fix and audit 4SEF addresses from your AI client

ProJoomla 5Joomla 6 v1.0.1
$9.95/year

A yearly subscription for downloads and updates.

Buy MCP for 4SEF

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.

AreaToolsWhat you can do
Audit1check_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.
Articles2get_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.
URLs2check_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.
Tables6List, 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.

  1. 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.
  2. Install it from Components โ†’ MCP for J โ†’ Browse MCP Add-Ons, or download the ZIP and install it through System โ†’ Install โ†’ Extensions.
  3. 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_url does.
  • 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.

Please log in to download MCP for 4SEF.


Interesting blog? Like it on Facebook, Post it or share this article on other bookmarking websites.

Written by:
Tim Davis is the founder and owner of Cybersalt.

Recent changes

Version 1.0.1 20 Oct 2026
  • Renamed to "System - MCP for 4SEF" in Extensions โ†’ Plugins (was "System - MCP for Joomla: 4SEF add-on"). The new name follows the Joomla Extensions Directory's naming rules. Only the displayed name changes: the plugin's element, folder and update channel are the same, so updates keep working.
  • Every PHP file now carries a GPL licence notice (GNU General Public License version 2 or later).
  • Removed the non-standard <php_minimum> element from the manifest. Joomla never read it from there. The minimum PHP version is still published by the update server, which is where Joomla checks it.
  • No tool behaves differently.
Version 1.0.0 20 Oct 2026

First release. 11 tools over Weeblr's 4SEF (pkg_forsef) URL tables. Built from the 3.0.1.698 package source, and run against 4SEF 4.0.0.747 on Joomla 6.2.0 (same schema). Every write tool was called on a live site and checked in the database and on the live front end.

Requested by Susan Davis โ€” thank you. She had two jobs that 4SEF's own URL table was blocking: restoring article addresses damaged by an old find-and-replace, and moving articles onto addresses that still belonged to trashed duplicates.

4SEF is a paid extension from Weeblr (weeblr.com). This add-on does nothing without it: every tool refuses with an explanation, and the installer says so up front.

New

  • set_forsef_article_url gives an article the address it should have, in one call. It moves the article's 4SEF rows to new_sef, or to the address its current alias (or title) implies. The rows become custom so a purge keeps them, base_path stays in step, and exactly one row per path is canonical. It adds a 301 from the old path and repoints redirects that pointed at it. Dry run by default.
  • Collisions are explicit. If the new path already belongs to another row, the plan names the owner and its state. on_collision: "take_over_trashed" removes the holder's rows only when that owner is a trashed or deleted article. A live owner always refuses.
  • get_forsef_article_urls shows every address 4SEF holds for an article and who holds each one. It flags addresses that no longer match the alias, and lists redirects and 4SEO's records for those paths.
  • check_forsef_health is a read-only audit. Its paged detail lists cover alias drift, addresses held by trashed or deleted articles, paths with two canonical rows, paths held only by duplicates, redirects that can never fire or point nowhere, and redirect loops.
  • check_forsef_url replays 4SEF's parse order for up to 50 paths and can fetch them live to compare.
  • purge_forsef_urls is 4SEF's "purge": delete URL rows so they are rebuilt from the current alias. It works by ids, article or path, with a dry run first. It promotes duplicates like 4SEF does, and with an article it requests the page so 4SEF re-learns the address straight away.
  • Table access first, like the 4SEO add-on: list, describe, query (including REGEXP), insert, update and delete for #__forsef_*. The writes are guarded:
    • no two canonical rows for one path;
    • sef and nonsef are normalised the way 4SEF stores them;
    • redirect loops and duplicate redirect sources are refused;
    • config tables need confirm_config_write;
    • the download key (dlid) is redacted.

Architecture โ€” the 4SEF behaviour this is built around

  • 4SEF keys each URL row by the article id, not the alias. The builder finds a row by its normalised non-SEF URL, in which id:alias slugs are stripped to the id. So fixing an alias never changes the address 4SEF prints or serves. The old address keeps working, and the new one 404s until the row itself is changed.
  • Only canonical rows route. The parser looks a path up with duplicate = 0 and ignores state. When a trashed article holds a path canonically, a live article that wants it only ever gets a duplicate row, and the path 404s. Redirects are consulted only when no URL row matches, so a redirect from that path never fires either.
  • 4SEF's "URL customised" hook only runs inside its own admin request. That hook adds the oldโ†’new redirect and lets 4SEO move its records, so neither happens under MCP. This add-on adds the redirect itself. It reports the 4SEO records for both paths but does not change them.
  • Vendor bug, worked around: createRedirect() says it deletes an existing reverse redirect (newโ†’old) to avoid a loop, but it deletes the forward one instead. This add-on deletes the reverse.
  • Old aliases are not literally URL segments. MONTANA-STATE-TROOPER or Resolutions? become montana-state-trooper / resolutions, and Joomla's alias column compares case-sensitively. Alias-drift detection therefore ports 4SEF's own segment rules. Without them the first audit of a real site reported 1,160 drifted rows instead of 70.

Build

  • Gates: verify-addon, verify-registration and verify-trait-calls pass, as does an offline test of the URL and slug helpers.
Log in to comment

Add comment

Submit