Skip to content

About

Free OpenCart 3/4 extension: a read-only, token-protected API so AI assistants (Claude, ChatGPT, Copilot) can read your shop through AnythingMCP

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AnythingMCP Bridge for OpenCart

A free OpenCart extension that adds a read-only JSON API to the shop, so that AnythingMCP can answer questions about the shop in Claude, ChatGPT, Microsoft Copilot and other AI assistants: orders, sales per day, products, stock, customers, returns and reviews.

  • Read-only. Every query is a SELECT. Nothing in the shop can be changed through the bridge.
  • Token-protected. A random 256-bit token, generated in the admin and shown once; the shop stores only its SHA-256 hash.
  • No outgoing connections. The extension never calls AnythingMCP or anyone else: no telemetry, no update checks, no external scripts.
  • No secrets leave the shop. Never passwords, salts, tokens, IP addresses, payment card data, the setting table, API keys or admin users.
  • OpenCart 3.0.2.0 to 3.0.5.1 and 4.0.2.0 to 4.1.x, in a subfolder too, with SEO URLs on or off. PHP 7.3+ (OpenCart 3) and 8.0+ (OpenCart 4).

Licence: GPL-3.0-or-later (see LICENSE). Copyright (C) 2026 helpcode.ai GmbH. Support: support@anythingmcp.com. Privacy policy: https://anythingmcp.com/privacy.

Install

OpenCart Package
4.0.2.0 to 4.1.x anythingmcp_bridge.ocmod.zip
3.0.x anythingmcp_bridge_oc3.ocmod.zip

OpenCart 4

  1. Extensions > Installer: upload anythingmcp_bridge.ocmod.zip, then click the green install button next to AnythingMCP Bridge in the list.
  2. Extensions > Extensions, type Modules: click install next to AnythingMCP Bridge, then the pencil.

OpenCart 3

  1. Extensions > Installer: upload anythingmcp_bridge_oc3.ocmod.zip. The extension changes no OpenCart file; its install.xml only names it under Extensions > Modifications (no refresh needed).
  2. Extensions > Extensions, type Modules: click install next to AnythingMCP Bridge, then the pencil.

Then, on the module page

  1. Switch Status on and save.
  2. Click Generate token and copy the token (it starts with ocbridge_ and is shown once).
  3. Click Set up in AnythingMCP: it opens https://cloud.anythingmcp.com/connectors/setup/opencart-bridge with the shop URL filled in. Paste the token there. The token is never part of the link.

Uninstalling the module (Extensions > Extensions > Modules) removes every setting of the extension, the token hash included. Uninstalling it in Extensions > Installer removes the files.

Admin page

Setting Default What it does
Status off When off, every call is refused with 403 disabled.
Access token none Generate, rotate (the old token stops working at once) or revoke.
IP allow-list empty One IP address or CIDR range per line (IPv4 and IPv6). Empty: any address with the right token. AnythingMCP Cloud calls from 104.248.242.235 today; that is shown as a hint, never preset. A self-hosted AnythingMCP calls from its own address.
Customer personal data on When off, customers and customer answer 403 scope_disabled, and orders and returns come without names, e-mail addresses, phone numbers and addresses.
Requests per minute 120 Per calling IP address, 0 switches the limit off. Answers 429 with Retry-After. Uses OpenCart's cache.
Shop behind a proxy off When on, the allow-list and the limit use CF-Connecting-IP, X-Real-IP or the first X-Forwarded-For address. Turn on only behind Cloudflare or a load balancer: anyone can send those headers.
AnythingMCP address https://cloud.anythingmcp.com Only used to build the setup link (self-hosted AnythingMCP: its own address).

How the token is stored

The token is ocbridge_ plus 32 bytes from random_bytes() as hex. The admin returns it once in the answer to the Generate token click; the shop stores only hash('sha256', $token), the last four characters (to recognise it) and the creation time, in OpenCart's setting table under the code module_anythingmcp_bridge. A request is accepted when hash_equals() matches the hash of the presented token.

Why a plain SHA-256 and not password_hash() or encryption: the token has 256 bits of entropy, so its hash can be neither reversed nor guessed, and a slow password hash would only make every API call slower. OpenCart has no key store to protect an encrypted token with, and an encrypted token could be decrypted by anyone with the database and the code. With a hash, a leaked database does not reveal a usable token; a lost token is simply replaced.

API

One route, the same on OpenCart 3 and 4, so AnythingMCP needs only the shop URL:

GET <shop URL>/index.php?route=extension/anythingmcp_bridge/api&endpoint=<name>&<parameters>
Authorization: Bearer ocbridge_<64 hex characters>

X-AnythingMCP-Token: <token> is accepted as well, for hosts that drop the Authorization header. A token in the query string is never accepted (it would end up in access logs). Only GET is answered (405 otherwise). Without endpoint, the answer is the store info.

Answers are JSON. Lists: {"data": [...], "pagination": {"page", "limit", "total", "pages"}}; single records: {"data": {...}}; errors: {"error": {"code": "...", "message": "..."}}. Texts are HTML-decoded (OpenCart stores them encoded). Money is in the shop's default currency. Dates are shop time, YYYY-MM-DD HH:MM:SS. Lists take page (from 1) and limit (1 to 100, default 20). Most endpoints take language_id (default: the shop's default language).

Endpoint Parameters Returns
store name, URL, OpenCart and bridge version, default currency and language, time zone, server time, processing and complete status ids, counts, languages, currencies, stores, endpoint list
orders status_id (id or comma list), date_from, date_to, modified_since, customer_id, customer (name or e-mail part), email, store_id, include_missing (1 adds status-0 checkouts), sort (date_added, date_modified, total, order_id), order order header rows with status name, payment and shipping method names, item count
order order_id (required) customer, billing and shipping address, payment and shipping method (name, code), products with options, totals, status history. No IP, user agent, custom fields or card data
order_statuses id, name, processing and complete flags
customers search, email, customer_group_id, status, newsletter, date_from, date_to, sort (date_added, name, email, customer_id), order account fields, never password, salt, token, code, IP, cart or wishlist
customer customer_id (required) account fields, addresses, order summary, five recent orders
customer_groups id, name, description, approval, sort order, default flag
products search (name, model, SKU), category_id, manufacturer_id, store_id, status, modified_since, sort (name, model, price, quantity, date_added, date_modified, product_id), order product rows with codes, price, current special, quantity, out-of-stock label, manufacturer, image URL
product product_id (required) everything above plus descriptions per language, categories, stores, images, attributes, options and values, variants (OC4), specials, discounts, SEO keywords, related ids, review count and average
categories parent_id, search, status id, parent, name, full path, status, product count, SEO keyword
manufacturers search id, name, image URL, product count
returns return_status_id, order_id, customer_id, product_id, date_from, date_to returns with reason, action and status names
reviews product_id, status, min_rating, max_rating, date_from, date_to reviews with product name
stock max_quantity, status, tracked_only, include_options products by quantity ascending, optionally stock per option value
sales_summary date_from, date_to (default: last 30 days, at most 1100 days), group_by (day, month), status_id, store_id totals, rows per period, breakdown by status, ten best sellers. Without status_id: the shop's processing and complete statuses
Status Code When
400 invalid_parameter a parameter is malformed or out of range
401 missing_token no token reached the shop
401 invalid_token wrong, rotated or revoked token
403 disabled Status is off
403 ip_not_allowed the caller is not on the allow-list
403 not_configured no token generated yet
403 scope_disabled customer data switched off
404 not_found, unknown_endpoint no such record or endpoint
405 method_not_allowed not a GET
429 rate_limited over the per-minute limit (Retry-After header)
500 server_error database error; details go to the OpenCart error log, not to the caller

Order of checks: method, status, IP allow-list, rate limit, token, endpoint.

Troubleshooting

  • missing_token although a token was sent. Apache with PHP as CGI or FastCGI often drops the Authorization header. Add CGIPassAuth On (Apache 2.4.13+) or SetEnvIf Authorization "(.*)" HTTP_AUTHORIZATION=$1 to the shop's .htaccess, or ask the host.
  • 404 page from OpenCart. The module is not installed under Extensions > Extensions > Modules (OpenCart 4 loads extension routes only for installed extensions), or the shop URL is wrong.
  • Maintenance mode. OpenCart answers every catalog route with the maintenance page while maintenance mode is on, the bridge too.
  • Multi-store. The bridge answers on the main store's URL and reads every store; filter with store_id.

Repository layout

src/shared/system/library/anythingmcp_bridge.php  the API, token and allow-list logic (one file for both packages)
src/shared/language/{en-gb,de-de,it-it}/          admin texts (shared)
src/oc4/                                          OpenCart 4 package: install.json, admin/, catalog/
src/oc3/                                          OpenCart 3 package: install.xml, upload/
build.sh                                          builds dist/*.ocmod.zip (and copies them to listing/)
dev/                                              Docker test shops and the functional test (see TESTING.md)
listing/                                          marketplace texts, banner and screenshots

build.sh adds the OpenCart 4 namespace to the shared library, copies the language files into both packages, checks every PHP file with php -l and zips. Nothing is minified or encoded.

About

Free OpenCart 3/4 extension: a read-only, token-protected API so AI assistants (Claude, ChatGPT, Copilot) can read your shop through AnythingMCP

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages