MCP doesn't replace Joomla's REST API. It sits on top of it. The real question for a developer is when a task should be a script that calls the API, and when it should be a tool an AI assistant calls. We use both every week. Here's how we decide.
Same API underneath
Script: cron / CI ──▶ your code ─────────────────────────────▶ Joomla /api/index.php/v1/…
MCP: person ──▶ Claude ──▶ MCP server (your tool code) ──▶ Joomla /api/index.php/v1/…
Both paths end at the same endpoints, with the same token and the same Joomla permissions. What differs is who decides which calls to make. With a script, you decide when you write it. With MCP, the model decides at runtime, within the tools you exposed.
When a script is the right tool
- The steps are known in advance. Import 500 products from a CSV, sync users from a CRM, publish scheduled content. A model adds nothing but cost and variance.
- It must be exactly the same every time. Scripts are deterministic and testable. A model may take a different path tomorrow.
- Volume. Thousands of calls cost nothing as a script and a lot as model tokens.
- Unattended runs. Cron at 3 a.m. doesn't need natural language.
# terminal – a typical script job: unpublish articles whose event date has passed
curl -s -G -H "Authorization: Bearer $TOKEN" -H "Accept: application/vnd.api+json" \
--data-urlencode "filter[category]=31" --data-urlencode "filter[state]=1" --data-urlencode "page[limit]=100" \
"https://example.com/api/index.php/v1/content/articles" \
| jq -r '.data[] | select(.attributes.event_date < (now | strftime("%Y-%m-%d"))) | .id' \
| while read id; do
curl -s -X PATCH -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
"https://example.com/api/index.php/v1/content/articles/$id" -d '{"state": 0}' >/dev/null
done
(event_date is a custom field. The API returns custom fields by name on items.)
When MCP is the right tool
- The question changes every time. "Which posts mention Joomla 4 but haven't been updated since 2024?" "Are there two articles competing for the same keyword?" Writing a script for each question costs more than asking.
- The work needs judgement on text. Drafting, rewriting a description, suggesting internal links, checking tone. That's what models are for.
- A person is in the loop anyway. Editors working with an assistant, where each write is a draft someone reviews.
Designing tools: fewer, narrower, safer
Exposing the whole REST API as MCP tools ("create", "update", "delete" for every resource) is the most common mistake. The model then has to plan multi-step operations with generic tools, and the riskiest operations are always one call away. Better tools are shaped like tasks:
| Generic (avoid) | Task-shaped (prefer) |
|---|---|
update_article(id, fields) | update_meta_description(id, text) with a 160-character limit in the schema |
create_article(fields) | create_draft(title, catid, html), which always saves unpublished |
delete_article(id) | no tool; trashing is a human action |
query(sql) | find_articles_without_meta(category) |
Constraints in the tool's input schema (max lengths, allowed categories, enums) are enforced before the API is called, whatever the model sends. Tool descriptions matter too. The model chooses tools by reading them, so "Creates an UNPUBLISHED draft for human review" is a safety feature, not documentation.
Errors: scripts fail, models improvise
A script that gets a 400 stops and logs it. A model that gets a 400 tries something else, which is helpful when it fixes a typo in an alias and harmful when it "works around" a permission error. Return errors to the model as plain, specific text ("Category 24 not allowed for this user"), and never design a tool where a retry with different arguments can widen what it does.
Cost and speed, roughly
| Script via API | Assistant via MCP | |
|---|---|---|
| Per call | milliseconds, free | seconds, model tokens per step |
| Building it | developer time per task | tools once, then questions are free-form |
| Repeatability | exact | similar, not identical |
| Best for | known, repeated, high-volume jobs | ad-hoc questions, text work, small batches with review |
The combination we use
Scripts (and Scheduler tasks) for everything repeatable. A small MCP server with read tools and draft-only writes for editors and for us. And a rule for the line between them: when we've asked the assistant the same question three times, it becomes a script or a report.
The code for both sides is in Joomla REST API for beginners and How to build a Joomla MCP server.