mcp
MCP (Model Context Protocol) server for CleanSlice architecture — connect Claude Code, Cursor, Windsurf to CleanSlice documentation.
- 18
- TypeScript
- MIT
- 3 wk ago
Stable is the CleanSlice commerce agent platform that brings AI assistants, automation, and conversational shopping experiences to e-commerce stores.
Repo CleanSlice/stable, read from GitHub 1 min ago. CleanSlice has not joined Take My Repo.
CleanSlice/stable is a public repo on GitHub by CleanSlice. Stable is the CleanSlice commerce agent platform that brings AI assistants, automation, and conversational shopping experiences to e-commerce stores. It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it. It is written mainly in PHP, has 0 stars and last changed on 2026-10-04. Nobody has reviewed it on Take My Repo yet, which says nothing about its quality. Read from GitHub on 2026-11-19.
In the maintainer's words. Shown from GitHub; Take My Repo does not keep a copy.
The Stable module exposes a set of HTTP tool endpoints for interacting with an OpenCart store through two controller groups:
The module lets an external agent query and manipulate store data over plain HTTP, using JSON-RPC 2.0 shaped responses. Each tool is exposed through a dedicated controller action and returns either a structured result or an error.
This is not an MCP server. The endpoints are ordinary HTTP handlers, and the tool catalogue in index() is a convenience descriptor, not a conformant MCP tools/list. An agent calls these endpoints with a generic HTTP tool; nothing registers them as MCP tools. Keep this distinction in mind when writing agent-facing documentation — describing them as "MCP tools" leads an agent to look for them in its tool list, where they do not exist.
The module supports the following high-level areas:
catalog/controller/extension/module/stable.php runs on the content_top_before event and only for a logged-in customer. admin/controller/extension/module/stable.php does the equivalent for the admin panel.
On each page load it:
stable_chat.session_id with the current storefront session via editChat().| Cookie | Contents |
|---|---|
stable_api_url |
Base URL of this store's Stable endpoint group (frontend or backend) |
stable_chat_id |
Chat identifier for this customer |
stable_agent_id |
Ranch agent id from module settings |
stable_token |
Ranch embed token |
view/javascript/stable/stable.js reads the cookies and passes two values to the agent through the SDK's data-prompt attribute:
Stable API URL: <base url>
Chat ID: <chat id>
These labels are the agent's only source for both values, so they must match the placeholders used in the agent-facing documentation (<STABLE_API_URL>, Chat ID) exactly.
Note that the cookies are set with a 60-second lifetime while the Ranch token is issued for a day. They are read once on window load; a widget re-initialisation later than that reads null.
Every endpoint is POST with a JSON body. There are no GET endpoints and no other HTTP methods; request-method validation was removed from the handlers.
POST <base url>/<tool>
Content-Type: application/json
{"chat_id": "...", ...tool arguments...}
Arguments are read by the shared getRequestData() helper, which is deliberately tolerant. It merges, in descending priority:
php://input)OpenCart's own route parameter is stripped. A caller that puts arguments in the query string still works, but the JSON body is the documented form.
Success — HTTP 200:
{ "jsonrpc": "2.0", "result": { ... } }Failure — HTTP 400:
{
"jsonrpc": "2.0",
"error": "Chat ID required! Product ID required!",
"errors": ["Chat ID required!", "Product ID required!"]
}result and error are mutually exclusive.error is every problem joined into a single string; errors is the same set as an array.All tool endpoints share the same pattern:
chat_id and relevant arguments.The module also records chat actions and request logs for traceability.
Write operations — cart changes and order creation — need the customer's real session, not the one the API request arrives on. refreshStartup($chat) rebuilds it:
stable_chat.session_idcustomer, currency, tax, weight, length and cart in the registry against that sessionThis makes two things load-bearing:
stable_chat.session_id must stay current. The bootstrap controller refreshes it on every page load. If that update is skipped, the stored id eventually points at an expired session: Cart\Customer then finds no logged-in customer, getCurrentCustomer fails with Current customer not found!, and cart writes silently land in a guest-scoped cart that the customer never sees on the storefront.Cart\Cart is scoped by customer_id + session_id, so with customer_id = 0 an add still returns a consistent cart. A successful cart response is therefore not by itself proof that the session is healthy.Every tool is gated by one of five permission groups, configured per store under setting.side.<side>.tool.<group>.status:
| Side | Groups |
|---|---|
| Frontend | product, customer, cart, checkout |
| Backend | product, customer, order |
The product group covers the manufacturer tools too — getManufacturer and
getManufacturers are catalog lookups and are gated with the categories and products.
getCountries and getZonesByCountryId are ungated on both sides. A disabled group makes its tools return You do not have permission to use this tool!.
Every plural tool takes filters plus sort, order and page, and applies all three
server-side. The agent is not expected to fetch broadly and re-order the result itself.
order accepts ASC / DESC. Default is ASC everywhere except getOrders, which
defaults to DESC so the newest order is the first element of page 1.sort accepts a fixed key set per tool, mapped in the model's $sort_data. An
unrecognised key silently falls back to the default — the handler does not reject it.| Tool | sort keys |
|---|---|
getCategories |
name, sort_order (backend also status) |
getManufacturers |
name, sort_order |
getProducts |
name, model, price, quantity, sort_order, date_added, manufacturer, rating (backend also status) |
getCustomers (backend) |
name, email, customer_group, status, date_added |
getOrders (backend) |
order_id, customer_name, order_status, total, date_added |
manufacturer and rating sort on SELECT-list aliases, which is legal in ORDER BY but
not in WHERE — the same reason the price filter cannot reuse the special / discount
aliases (see below).
getProducts on the frontend filters and sorts by the price the customer actually sees,
not the stored base price. getPriceExpression() and getDisplayPriceExpression() in the
frontend model build one SQL expression applying, in order:
p.price — via COALESCE, with the
subqueries repeated inline because SELECT aliases are invisible to WHERE;tax_class_id, as value * k + c. Both coefficients are read off
the live Cart\Tax object with two probes (calculate(0) and calculate(100)) rather
than re-implementing the rate rules — Tax::calculate() is linear in value, so this is
exact and can never drift from what the display code produces;The same expression backs getProducts, getTotalProducts and the price sort, so the
returned rows, productCount and the ordering can never disagree. Because of that, the
controller passes price_min / price_max through verbatim — converting them again
would apply the currency rate twice.
The backend deliberately filters on the raw p.price: no tax, no conversion. Admin-side
answers are about stored data, not shopfront presentation.
getCurrentCustomerOrder / getCurrentCustomerOrders (frontend) only return orders with
order_status_id > 0, scoped to the current customer and store, ordered newest first.
This tool takes no sort / order.getOrders (backend) defaults to order_status_id > 0 as well, but order_status_id: 0
is a valid filter value and returns the unconfirmed ("missing", abandoned) orders. Both
the handler and the model guard with !== '' rather than !empty(), precisely so that a
zero survives. getOrderStatuses does not list 0 — status 0 is the absence of a status,
and it has no row in the order_status table, so such orders come back with
order_status set to null.The backend controller is intended for admin-side operations and exposes read-only tools for catalog, customer, and order data. No backend tool creates or modifies a record.
getCategory
chat_id, category_idgetCategories
chat_idname, parent_category_id, status, sort, order, pagegetManufacturer
manufacturer_id, name, image, sort_order.chat_id, manufacturer_idgetManufacturers
getProducts.chat_idname, sort, order, pagegetProduct
chat_id, product_idgetProducts
chat_idname, model, category_id, manufacturer_id, price_min, price_max, quantity_min, quantity_max, status, date_added_from, date_added_to, sort, order, pagestatus has no default: omit it and both enabled and disabled products are returned.tag and description are no longer searchable — the filters were removed from the models.getCustomer
chat_id, customer_idgetCustomers
chat_idname, email, customer_group_id, status, date_added_from, date_added_to, sort, order, pagegetCustomerGroups
chat_idgetOrder
chat_id, order_idgetOrders
sort / order to change that, and order_status_id: 0 for unconfirmed orders.chat_idcustomer_name, order_status_id, total_min, total_max, date_added_from, date_added_to, sort, order, pagegetOrderStatuses
chat_idgetCountries
chat_idgetZonesByCountryId
chat_id, country_idThe frontend controller is intended for storefront interactions and exposes tools that support customer-facing shopping scenarios.
getCategory
chat_id, category_idgetCategories
chat_idname, parent_category_id, sort, order, pagegetManufacturer
manufacturer_id, name, image, sort_order.chat_id, manufacturer_idgetManufacturers
chat_idname, sort, order, pagegetProduct
chat_id, product_idgetProducts
chat_idname, model, category_id, manufacturer_id, price_min, price_max, quantity_min, quantity_max, date_added_from, date_added_to, sort, order, pageprice_min / price_max are interpreted as the customer-visible price — tax applied, session currency — see Effective price. Pass them through unconverted.status filter here: the storefront query is hard-wired to p.status = '1'.tag and description are no longer searchable — the filters were removed from the models.getCurrentCustomer
chat_idCurrent customer not found! when the restored session has no logged-in customer — see Session handling.getCurrentCustomerOrder
chat_id, order_idgetCurrentCustomerOrders
chat_idpageEach cart tool returns the full updated cart ({"products": [...]}), so the response itself is the confirmation that the change took effect.
addCartProduct
chat_id, product_idquantity (default 1), option, recurring_id<Option name> required!. A product with recurring profiles needs a valid recurring_id.editCartProduct
chat_id, cart_id, quantitycart_id), not product_id.deleteCartProduct
chat_id, cart_idgetCartProducts
chat_idcreateOrder
chat_id, payment_method_codefirstname, lastname, email, address_1, city, postcode, country_id, zone_id. They only fail if still missing afterwards.shipping_method_code is required only when the cart contains a shippable product (cart->hasShipping()); omit it for digital-only carts.index() generates their properties and one allOf / if / then branch per method from that registry, and the handler validates against the same data. All such fields are declared as strings: as numbers, "01" becomes 1 and "045" becomes 45, and long card numbers lose precision.getShippingMethods / getPaymentMethods, never constructed.minimum.$this->request->post so the payment extension (which reads from there) receives the payment fields.getShippingMethods
chat_id, country_id, zone_idgetPaymentMethods
chat_id, country_id, zone_idcode, title, flow, and either required_fields + optional_fields or, for flow: unsupported, a reason.getCountries
chat_idgetZonesByCountryId
chat_id, country_idOpenCart ships 54 payment extensions and they are not interchangeable. What a method needs is visible in its controller's public methods:
| Class | Signature | Can the module complete it? |
|---|---|---|
| Offline | index, confirm |
Yes — confirm() sets the order status server-side |
| Direct API | index, send |
Yes, once the extra fields are collected |
| API + 3-D Secure | send plus acsReturn / threeDSecureCallback / tds |
No — the challenge needs the customer's browser |
| Redirect / IPN | index, callback / notify / ipn |
No — the customer must be sent to the gateway |
| JS SDK | express, nonce, createOrder … |
No — needs a script running in the browser |
Only the first two classes can be driven headlessly, so the practical ceiling is roughly a dozen methods, not all 54. That is a property of the payment flows, not a limitation to be engineered away.
Supported methods are declared in system/config/stable.php under payment_method. Nothing
about a specific gateway lives in the controller.
'cod' => array( 'code' => 'cod', 'flow' => 'confirm', 'field' => array() ), 'authorizenet_aim' => array( 'code' => 'authorizenet_aim', 'flow' => 'send', 'field' => array( 'cc_number' => array( 'code' => 'cc_number', 'type' => 'string', 'required' => true, 'name' => 'Card Number', 'description' => '...' ), // ... ) ),
flow is the controller method to call — confirm or send. The dispatcher is
generic: load->controller('extension/payment/' . $code . '/' . $flow).field declares every field the method understands. required => true fields are
validated by createOrder and land in that method's allOf / then branch;
required => false fields are declared in properties and advertised as
optional_fields, but never enforced.flow: unsupported by
getPaymentMethods, and createOrder refuses it with HTTP 400 before creating
anything.Currently registered: cod, bank_transfer, cheque, free_checkout (offline);
authorizenet_aim, sagepay_us, web_payment_software, perpetual_payments,
firstdata_remote (send).
Field sets genuinely differ between these — web_payment_software never reads a cardholder
name, firstdata_remote calls it cc_name and reads no expiry date at all,
perpetual_payments wants an optional card start date. Nothing may assume a fixed "card
field set".
Field descriptions are written into createOrder's inputSchema keyed by field code, so
a field shared between methods keeps only the last description declared. Descriptions for
the same code must therefore stay identical and must never name one method — which method
requires what is expressed by the generated allOf branches, not by the prose.
Response shapes are inconsistent across extensions: cod / bank_transfer / cheque set
json['redirect'], authorizenet_aim sets redirect or error, some gateways use
json['success'], and free_checkout outputs nothing at all on success. So "empty
output" means success for one method and failure for the rest — the response cannot decide it.
createOrder therefore ignores the response shape and checks the database:
json['error'] present → surface the gateway's own message. It is the only place the real
reason (a decline, a bad card) exists.order_status_id > 0 means confirmed, because every
extension calls addOrderHistory() on success and that is what lifts the order off
status 0.The cart is cleared only inside the verified-success branch. A row left at status 0 is a
missing order — the same thing the backend's order_status_id: 0 filter finds.
index() action; the actual logic lives in dedicated methods such as getProduct, getProducts, createOrder, and the cart actions.endpoint and requestMethod alongside the argument schema. These are extensions for the module's own client and are not part of the MCP contract.chat_id and the appropriate permission group.CleanSlice/stable is a public repo on GitHub by CleanSlice. Stable is the CleanSlice commerce agent platform that brings AI assistants, automation, and conversational shopping experiences to e-commerce stores.
It declares no license on GitHub. Public does not mean open source: without a license, nobody is granted the right to reuse it.
Its maker has not tagged a system, so it is unknown here. Its README says what it needs.
Open "Take it" on its page: Take My Repo writes an install plan for your machine and hands it to your AI agent (Claude Code, Codex or Cursor), which asks you before each step. Take My Repo has not tested it on any machine.
Its last change on GitHub was on 2026-10-04. Take My Repo does not judge from that whether it is maintained.
Nobody has reviewed it on Take My Repo yet, which says nothing about its quality.
Automated eval & improvement loop for AI agents. Generates test scenarios, runs the agent, scores with multi-model consensus (Claude + GPT + Gemini), and iteratively patches code until quality targets are met.

Agent runtime for CleanSlice — TypeScript gateway, model adapter, and tool layer
CleanSlice agent skills — architecture patterns, vertical slices, conventional commits for Claude Code and AI coding agents.
Official CleanSlice documentation — Clean Architecture framework for NestJS + Nuxt full-stack apps with vertical slices.
CleanSlice full-stack starter kit — NestJS + Nuxt with Clean Architecture vertical slices, Prisma, Pinia, shadcn-vue, Tailwind.