MCP for JComments
MCP for JComments is a free add-on for MCP for J. It gives an AI app connected to your Joomla site 15 tools for JComments: reading comments with their whole thread, replying, approving and unpublishing, deleting, scoring spam and banning IP addresses, plus a health check of your JComments setup.
New to MCP for JComments? This page is the reference manual. For an overview of what MCP for JComments does, and the download, see its page on cybersalt.com.
Release history. This page documents version 1.0.2. For what changed in each version, see the changelog.
Requirements. Joomla 5 or 6, PHP 8.2 or newer, MCP for J, and JComments, the free com_jcomments maintained by exstreme for Joomla 4, 5 and 6. Built against JComments 5.0.6. The add-on is released under the GNU GPL v2 or later.
JComments or JComment? This add-on is for JComments, with an "s". If your site runs the paid JComment from Joomla! Extensions Store, you want MCP for JComment instead. If this add-on finds JComment and not JComments, its tools say so.
What's in the package
One plugin, System - MCP for JComments (element csmcpforjjcomments). It adds its tools to MCP for J and has no admin screen of its own. The tools appear in your AI app the next time it asks MCP for J for its tool list.
Installing
Install MCP for J first and connect your AI app to it. Then pick one of these:
- From inside Joomla (recommended). Open Components → MCP for J → Browse MCP Add-ons and install the JComments add-on. Updates then arrive through System → Update → Extensions.
- From the zip. Download it from the product page and install it in System → Install → Extensions.
If MCP for J isn't installed, the plugin installs switched off and says why.
First steps
Ask your AI app "Check my JComments setup", then "What comments are waiting for approval?" Both are read-only. Take a backup before you let any AI app make changes to a site you care about.
Permissions
The AI can never do more than the Joomla account it acts for could do in JComments' admin. Each tool needs MCP for J's Use permission (reading) or Write permission (changes), JComments' Access Administration Interface permission, and on top of that:
| Tools | The account also needs, in JComments |
|---|---|
| Reading comments, the lists, the spam check, the health check, the settings and the table viewer | Nothing more |
| Replying | comment.comment and comment.reply, as JComments' own Reply button does. The reply is published if the account has comment.autopublish; choosing yourself needs Edit State |
| Approving or unpublishing, and marking spam as unpublished | Edit State |
| Deleting, and marking spam as deleted | Delete |
| Banning an IP address | comment.ban |
Out of the box only Super Users get in. JComments' install denies Access Administration Interface to the Manager group, and Administrator inherits that from Manager. To let another group use these tools, allow it in Components → JComments → Options → Permissions.
The refusal names the permission that's missing.
⤢ Click to enlarge
The tools
15 tools in 6 groups. Your AI app picks the right one from what you ask.
| Group | What they do |
|---|---|
| Reading (2) | List comments newest or oldest first, filtered by state, article, author, IP address, date, text, language or the replies to one comment, optionally with spam scores; and read one comment with its thread, reader reports, author history and spam score. |
| Replying (1) | Reply as the account the AI acts for, threaded the way JComments threads replies. |
| Moderation (2) | Approve or unpublish up to 200 comments at a time, and delete with a dry run first. |
| Spam (2) | Score comments with every rule that fired, and mark spam: unpublish or delete it, and optionally ban the IP address. |
| Lists (5) | Commented articles with their pending counts, reader reports, subscriptions, the blacklist and the mail queue. All read-only. |
| Diagnostics (3) | The health check, JComments' settings with the permissions in plain words, and a read-only viewer for JComments' own tables. |
The health check
check_jcomments_health is read-only. It counts comments by state and looks for the things that quietly go wrong: comments waiting for approval, notifications stuck in the mail queue, Joomla's mail switched off, guests commenting without a captcha, categories with comments turned off, and the Joomla 6 problem described below.
⤢ Click to enlarge
Spam scores
check_jcomments_spam scores comments for review. Scores decide nothing on their own; every flag names the rule that fired and why. The rules look at links and their domains, known spam phrases, your own JComments censor list, a link in the author's name, throwaway email addresses, repeated or shouted text, the same text posted elsewhere, a burst of comments from one IP address, blacklist hits, new authors, reader reports and poor votes. No rule looks at the language or alphabet a comment is written in.
⤢ Click to enlarge
Reading one comment
get_jcomments_comment returns the comment with its full text, the thread it sits in (and whether each comment in it shows on the site), any reader reports, the author's other comments by email and IP address, whether the author is subscribed to the article, and its spam score.
⤢ Click to enlarge
Replying
create_jcomments_reply posts a reply as the account the AI acts for, with that account's name and email. It goes through JComments' own comment table, so the parent, thread, path and level match a reply posted on the front end, and it uses the language of the comment it answers. The response checks each of those against the database.
- Plain text and JComments BBCode such as
[b],[quote]and[url=...]. HTML is refused rather than stripped, and JComments removes any BBCode the account isn't allowed to use. - An identical reply already under the same comment is refused, so a retry can't post twice.
- Replies to a comment JComments has marked as deleted are refused, as JComments refuses them.
- If the comment you answer is unpublished, the response warns that your reply won't show until it's approved.
⤢ Click to enlarge
Nothing is emailed unless you ask
JComments' own Publish button emails every subscriber of the article about the newly published comment. Here, approving, unpublishing, replying, deleting and banning send nothing and fire no JComments plugin events by default.
⤢ Click to enlarge
Pass notify: true to do exactly what JComments' admin would do: its publish events fire and its notification code mails the article's subscribers. With notify, one call takes at most 20 comments. The response shows the mail queue before and after. JComments deletes a queued email once the mailer accepts it, so one that's still queued didn't send.
⤢ Click to enlarge
notify: true on a test site with mail switched off.Marking spam and banning
mark_jcomments_spam unpublishes or deletes the comments and, with ban_ip, adds their IP addresses to JComments' blacklist. An address already covered by a blacklist entry, including a wildcard one, isn't added twice. The reason and notes are plain text, as in JComments' own blacklist form.
⤢ Click to enlarge
- JComments' blacklist is off by default. Bans are stored but not enforced until it's switched on in JComments' settings. The response says so.
- An IP ban never stops a logged-in visitor. JComments checks logged-in users by their account only. When a spam comment came from a registered user, the response tells you to block the Joomla account instead.
- The tool won't ban the IP address the request itself comes from.
Deleting
delete_jcomments_comments uses JComments' own delete and follows its delete mode, or the mode you name. In "delete" mode JComments removes the comment and every reply beneath it, with their votes and reports. In "mark deleted" mode the comment stays as a "comment deleted" placeholder and the replies stay. Use dry_run first to see what would go.
⤢ Click to enlarge
A comment someone has open in JComments' editor is skipped until it's checked in.
What stays private
Subscription unsubscribe codes and the bodies of queued emails (which carry JComments' one-click moderation links) are never shown, and the table viewer refuses them as filters or sort columns. The table viewer is read-only and limited to JComments' own tables.
JComments behaviour worth knowing
- A fresh install turns comments on in no category. Comments appear only on articles containing
{jcomments on}until you pick categories in JComments' settings. The health check tells you. - A fresh install uses the flat "list" view: visitors get no Reply button and replies show in date order. In the "tree" view a reply shows only while every comment above it is published.
- Several permissions work the opposite way to their names. Allowing
comment.captcha,comment.flood,comment.length_checkorcomment.terms_of_usefor a group exempts that group from the check. - Subscriber emails don't depend on the "enable notification" option, which only covers moderator emails.
- On Joomla 6, saving an entry in JComments' admin Blacklist form gives a blank page unless the core plugin "Behaviour - Backward Compatibility 6" is on. The health check spots it, and banning through
mark_jcomments_spamworks either way.
What's been tested
Version 1.0.2 was tested on Joomla 5.4 and 6.1 with JComments 5.0.6 and PHP 8.4. The test comments were posted through JComments' own comment form by guests and a logged-in registered user, including nested replies, spam on two articles and Cyrillic text. All 15 tools were called with every change checked in the database, including that nothing was queued for mail unless notify was set. The permission checks ran on every tool with Super User, Administrator and Manager accounts. Multilingual sites, MySQL 8 (the tests used MariaDB) and the actual delivery of notification emails haven't been tested yet.
Troubleshooting
| Symptom | Cause and fix |
|---|---|
| No JComments tools in the AI app | Check that MCP for J is installed, System - MCP for JComments is enabled in System → Plugins, and the AI app has refreshed its tool list. |
Every tool says the user lacks core.manage | The account doesn't have Access Administration Interface on JComments. See Permissions. |
| "JComments is not installed" | The site has no com_jcomments. If it runs JComment from Joomla! Extensions Store, use MCP for JComment. |
| A reply doesn't show on the site | It, or a comment above it, is unpublished, or JComments isn't switched on for that article's category. |
| Bans don't stop anyone | JComments' blacklist is switched off, or the visitor is logged in. |
| Notifications never arrive | Run the health check: it reports Joomla's mail switched off and emails stuck in JComments' queue. |
Getting help
Questions and bug reports are welcome through the Cybersalt support form. Please include your Joomla, PHP, JComments, MCP for J and add-on versions, and the tool response that surprised you.
MCP for JComments is developed by Cybersalt Consulting Ltd. and released under the GNU General Public License v2 or later. It is not made or endorsed by the JComments developers.
The health check — click anywhere to closeClose ×
A spam score — click anywhere to closeClose ×
Author history — click anywhere to closeClose ×
A reply — click anywhere to closeClose ×
Approving without mail — click anywhere to closeClose ×
Approving with notify — click anywhere to closeClose ×
Marking spam — click anywhere to closeClose ×
A delete dry run — click anywhere to closeClose ×