Create and manage API tokens
Outcome: a tool or agent that can’t use the browser sign-in can read your store’s ShopMD files with a token you control, and you can switch it off at any time.
Before you start
Section titled “Before you start”- You need a ShopMD account with at least one store linked to it. A store is linked when the app is installed while you’re signed in to shopmd.ai. See Install the Shopify app.
- If your AI assistant supports signing in through the browser, you may not need a token. See Connect an AI assistant over MCP.
What a token can do
Section titled “What a token can do”- It’s created for one store. Over MCP, a token acts only on its store.
- It’s read only. It can read your files, including
store.md, and ask questions about them. It can’t change anything. - It’s sent as a header:
Authorization: Bearer <YOUR_TOKEN>. - Tokens start with
shopmd_.
Create a token
Section titled “Create a token”-
Open your dashboard. Sign in on shopmd.ai, open your dashboard and choose API Tokens.
-
Fill in Create API token. The fields aren’t labelled:
- A name, in the box that says “Token name (e.g. CI reader)”. Pick something that tells you where it’s used.
- The store, from the first menu.
- An expiry, from the second menu: Never, 30 days, 90 days or 365 days.
-
Press Create token. The token appears once, under “Copy your token now — you won’t be able to see it again.” Press Copy and put it where it’s needed, such as your MCP client’s config or a secret store.
-
Press Dismiss. The token is gone from the screen for good. ShopMD keeps only a fingerprint of it.
For an MCP client, the MCP tab has a shortcut: Generate MCP token creates a token named “MCP client” and drops it straight into a config you can copy.
What you’ll see
Section titled “What you’ll see”Under Your tokens, each token shows its name, the first characters of the token, its store, when it was created, when it expires, when it was last used, and its status: Active, Revoked or Expired.
Revoke a token
Section titled “Revoke a token”- Find the token under Your tokens.
- Press Revoke and confirm.
- Anything still using it gets “Unauthorized” from then on.
Revoking can’t be undone. To restore access, create a new token and update the tool that used the old one.
If something goes wrong
Section titled “If something goes wrong”| What you see | What to do |
|---|---|
| “Install and link a Shopify store to create per-shop API tokens.” | No store is linked to this account. Install the app while signed in. |
| “Shop not installed or not linked to your account” | The store’s app was removed, or it’s linked to another account. Install it again while signed in. |
| “Token limit reached (max 20).” | Revoke tokens you no longer use, then create the new one. |
| “Token creation limit exceeded. Try again in 60 seconds.” | Wait a minute. |
| “Your session expired. Reload the page to sign in again.” | Reload and sign in. |
| A tool gets “Unauthorized” | The token was revoked, has expired, or was copied incompletely; or the app was uninstalled from the store, or the store is now linked to another ShopMD account. Check its status under Your tokens. |