MBA
Agents + MCP

An MCP server that knows what to bundle with what.

Install @marketbasketanalysis/mcp, paste your API key, and your AI agent can answer 'what should I cross-sell with the customer's current cart?' or 'what's a good bundle for an out-of-season item?' against real merchant order data. Basket AI: four named agents (Discovery, Bundle, Insight, Replenishment) over eight typed tools, MCP-protocol-compliant.

(One snippet, one restart)

Why this fit

Most LLMs are great at copy but bad at recommendations: they invent products, pair things that don't actually move together, and have no idea what's in the store's catalog. MBA's MCP server is the missing piece, a tool an agent calls to get real co-purchase data backed by the merchant's own order history. Works with any MCP-compatible host: Claude Desktop, Claude Code, Cursor, Cline, the OpenAI Agent SDK.

What you get

The right primitives for the job

Eight typed tools, four named agents

Basket AI groups eight tools (get_recommendations, find_substitutes, get_bundle_for_cart, propose_quote_bundle, score_cross_sell, analyze_basket, predict_reorder, propose_subscription_bundle) into Discovery, Bundle, Insight, and Replenishment agents. Each ships a JSON-schema input contract so the host can validate before calling.

Works with every MCP host

Claude Desktop, Claude Code, Cursor, Cline, OpenAI Agent SDK. One snippet in the host config + one restart.

SSRF-guarded base URL

The MBA_API_BASE env var is validated against an allow-list: rejects loopback, link-local, cloud-metadata IPs. Operators can't accidentally (or maliciously) point the MCP at their own internal network.

Timeout + retry

15s per request, with exponential-backoff retry on 429 + 5xx. Hung upstream doesn't block the host indefinitely; runtime validation rejects malformed responses with sanitized error messages.

Real auth

Bearer API key minted in your MBA admin (Shopify / Magento / WC). Hashed at storage; plaintext only shown once at creation. Revoke per-integration without affecting other hosts.

B2B-aware

propose_quote_bundle is designed for sales-rep agents on Magento B2B: takes a customer ID, returns recommended bundles tuned to that account's purchase history.

What you skip

The friction we're explicitly cutting out.

  • Building a custom HTTP client that doesn't know the recommendation API's shape
  • Hardcoding product catalogs into your agent's system prompt
  • Inventing fake product pairs because the model has no real data to pull from
  • Re-implementing auth, rate limiting, and timeout handling per agent project
  • Letting agents query internal networks via untrusted MBA_API_BASE values

Install once. Query from anywhere.

The MCP server is free + open. The only paid piece is the MBA backend itself (per-platform pricing on the pricing page). If you're a developer building an agent against a Shopify / Magento / WC store, the MCP server is the most direct path to real recommendation data.

Quick-start install