commerceforai
Integrates with the merchant's own Stripe account to process checkout payments, create orders from Stripe events, and keep refunds, returns, and stock consistent.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
CommerceForAI
Commerce for apps built by AI agents. Products, inventory, Stripe checkout, orders, shipping, returns, subscriptions, gift cards, sales tax and print-on-demand, on top of the merchant's own Stripe account. One API key, and a test store with no sign-up.
This repository holds the open-source client side of CommerceForAI:
Package | What it is |
TypeScript SDK, React cart hooks, and the | |
Python client with no dependencies | |
MCP server that lets an AI agent run a store, with spending guardrails | |
Short, runnable scripts | |
The guide AI coding agents read |
The API itself is a hosted service at https://api.commerceforai.com (OpenAPI).
Start in one command
npx commerceforai init # creates a free test store, saves COMMERCEFORAI_API_KEY to .env.local
npm install commerceforaiNo account is needed. Test mode is free forever (card 4242 4242 4242 4242). When it's ready for real orders, commerce.store.goLiveLink() gives the owner one link to go live and connect Stripe.
import { Commerce } from "commerceforai";
const commerce = new Commerce(process.env.COMMERCEFORAI_API_KEY);
const { data: product } = await commerce.products.create({ name: "Trail Tee", price: 3600, inventory: 25 });
const { data: checkout, error } = await commerce.checkouts.create({
items: [{ variant_id: product!.variants[0]!.id, quantity: 1 }],
success_url: "https://yoursite.com/thanks",
});
// Send the customer to checkout.url. Stock is held until they pay or the checkout expires.
// Prove it works without a browser (test stores):
await commerce.store.simulateOrder({ items: [{ variant_id: product!.variants[0]!.id, quantity: 1 }] });Every method returns { data, error } and never throws for API errors. All money is an integer in cents.
Python:
# pip install commerceforai
from commerceforai import Commerce, create_test_store
store = create_test_store("My shop") # a free test store, no sign-up
commerce = Commerce(store["api_key"])
product = commerce.products.create(name="Trail Tee", price=3600, inventory=25)Related MCP server: CommerceHub MCP
Why use it instead of writing it yourself
An agent asked to "add a store" will often write an orders table, decrement stock on the success page and hand-roll Stripe webhooks. That breaks on the first double-click, refund or abandoned cart. CommerceForAI handles the parts that are stateful and easy to get wrong:
Stock that can't oversell: reserved at checkout, committed on payment, released if the checkout expires.
Orders created from Stripe's events, not from the browser.
Refunds, returns, order edits, split shipments with the money and stock kept consistent.
Print-on-demand: paid orders go to Printify or Printful and their tracking comes back.
Emails, sales tax, discounts, gift cards, subscriptions, invoices without extra services.
Customer pages for tracking, returns and subscriptions, so there is no login system to build.
Payments run on the merchant's own Stripe account. Pricing: free in test mode and for the first 100 orders a month, then 1% per order, never more than $29 a month per store (details).
For AI agents
Guide:
llms.txtis a short index; each topic is its own small page.Every docs page as markdown: add
.mdto its URL, e.g.https://commerceforai.com/docs/quickstart.md.Errors teach: an unknown field names the closest real one, a mistyped path suggests the right one.
Verify without a browser:
setupStatus()lists what's left with the exact fix;simulateOrder()runs a full test purchase.Least privilege: a store owner can create an API key that is read-only, or capped per refund, shipping label and gift card.
Run a store from an agent (MCP)
Hosted, no install: add https://api.commerceforai.com/mcp as a connector in Claude, ChatGPT or any MCP client. The owner signs in and picks read-only or full access. Add ?toolsets=core for about 20 tools instead of all of them.
Local, with an API key:
{ "mcpServers": { "commerce": { "command": "npx", "args": ["-y", "@commerceforai/mcp"],
"env": { "COMMERCEFORAI_API_KEY": "cfa_...", "COMMERCEFORAI_MAX_REFUND": "5000" } } } }Claude Code plugin: /plugin marketplace add https://commerceforai.com/.claude-plugin/marketplace.json, then /plugin install commerceforai@commerceforai (plugin repo).
Develop
pnpm install
pnpm build
pnpm testThis repository is published from CommerceForAI's main repository, so pull requests are applied there and appear here on the next sync. Issues and pull requests are welcome.
Links
Docs · API reference · OpenAPI · Pricing · Terms · Privacy
MIT licensed.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Run your online shop from your AI: products, prices, stock and orders. Payouts via your own Stripe.
Launch and manage online stores with AI agents: products, inventory, pricing, orders and promotions.
Run a store on your own Stripe account: products, orders, shipping, returns, print-on-demand.
Multi-seller shopping for AI agents. Settle via Stripe MPP or x402 USDC on Base. Hosted.
Related MCP Servers
- AlicenseAqualityCmaintenanceEnables AI agents to autonomously browse inventory, negotiate terms, manage carts, and execute secure payments on Shopify stores using standardized protocols. It provides a bridge for LLMs to handle the entire commerce lifecycle from discovery to order tracking through a verifiable mandate chain.52MIT
- AlicenseCqualityDmaintenanceEnables AI agents to manage e-commerce operations across multiple platforms (Shopify, WooCommerce, Stripe, MercadoLibre) through a conversational interface.4112 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to manage Shopify stores via natural language, with tools for products, orders, inventory, customers, and analytics.11 npmMIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to discover and interact with a merchant's commerce layer, including product listing and checkout creation, while payments settle directly to the merchant's Stripe account.MIT