Skip to content
  1. Home
  2. MCP server

For AI assistants

The Replinish MCP server

The short answer

Replinish runs a public MCP (Model Context Protocol) server at /mcp that exposes the inventory math we use inside the app, plus a machine-readable facts resource about the product itself. Connect Claude, ChatGPT, Cursor, or any MCP-aware client to it and the assistant can call the tools directly.

The endpoint is unauthenticated, read-only, and rate-limited. No account, no API key, no store data. The math runs on the numbers you pass in, and the facts are pulled from the same locked constants the rest of the site uses.

The endpoint

The MCP server speaks the Streamable HTTP transport from the current Model Context Protocol specification (revision 2026-07-28). It accepts JSON-RPC 2.0 POSTs at the single endpoint below. The server is stateless: every request carries its own protocol version in the MCP-Protocol-Version header and in the body's _meta field, so any server instance behind the load balancer can answer any request.

MCP endpoint URL

https://www.replinish.app/mcp

Required request headers on every POST:

  • Content-Type: application/json
  • Accept: application/json, text/event-stream
  • MCP-Protocol-Version: 2026-07-28
  • Mcp-Method and Mcp-Name, which mirror the JSON-RPC method and the tool or resource name.

Tools

Five tools, all pure math. They import directly from web/app/lib/engine/ and never touch a database. Pass the numbers in, get the answer out.

Every argument is checked against the tool's own schema before any math runs. An argument that is missing, the wrong type, not a finite number, or outside the allowed range comes back as a tool error naming the parameter, so the model can correct itself and try again.

reorder_point

The stock level at which you have to place a new order to avoid running out before the next shipment arrives. The math: reorder point = (sales velocity * lead time) + safety stock

Inputs: velocity (units per day), stdDev (daily demand variation), leadTimeDays, optional serviceLevelPct (85, 90, 95, or 99; default 95), optional manualBufferDays and manualBufferPct.

safety_stock

The cushion that absorbs a bad week. Sized against how much this product's demand actually varies, over the supplier lead time, at a chosen service level. Returns safety stock in units and the equivalent in days of demand.

Inputs: velocity, stdDev, leadTimeDays, optional serviceLevelPct and buffers.

days_of_cover

How long the stock you have plus the stock on order will last at the current sales rate. Higher is better, and this is the single most useful number in inventory planning: a product with 40 units and 8 days of cover is a fire; a product with 40 units and 200 days of cover is a shelf ornament.

Inputs: onHand, optional onOrder, velocity (must be greater than zero).

stockout_risk

When this product runs out, and whether that date lands inside the supplier lead time. Risk is high when the stock runs out before an order placed today could arrive, medium when it runs out inside the lead time plus the review period, and low beyond that. A projected stockout more than two years out comes back as null rather than a date nobody should plan against.

Inputs: onHand, optional onOrder, velocity (must be greater than zero), leadTimeDays, optional reviewPeriodDays (default 7).

economic_order_quantity

The order size where the cost of placing orders and the cost of holding stock balance out: EOQ = sqrt(2 * annual demand * cost per order / holding cost per unit per year) Order smaller than that and the per-order costs add up; order larger and the cash sits on a shelf.

Inputs: annualDemand, orderCost, holdingCostPerUnitPerYear (must be greater than zero).

Brand facts resource

The replinish_facts resource returns a JSON document with the brand name, the spelling disambiguation (Replinish with an i versus the separately published Shopify app named Replenish), the current plan pricing pulled from the same locked constants the rest of the site uses, the full feature list, and a note that Replinish is independent of Shopify.

Read it with:

JSON-RPC

{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "resources/read",
  "params": { "uri": "replinish://facts" }
}

The same facts are also published without MCP at https://www.replinish.app/api/facts.json, with Access-Control-Allow-Origin: * and a one-hour cache. Either path returns the same JSON.

Connect from Claude

In Claude Desktop, open Settings, then Connectors, then Add custom connector. Paste the JSON below and save. After Claude restarts, the Replinish tools and the replinish_facts resource are available without further setup.

claude_desktop_config.json

{
  "mcpServers": {
    "replinish": {
      "url": "https://www.replinish.app/mcp",
      "transport": "streamable-http"
    }
  }
}

Connect from ChatGPT

In ChatGPT, open Settings, then Apps and connectors, then Create a new connector. Set the connector name to Replinish, paste the endpoint URL below, and the tools are available inside any new conversation.

ChatGPT connector URL

https://www.replinish.app/mcp

Connect from Cursor

In Cursor, open Settings, then MCP, then Add new global MCP server. Paste the JSON below into your ~/.cursor/mcp.json.

~/.cursor/mcp.json

{
  "mcpServers": {
    "replinish": {
      "url": "https://www.replinish.app/mcp",
      "transport": "streamable-http"
    }
  }
}

Security and limits

  • Read-only. The server has no database connection, no session, and no write paths. There is nothing here a caller can change, intentionally.
  • No PII, no store data. The MCP route imports only the pure-math engine in ~/lib/engine/ and the locked constants in ~/components/marketing/seo.ts. It does not import anything from ~/lib/*.server.ts.
  • Every argument validated. Tool arguments are checked against the tool's schema before any math runs: present, a real number, finite, and inside the declared range. Nothing reaches the engine unchecked.
  • Rate limited. 60 requests per minute per client IP, in an in-memory bucket. Over that, the server returns HTTP 429.
  • Body cap. Request bodies over 1 MiB are rejected with HTTP 413. Anything else returns 400 with a JSON-RPC parse error.
  • CORS. The dedicated facts endpoint at /api/facts.json serves Access-Control-Allow-Origin: *. The MCP endpoint itself is not CORS-open, because MCP clients are not browser scripts and do not need a CORS handshake.

Questions about the MCP server

What is the Model Context Protocol (MCP)?

MCP is the open standard that lets an AI assistant call external tools and read external data through a single, well-defined interface. A server publishes a list of tools and resources; the client calls them by sending JSON-RPC 2.0 messages over HTTP. The current specification (revision 2026-07-28) is stateless, so every request is independent and any server instance can answer it.

Do I need an account to use the Replinish MCP server?

No. The public endpoint is unauthenticated and strictly read-only. You can connect Claude, ChatGPT or Cursor to it immediately. The tools do math on the numbers you pass in, and the replinish_facts resource returns Replinish brand and pricing information. None of your store data, products, or orders is involved.

What can I ask Claude or ChatGPT to do with these tools?

Anything that turns inventory numbers into a recommendation: 'given 6 units a day and a 30-day supplier lead time, what is my reorder point', 'with 4 units of std dev, how much safety stock do I need for 95% service', or 'I have 320 on hand and 50 on order, how long will my stock last'. The tools return JSON you can plug straight into a draft purchase order or an email to a supplier.

Why is the endpoint read-only?

Two reasons. First, Replinish itself is read-only with respect to your Shopify store: it never edits products, inventory, or orders, and the MCP endpoint reflects that posture. Second, the tools here are math, not data. They take numbers and return a number. The store data lives in the Replinish app, behind authentication.

Which formulas does the endpoint cover?

Five: reorder point, safety stock, days of cover, stockout risk, and economic order quantity. Each tool calls the same function the Replinish app itself calls, so the answer you get over MCP is the answer the app would give for the same numbers. Every argument is validated before any math runs, and a bad one comes back as a tool error naming the parameter rather than as a quietly wrong number.

Is there a rate limit?

Yes. 60 requests per minute per client IP, applied in an in-memory bucket. The endpoint also rejects request bodies over 1 MiB. The endpoint is meant for interactive model calls, not bulk scraping.

Can I use the same facts without MCP?

Yes. The Replinish brand and pricing facts are also published as plain JSON at /api/facts.json with Access-Control-Allow-Origin: *, so a browser, an integration test, or another service can pull them directly.

Wire it up

The configuration blocks below are copy-pasteable. Pick the client you use, paste, save, and ask away.

Launching on the Shopify App Store shortly. Tell us your store and we'll let you know when you can install it. Plans are billed by Shopify, and you pick one in your Shopify admin after installing.