Give your AI agents real recommendations, not generic “you might also like.”
Two surfaces, one intelligence layer. A bearer-auth REST API for anything that speaks HTTP, and an MCP server for Claude Desktop, Claude Code, the OpenAI Agent SDK, Cursor, and Cline. Both return ranked complementary products from the merchant's real co-purchase data.
Most upsell APIs hand-roll their own bad data
Your order history is the best recommendation signal you have. Until now, AI agents and external apps couldn't reach it. This API and MCP server change that.
Built for agent loops
MCP tool descriptions are written so an agent picks the right tool when a user asks 'what goes with the gym backpack?' or 'what should I bundle?', instead of guessing.
Per-shop API keys
Each shop mints its own keys from the admin. Plaintext shown once, SHA-256 hash stored. Revoke, rotate, or rename keys without re-deploying anything.
Single-digit-ms response
Recommendations are precomputed during mining. The API just looks them up, no LLM call, no real-time computation. Fast enough for agent loops.
HTTP for everyone else
Bearer-auth, JSON in / JSON out. Use it from your own backend, a chatbot, a Slack bot, an OpenAI assistant, an n8n workflow, anything that speaks HTTP.
curl -H "Authorization: Bearer mba_live_..." \
"https://app.marketbasketanalysis.com/api/v1/recommendations?product_id=8472918765&limit=3"{
"recommendations": [
{
"productId": "gid://shopify/Product/8472918760",
"sku": "SD-CARD-32",
"title": "32GB SD Card",
"confidence": 0.81
},
{
"productId": "gid://shopify/Product/8472918761",
"sku": "CAM-BAG-M",
"title": "Medium Camera Bag",
"confidence": 0.64
},
{
"productId": "gid://shopify/Product/8472918762",
"sku": "TRIPOD-LITE",
"title": "Lightweight Tripod",
"confidence": 0.52
}
],
"model_version": "fpgrowth-2026-05-15",
"shop_id": "12345"
}One line of config to plug into Claude, Cursor, the OpenAI Agent SDK
Published on npm as @marketbasketanalysis/mcp. Drop this snippet into your MCP host config and restart, your agent now has a get_recommendations tool that hits the merchant's real data.
{
"mcpServers": {
"marketbasketanalysis": {
"command": "npx",
"args": ["-y", "@marketbasketanalysis/mcp"],
"env": {
"MBA_API_KEY": "mba_live_YOUR_KEY_HERE"
}
}
}
}Compatible hosts
- • Claude Desktop
- • Claude Code
- • Cursor
- • Cline
- • OpenAI Agent SDK
- • Any MCP stdio host
Five capabilities, five real questions
Each MCP tool maps to a question a shopper, sales rep, or merchandiser actually asks. The tool name is just plumbing; the value is the answer the agent can now give honestly, backed by real co-purchase data.
Find what goes with a product
Answers shopper questions like “what goes with the gym backpack?” or “what should I buy alongside this camera?” The agent gets a ranked list of products customers actually bought together, not a generic “you might also like.”
get_recommendationsComplete the kit
The shopper has 3 items in their cart and asks “what's missing from this setup?” The agent looks across the whole cart and surfaces the components that pair with multiple items, ranked by how often the full kit ships together.
get_bundle_for_cartValidate a pair before suggesting it
Before the agent recommends “X goes great with Y,” it can ask the data: “is a cleaning kit actually a good cross-sell for this camera?” Gets back a confidence score and a verdict, strong, moderate, weak, or no signal at all.
score_cross_sellCheck whether a bundle holds together
A merchandiser drafts a 4-item bundle and the agent asks “does this bundle actually make sense based on real customer behavior?” Gets a 0–1 cohesion score so weak bundles can be caught before they go live on the storefront.
analyze_basketBuild a quote bundle from an RFQ
A B2B sales agent gets an RFQ for three products and asks “what should we quote alongside these?” Returns a fleshed-out bundle proposal: the seeds plus complementary items, with a cohesion score for the whole quote.
propose_quote_bundleFull function signatures, parameter docs, and return-value schemas at /docs/mcp.
API and MCP are included in the Pro plan. No per-call pricing on the API itself, no rate-limit upgrades, no token meter from us. AI features (the ai_catalog engine, bundle copy) use your own Anthropic or OpenAI key, billed directly by the provider. See pricing for details.
Building an agentic-commerce stack?
Read our 10-page buyer's guide. The questions to ask vendors about MCP, agent-callable APIs, SSRF hardening, and where the buyer-side agents actually land in 2026.
Read the guideReady to turn your order data into revenue?
Install on your platform in under 10 minutes. Or book a consulting call and we'll do the launch for you.