AI agents & MCP
Agents touch a store in three ways. Each has its own entry point.
1. Coding agents that build the store
Point Claude Code, Cursor or v0 at commerceforai.com/llms.txt. It has the full API surface and working recipes, and it tells the agent what not to hand-roll: orders tables, stock counts, Stripe webhook handlers.
Add a store to this app using CommerceForAI. Read https://commerceforai.com/llms.txt first.2. Agents that run the store (MCP)
The MCP server gives an agent tools to manage products, stock, orders, labels, returns and print-on-demand. Write tools are limited by guardrails you set in its environment.
claude_desktop_config.json · .mcp.json
{
"mcpServers": {
"store": {
"command": "npx",
"args": ["-y", "@commerceforai/mcp"],
"env": {
"COMMERCEFORAI_API_KEY": "cfa_live_...",
"COMMERCEFORAI_MAX_REFUND": "5000",
"COMMERCEFORAI_MAX_LABEL_COST": "2500"
}
}
}
}| Setting | Effect |
|---|---|
COMMERCEFORAI_MAX_REFUND | Largest refund per call, in cents (default 5000). Also applies to refunds from returns. Larger refunds are refused and handed back to a human. |
COMMERCEFORAI_MAX_LABEL_COST | Most a single shipping label may cost, in cents (default 5000). Checked by the server against the real rate. |
COMMERCEFORAI_READ_ONLY=true | Only read tools are exposed. |
COMMERCEFORAI_TOOLS | Comma-separated allowlist, e.g. list_orders,fulfill_order. |
Try asking: “Which paid orders haven't shipped? Buy the cheapest label for each and give me the PDFs.”
3. Shopping agents that buy
Tell us where your product pages live and CommerceForAI publishes feeds for AI shopping surfaces:
const { data: store } = await commerce.store.configureStorefront({
product_url_template: "https://example.com/shop/{handle}",
brand: "Acme",
return_policy_url: "https://example.com/returns",
return_window_days: 30,
agent_access: true, // opt in to the public agent API
});
store.feeds; // { acp: ".../acp.json", google: ".../google.xml", agent: ".../agent/store_..." }- acp.json follows OpenAI's product feed format. google.xml is a Google Merchant Center feed.
- With
agent_access, outside shopping agents can search your catalog and create a checkout link for their user to pay on Stripe. These endpoints are rate limited and hold stock only for a short time.