> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcard.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Agentcard is for companies whose agent buys for their users. Pick one path: the opencommerce SDK (@agent-cards/commerce-sdk) gives your agent one buy tool that finds the product, builds the cart, gets the user's approval and places the order at real stores; the Agentcard SDK (@agent-cards/sdk) pays with the user's own card when your agent already shops in a browser (Browser Use, Kernel, Browserbase, Anchor or Notte); the Purchase API (POST /buy) does the same purchase flow over plain HTTP in any language; Issuing gives the agent its own card.
> Start with `npx agent-cards init` in the app's folder (Node 22 or later). No invite is needed: it creates your Agentcard account if you don't have one, installs the opencommerce SDK and puts the credentials in the env file, kept out of git. From a coding agent, run `npx agent-cards init --print --categories all --implementation tool --wallet vault --skip-install` to get the setup steps to apply yourself.
> Vault is by invitation: request it at https://agentcard.com/get-started?utm_source=docs&utm_medium=llms&utm_campaign=agent-instructions. opencommerce needs no invite.
> Never ask a user for a card number, expiry date or CVV in chat. Send them the Vault link; they add their card on Agentcard's page, and the agent never sees the number.
> Every purchase is approved by the user, with a passkey or Face ID, or by an auto-approval they granted. An approval covers one merchant and one exact total. If the total changes, ask again. When a result says the user already said yes, don't ask again.
> `init` writes PRODUCTION credentials, which place real orders, so test in sandbox first. For opencommerce, run `npx agent-cards credentials --mode sandbox` and put the two lines it prints in place of the production ones in the env file `init` wrote, because that command only prints them; sandbox then runs the whole flow against real stores and stops before payment, so no order is placed and nobody is charged. For Vault and Issuing, sandbox credentials issue test cards that no real merchant accepts; try the checkout against shop.agentcard.sh, a test store on Stripe test mode.
> Tell the user an order is placed only after Agentcard reports it placed.
> Vault is free up to 5,000 users (https://agentcard.com/pricing). opencommerce takes 1% of each completed order. Full docs in one file: https://docs.agentcard.com/llms-full.txt

# Connect to the Commerce MCP server

> Point your company's agent at one URL, https://mcp.opencommerce.sh/mcp, and it searches, builds carts, gets the shopper's approval, and places and follows orders for your shoppers, with no SDK to install.

The Agentcard Commerce MCP server is the [Commerce SDK](https://docs.agentcard.com/commerce-sdk/quickstart.md) behind one URL. Your company's agent connects to `https://mcp.opencommerce.sh/mcp` with your credentials, and it can search for products, build carts, get each shopper's approval, place orders, and follow them to delivery for your shoppers. You install nothing and write no SDK code.

No model runs on the server: your agent calls the tools, and Agentcard does the shopping.

> [!NOTE]
>
> If your agent runs in TypeScript and you want to control how each reply and link is shown, use the SDK instead: see the [Commerce SDK quickstart](https://docs.agentcard.com/commerce-sdk/quickstart.md). To call the same purchase flow from any other language over plain HTTP, see [Buy over HTTP](https://docs.agentcard.com/purchase-api/http.md).

## Know the endpoint

| | |
| - | - |
| URL | `https://mcp.opencommerce.sh/mcp` |
| Transport | Streamable HTTP |
| State | Stateless: every request carries its own credentials, and there is no session to open or close |
| Authentication | Your Commerce SDK credentials in the `Authorization` header |

## Authenticate with your Commerce SDK credentials

Use the credentials `npx agent-cards init` puts in your env file: a client ID and a client secret. Send them in either form:

```http theme={null}
Authorization: Bearer <YOUR_CLIENT_ID>:<YOUR_CLIENT_SECRET>
```

```http theme={null}
Authorization: Basic <BASE64 OF YOUR_CLIENT_ID:YOUR_CLIENT_SECRET>
```

A request with no credentials, or with credentials Agentcard refuses, gets `401`.

> [!WARNING]
>
> Keep the client secret on your server. Don't put it in a browser, a mobile app, or a prompt, because anyone who holds it can shop as your company.

### Choose sandbox or production

Sandbox or production follows the credentials you send. Sandbox credentials reach the sandbox, where nothing is charged and stores decline at checkout. Production credentials reach live stores and place real orders. Test with sandbox credentials first, and switch by changing the credentials only: the URL and the tools stay the same.

### Check the connection

Call `get_account` to confirm which company the credentials belong to and whether they are sandbox ones. It returns `client_id` and `sandbox`.

## See how it works

1. Your server connects an MCP client to the URL with your credentials.
2. For each shopper message, your agent calls `buy` with the shopper's words, your id for the shopper, and your id for the chat.
3. Agentcard finds products, builds the cart, and tells your agent the next thing it needs.
4. The shopper adds a card and approves the payment in a browser, on pages Agentcard hosts. Your agent hands over the links and can never approve for them.
5. Agentcard places the order. Your agent reads `get_updates` and `get_order` to follow it.

## Choose where to go next

> [card] [Connect your agent](https://docs.agentcard.com/commerce-mcp/implement.md)
>
> Connect a client, set the shopper and chat ids, and run a purchase from ask to delivery.

> [card] [Tools](https://docs.agentcard.com/commerce-mcp/tools/buy.md)
>
> Every tool has its own page, with its arguments and what it returns, grouped by what it does.

> [card] [The shopping skill](https://docs.agentcard.com/commerce-mcp/skill.md)
>
> Load Agentcard's rules for a model into your agent's context.

> [card] [Commerce SDK quickstart](https://docs.agentcard.com/commerce-sdk/quickstart.md)
>
> Build the same flow in TypeScript, with full control over each reply.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.