Skip to main content
Connect your agent to one URL, https://mcp.opencommerce.sh/mcp, and it can search stores, build carts, get each shopper’s approval and place orders for your shoppers. You install no SDK. No model runs on the server: your agent calls the tools, and Agentcard does the shopping. The server speaks Streamable HTTP and keeps no session: every request carries its own credentials. If your agent runs in TypeScript and you want to control each reply and link, use the Commerce SDK. For plain HTTP from any language, see Make your first purchase over HTTP.

Get your credentials

The server takes the same credentials as the Commerce SDK: a client ID and a client secret. Sign in with the Agentcard CLI, where a new email creates your account, and copy your sandbox credentials:
Sandbox credentials reach the sandbox, Agentcard’s test mode, where stores decline at checkout and nothing is charged. Production credentials place real orders. You switch by changing the credentials alone: the URL and the tools stay the same. Keep the client secret on your server, never in a browser, a mobile app or a prompt, because anyone who holds it can shop as your company.

Connect a client

Send the credentials in the Authorization header, as Bearer <YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>, or as Basic with the base64 of <YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>. A request with missing or refused credentials gets 401. The examples read the credentials from AGENTCARD_CLIENT_ID and AGENTCARD_CLIENT_SECRET, so no secret lands in a file you commit.
Run claude mcp list. The server shows as connected once Agentcard accepts the header.
ChatGPT can’t connect yet: its custom connectors send no fixed Authorization header, and the server has no OAuth sign-in. Claude’s custom connectors on claude.ai and Claude Desktop take the header, but with no server of yours in between, the model picks the shopper and chat ids, so use them to try the server and not to serve shoppers.

Set the shopper and chat ids

Every tool that acts for a shopper takes two ids that you own. shopper_id is your own id for the person, the same on every call for that person and different for every person. thread_id is your id for the chat, and Agentcard keeps one open purchase for each shopper and chat. Fill both in on your server, never in the model. A model that invents shopper_id can send one shopper’s cart to another. With the AI SDK, wrap each tool so your ids overwrite whatever the model sent:
agentcard-mcp.ts
Pass toolsFor(shopperId, chatId) to generateText or streamText, and call await mcp.close() when your server shuts down. Tools that take no ids, such as get_account, stay untouched.

Make a first buy call

Call get_account first. It returns your client_id and sandbox: true when the credentials are sandbox ones:
Then call buy with the shopper’s own words in ask:
The result holds products to show the shopper, each with a product_id you send back when the shopper picks one. Set confirm to true only on the shopper’s yes to the cart you showed. In the sandbox the confirm stops at the store’s checkout, and nothing is charged. Each buy call answers within about 45 seconds. When turn_continues is true, Agentcard is still working: read get_updates later, and never send the same buy again.

Keep going