MCP server
The ShopMD MCP server lets an AI client list and read a store’s files directly. This page is the reference. To add it to Claude, ChatGPT or Cursor, follow Connect an AI assistant over MCP.
https://shopmd.ai/mcpTransport
Section titled “Transport”- Streamable HTTP at one URL. There’s no local server to run. Clients that can only start local
commands can bridge to it with
mcp-remote, as shown in the connection guide. - Stateless. Every request stands alone, so there’s no session to keep alive or resume.
- The endpoint itself needs no credential. Anyone can connect and call the public tools. The signed-in tools check the caller’s credential on every call.
| Tool | Credential | Input | Returns |
|---|---|---|---|
list-documents |
None | domain |
The files a store publishes on its storefront |
read-document |
None | domain, type |
One published file, with outline and token estimate |
list_artifacts |
Required | None | Which files exist for your store |
get_artifact |
Required | type |
One of your store’s files, including store.md |
ask |
Required | question |
An answer grounded in your store’s files |
Every tool is read-only. Each result has a short text summary in content for the model, and the full data in
structuredContent. Clients that support MCP app views show list-documents, read-document and
get_artifact results in a list or reader view.
list-documents
Section titled “list-documents”Lists the files a store publishes on its storefront.
| Input | Type | Notes |
|---|---|---|
domain |
string | The store’s .myshopify.com address, such as your-store.myshopify.com. Any other domain returns an empty list. |
{ "status": "ok", "store": { "domain": "your-store.myshopify.com" }, "documents": [ { "type": "policies", "title": "Store policies", "summary": "First paragraph of the file…", "sections": 9, "tokens": 2140 } ]}sections counts level-2 and level-3 headings. tokens is a rough estimate (characters ÷ 4). The text
summary reads like “6 published for your-store.myshopify.com: shop, design, brand, catalog, policies, agents.”
or “No published documents are available for your-store.myshopify.com.”
read-document
Section titled “read-document”Reads one published file.
| Input | Type | Notes |
|---|---|---|
domain |
string | The store’s .myshopify.com address |
type |
string | A type returned by list-documents |
{ "status": "ok", "store": { "domain": "your-store.myshopify.com" }, "requested": "policies", "document": { "type": "policies", "title": "Store policies", "summary": "First paragraph of the file…", "sections": 9, "tokens": 2140, "markdown": "# Policies…", "outline": [ { "level": 2, "text": "Returns", "slug": "returns" } ] }}The full file is in document.markdown. The text content holds only the title, the section count, the token
estimate and the summary, so read structuredContent when you need the whole file.
When the file isn’t available, document is null and the text says
No published "policies" document is available for your-store.myshopify.com. That’s the answer for a file
that was never generated, one the merchant withdrew, store.md, and a store that publishes nothing.
What “published” means for the public tools
Section titled “What “published” means for the public tools”list-documents and read-document return the same bytes as the store’s
storefront URLs, and only files the storefront is
actually serving at that moment. A file stored by ShopMD but not reachable on the storefront, for example
behind a storefront password, isn’t returned. The storefront check is reused for up to five minutes, so a
withdrawal or restore can take that long to show here.
list_artifacts
Section titled “list_artifacts”Lists which of the seven files exist for your store. Takes no input.
{ "domain": "your-store.myshopify.com", "artifacts": ["design", "catalog", "brand", "store", "policies", "agents", "shop"] }The text reads your-store.myshopify.com: design, catalog, …. or ends in none. when nothing exists yet.
get_artifact
Section titled “get_artifact”Returns one of your store’s files.
| Input | Type | Notes |
|---|---|---|
type |
enum | design, catalog, brand, store, policies, agents or shop |
The full Markdown is in the text content. structuredContent has the same shape as read-document:
status, store, requested and document. If the file doesn’t exist yet, document is null and the text
says No <type> artifact exists for your store yet.
What it returns differs from the public tools:
- It reads ShopMD’s stored, published copy with your section edits applied. That includes
store.mdand files you’ve withdrawn from the storefront. Drafts waiting for approval aren’t returned. - For
catalog, it returns the catalog’s machine-readable data instead ofcatalog.md’s prose: three sections,## products,## collectionsand## price-index, each in TOON format.
Answers a question about your store, using only its generated files.
| Input | Type | Notes |
|---|---|---|
question |
string | A question about your store |
{ "answer": "Returns are accepted within 30 days of delivery.", "sources": [{ "artifact": "policies", "section": "Returns" }], "confidence": "certain"}confidence |
Meaning |
|---|---|
certain |
The files state it directly |
likely |
Inferred from what the files say |
not_covered |
The files don’t answer it |
refused |
The question isn’t about this store, so it wasn’t answered |
sources[].artifact is one of store, brand, policies, design, catalog or shop, and
sources[].section is the heading the claim came from. If the store has no files yet, or the answer can’t be produced, the tool returns an error
instead.
Authentication
Section titled “Authentication”The public tools need nothing. The three signed-in tools accept either credential below, sent as
Authorization: Bearer <credential> on the HTTP request. Over MCP, a credential acts only on its
store: the signed-in tools always act on that store, and none of them takes a domain.
OAuth (browser sign-in)
Section titled “OAuth (browser sign-in)”Most clients handle this for you. From the client’s side:
- The signed-in tools advertise the
oauth2scheme with scopemcp:read. When one is called without a credential, its error result carries aWWW-Authenticate-style challenge in_meta["mcp/www_authenticate"], pointing at the resource metadata. - The client reads the protected-resource metadata at
https://shopmd.ai/.well-known/oauth-protected-resource/mcp, which nameshttps://shopmd.aias the authorization server, and its metadata athttps://shopmd.ai/.well-known/oauth-authorization-server. - The client identifies itself, either with dynamic client registration or a client ID metadata document.
- The client runs an OAuth 2.1 authorization-code flow with PKCE. The user signs in to ShopMD, picks a store if they have more than one, and approves. See Sign in and pick a store.
- The client sends the access token as a bearer token. Request
offline_accessas well to receive a refresh token.
Each client is connected to one store at a time. Approving the same client for another store replaces the connection.
API token
Section titled “API token”Clients that can set a header can skip the browser flow and send a ShopMD API token:
Authorization: Bearer shopmd_…Over MCP, a token acts only on its store. It’s read-only. Create and revoke tokens in your dashboard; see Create and manage API tokens.
When a credential stops working
Section titled “When a credential stops working”A token or sign-in stops working when it’s revoked or expires, when the app is uninstalled from the store, or when the store is linked to another ShopMD account. The tool then answers:
Unauthorized: sign in, or supply a valid ShopMD API token, to use this tool.Rate limits
Section titled “Rate limits”| Limit | Applies to | What you get |
|---|---|---|
| Per IP address, per minute | Every HTTP request to /mcp, including connection set-up and tool listing |
HTTP 429 with {"error": "IP rate limit exceeded. Try again in 60 seconds."} |
| About 60 calls a minute per API token or signed-in account | Signed-in tool calls | A tool error: Token rate limit exceeded. Try again in 60 seconds. |
In both cases, wait a minute and retry. A rate-limit refusal never asks the user to sign in again.
Errors
Section titled “Errors”Tool failures come back as tool results with isError: true, not as protocol errors:
| Text | Meaning |
|---|---|
Unauthorized: sign in, or supply a valid ShopMD API token, to use this tool. |
No valid credential on a signed-in tool |
Token rate limit exceeded. Try again in 60 seconds. |
Per-credential limit reached |
Something went wrong reading this store. Please try again. |
A temporary failure on ShopMD’s side. structuredContent.status is "error". |
structuredContent.status tells a failure apart from an empty answer: "ok" with no documents means the
store publishes nothing, while "error" means ShopMD couldn’t find out. Don’t report a store as having no
files on an "error".
Apart from standard MCP protocol errors for malformed requests, the main HTTP-level error is the per-IP
429 above.