MCP server
The MCP server reference - the endpoint, keys, the tools each key reaches, calling it directly, the protocol details, errors and limits.
Every store has an MCP (Model Context Protocol) server. An AI client connected to it can read the store's products, orders and sales, and, with a key that can edit, rewrite product copy and change prices. It gets the same store tools as Starsell AI, the assistant built into the admin.
This page is the technical side. To connect a client, step by step, see Use your own AI.
Endpoint
https://<admin host>/api/mcpOne address serves every store: the key decides which store a client reaches. Starsell AI > Use your own AI in the admin shows it under Server and keys, with a Copy button.
The server speaks MCP's Streamable HTTP transport, statelessly: each POST carries a JSON-RPC 2.0 message and gets a JSON answer. There is no event stream and no session to keep.
Keys
MCP takes the same store keys as the store API: vtk_..., sent as Authorization: Bearer <key>. Make one under API and MCP keys in Settings > API and webhooks, or under Server and keys on Starsell AI > Use your own AI. It is one list; a key made in either place works in both.
Two rules are specific to MCP:
- The member who made the key needs Starsell AI access in the store, checked on every call. Take it away and their keys stop working over MCP (they keep working on the store API, which doesn't need it).
- A Read only key gets the read tools. A key that Can edit also gets the two write tools.
On top of that, a tool that needs a permission the key's maker doesn't have is left out of the list, the same way the store API answers 403.
A key that can edit changes the live store
In Starsell AI, a proposed price or copy change comes back as a card the merchant applies or skips. Over MCP, update_price and update_product_copy write at once. Give an AI client a Read only key unless you want it to edit, and leave the client's confirm-before-running setting on.
Tools
Read tools
Every key gets these, as far as its maker's permissions go.
| Tool | Returns | Arguments | Needs |
|---|---|---|---|
list_products | Every product with its versions' prices, costs and margin after costs, its status, its source, and which of the store's languages are missing a description. | none | - |
get_product | One product: title and description in every language, type, tags, source, and every version with SKU, price, compare-at price, cost, shipping cost, margin and stock. | product_id | - |
list_orders | Recent orders, newest first: number, date, status, payment, fulfillment, total, channel, tracking, items. | days (1 to 365), status (any, open, fulfilled, cancelled), fulfillment (any, unfulfilled, sent_to_supplier, shipped, delivered, returned), limit (1 to 50) | Orders |
get_order | One order by its number, with items and their costs, subtotal, shipping, total, profit, tracking and the order's timeline. | number (as in #1042, pass 1042) | Orders |
sales_summary | Orders, sales and profit over the last N days, and the 5 best sellers by units. Cancelled orders are left out. | days (1 to 90) | - |
Customer details in list_orders (name and country) and get_order (the full customer) need the Customers permission too. Without it they are left out and the result says why.
Write tools
Only keys that Can edit get these, and the key's maker needs the Products permission.
| Tool | Does | Arguments |
|---|---|---|
update_product_copy | Replaces a product's title and description in one language. | product_id, language (a code the store sells in, such as en, he or fr: the tool's schema lists the store's own), title (1 to 200 characters), description (1 to 5000 characters) |
update_price | Sets a new price for one version of a product. Answers with the old and new price and the margin it leaves. | product_id, variant_id, price in major units of the store currency (109 for ₪109, more than 0 and up to 1,000,000), reason (one sentence) |
Each write goes in the store's activity log as made by the key, with its name (for example MCP key "Claude" changed the price of Linen throw (Sand) from ₪109 to ₪99), sends a product.updated event to webhooks and automations, and moves the product's updated_at, so GET /products?updated_after= picks it up.
What to know about the tools
- Every argument a tool lists is required. Pass
anyforstatusorfulfillmentto not filter. daysandlimitoutside their range are brought into it, not refused. Apriceoutside its range is refused.- Unlike the store API, the tools show costs, margins and profit, so the model can reason about prices. Profit is counted as the admin counts it: the total less tax, product cost, shipping cost and the card fee. A refunded order's profit is minus its shipping cost.
- Money in tool results is in major units: plain numbers in the product tools (
"price": 109), formatted text in the order and sales tools ("total": "₪247"). - Read tools are marked
readOnlyHint: trueand write toolsdestructiveHint: true, so clients can tell which ones to confirm with you first. - On connect, the server tells the model the store's name, currency and languages, and, for a key that can edit, to confirm with the person before it changes anything.
Set up a client
Use your own AI has the setup for each client: Claude Code, Claude Desktop and claude.ai, Cursor, VS Code, Windsurf, Codex and Gemini CLI, with one-click installs where the client has them, and why ChatGPT can't connect. Name the server after the store, as the admin does: starsell-<store slug>.
Any client that speaks Streamable HTTP and can set a request header works: give it the endpoint and Authorization: Bearer vtk_.... The server has no OAuth sign-in, so a client that only connects to remote servers through OAuth can't use it. A client that only runs local (stdio) servers can connect through mcp-remote.
Once connected, the key's line in the key list shows the client that last connected with it, such as Claude Code.
Calling it directly
Each request is a JSON-RPC 2.0 message in a POST. You can try the server with curl:
curl https://<admin host>/api/mcp \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{"protocolVersion":"2025-06-18","capabilities":{},"clientInfo":{"name":"my-script"}}}'{
"jsonrpc": "2.0",
"id": 1,
"result": {
"protocolVersion": "2025-06-18",
"capabilities": { "tools": { "listChanged": false } },
"serverInfo": { "name": "starsell", "title": "Starsell", "version": "1.0.0" },
"instructions": "Tools for the store \"Lumen Home\" on Starsell. Prices are in ILS; the store sells in he, en. This key reads only."
}
}Then call a tool. No session id is needed, every request stands alone:
curl https://<admin host>/api/mcp \
-H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"sales_summary","arguments":{"days":7}}}'{
"jsonrpc": "2.0",
"id": 2,
"result": {
"content": [
{ "type": "text", "text": "{\"days\":7,\"orders\":18,\"sales\":\"₪4,312\",\"profit\":\"₪1,507\",\"top\":[{\"title\":\"Linen throw\",\"units\":9}]}" }
],
"isError": false
}
}Tool results are JSON in a text block. When a tool can't run, the result has isError: true and a sentence the model can act on, such as No such product in this store. or Missing days.
Protocol details
| Methods | initialize, ping, tools/list, tools/call. Anything else answers -32601. |
| Protocol versions | 2025-11-25, 2025-06-18, 2025-03-26, 2024-11-05. initialize answers with the version you asked for, or 2025-11-25 if it doesn't know yours. |
MCP-Protocol-Version header | Optional. A version not in the list above answers 400. |
| Sessions | None. No Mcp-Session-Id, no stream. GET and DELETE answer 405. |
| Notifications | Messages without an id answer 202 with no body. |
| Batches | A JSON array of 1 to 20 messages, answered in order, for clients on 2025-03-26. |
| Body size | Up to 1,000,000 characters. Larger answers 413. |
Origin header | When present, it must be the admin's own origin, or the call answers 403. Web pages on other sites can't call the server from a browser. |
Errors
| HTTP | JSON-RPC code | When |
|---|---|---|
401 | -32001 | "Send Authorization: Bearer <key>. Make a key on the Starsell AI page of your store." (no key), "This key is not valid or was revoked.", or "The member who made this key no longer has Starsell AI in this store." Carries WWW-Authenticate: Bearer realm="starsell", error="invalid_token". |
429 | -32001 | "Too many calls with this key. Wait a minute." With Retry-After: 60. |
400 | -32700 | The body isn't JSON. |
400 | -32600 | An empty batch or one over 20 messages, or an unsupported MCP-Protocol-Version. |
403 | -32600 | An Origin header that isn't the admin's. |
405 | -32600 | A GET or DELETE. Use POST. |
413 | -32600 | A body over 1,000,000 characters. |
200 | -32600 | A message that isn't JSON-RPC 2.0. |
200 | -32601 | An unknown method. |
200 | -32602 | tools/call for a tool the key doesn't reach, or that doesn't exist. |
Rate limit
Each key can make 240 MCP requests a minute. It is a separate count from the store API's: the same key has 240 a minute for each.
- A request is one HTTP
POST, so a batch counts once. - The minute starts with the first request: after the 240th, requests get
429until 60 seconds after that first one.
The call log
Every tools/call is logged with the tool's name, whether it worked, the error if not, and how long it took. Use your own AI lists the latest ones under Recent calls, with the key that made each, and how many calls and failures the store had in the last 24 hours. Store API calls made with the same keys show in the same list, by route (GET /orders). Calls are kept for 30 days.
Related: Use your own AI, Starsell AI, Authentication, API and webhooks settings.