REST API
ShopMD doesn’t offer a REST API for integrators yet. ShopMD API tokens are used with the MCP server, and a store’s published files are at its storefront URLs.
Use a token with the MCP server
Section titled “Use a token with the MCP server”Over MCP, a token acts only on its store. It’s read-only, starts with shopmd_, and is sent as
Authorization: Bearer <token>. Create, expire and revoke tokens in your dashboard; see
Create and manage API tokens.
MCP runs over ordinary HTTP, so a script can call it without an AI client. Send JSON-RPC to
https://shopmd.ai/mcp:
curl https://shopmd.ai/mcp \ -H "Authorization: Bearer $SHOPMD_TOKEN" \ -H "Content-Type: application/json" \ -H "Accept: application/json, text/event-stream" \ -d '{ "jsonrpc": "2.0", "id": 1, "method": "tools/call", "params": { "name": "get_artifact", "arguments": { "type": "policies" } } }'The server is stateless, so a single tools/call works without a prior handshake. The reply can arrive as a
server-sent event: a line event: message followed by data: {…} holding the JSON-RPC result. The tool’s
output is in result.structuredContent and result.content. Tools, errors and rate limits are on
MCP server.
Keep the token in an environment variable or a secret store, not in the script.