Odel
retailcrm mcp

retailcrm mcp

Local
@theyahia1TypeScriptMITUpdated 2mo ago

MCP server for RetailCRM — orders, customers management via API v5.

@theyahia/retailcrm-mcp

Production-grade MCP server for RetailCRM e-commerce CRM. 39 tools + 2 prompt skills for managing orders, customers, products, inventory, payments, tasks, references, and analytics via API v5.

npm Smithery

Output is token-efficient by default

Read tools return a compact, shaped summary of only the fields an agent needs — not the full RetailCRM payload. Control verbosity per call:

ParamEffect
(default)detail:"summary" — essential fields + a pagination block
detail:"full"All shaped fields (line items, delivery, payments, address…)
raw:trueThe untouched RetailCRM response (for debugging)

⚠️ v3 is a breaking change vs v2: default output is now the shaped summary instead of raw JSON. Pass raw:true to restore the old payload.

Tools (39)

Orders

ToolDescription
list_ordersList orders by status, customer, number, date range
get_orderGet one order by ID or externalId
create_orderCreate an order; link an existing customer (customer_id/customer_external_id) or create one inline
update_orderUpdate status, customer, delivery, comments
orders_historyOrder change history incl. status transitions (incremental sync)

Customers

ToolDescription
list_customersSearch customers by name, email, phone, date
get_customerGet one customer by ID or externalId
create_customerCreate a customer
update_customerEdit an existing customer
merge_customersMerge duplicates (destructive)
customers_historyCustomer change log (growth/churn, incremental sync)

Products & inventory

ToolDescription
list_productsCatalog products by name, group, active, price
list_product_groupsProduct category tree
store_inventoriesStock levels & cost prices per offer/warehouse

Payments

ToolDescription
order_payment_createRecord a payment on an order
order_payment_editEdit a payment
order_payment_deleteDelete a payment (destructive)

Notes & tasks

ToolDescription
customer_notes_list / customer_notes_create / customer_notes_deleteFree-text customer notes
tasks_list / tasks_create / tasks_editFollow-up tasks/reminders

Marketing & finance

ToolDescription
list_segmentsCustomer segments (RFM/marketing cohorts)
list_costs / create_costExpense records for margin analytics

Files

ToolDescription
files_list / files_get / files_uploadAttach & retrieve files (raw octet-stream upload)

References

ToolDescription
list_statuses / list_delivery_types / list_payment_types / list_storesOrder/delivery/payment/store reference data
list_sitesSites the API key can act on (fill the site param)
list_countries / list_order_types / list_order_methodsAddress & order reference data

Analytics

ToolDescription
get_orders_summaryPeriod-scoped order stats: exact count + revenue, AOV, status distribution
get_customers_summaryNew-customer count for a date range

Prompt Skills (2)

SkillDescription
new-ordersQuick daily overview of today's orders
customer-searchFind a customer by name, email, or phone

Setup

  1. In RetailCRM, go to Settings > Integration > API keys.
  2. Create an API key with the required permissions (orders, customers, store, references). For a multi-site key, pass the site code on create/edit tools (see list_sites).
  3. Note your domain (the yourstore part of yourstore.retailcrm.ru).

Environment Variables

VariableRequiredDescription
RETAILCRM_DOMAINYesYour RetailCRM domain (e.g. yourstore.retailcrm.ru)
RETAILCRM_API_KEYYesAPI key (sent via the X-API-KEY header)
RETAILCRM_READONLYNo1 to expose only read tools (hide create/update/merge/delete)
RETAILCRM_RATE_LIMITNoClient-side requests/second cap (RetailCRM allows ~10/s)
PORT / HOSTNoHTTP server bind (default 3000 / 127.0.0.1, --http mode only)
RETAILCRM_HTTP_ALLOWED_HOSTSNoComma-separated allowed Host values for DNS-rebinding protection
RETAILCRM_DNS_PROTECTIONNooff to disable DNS-rebinding protection (HTTP mode)

RETAILCRM_URL is still accepted as a fallback for RETAILCRM_DOMAIN.

Usage with Claude Desktop

{
  "mcpServers": {
    "retailcrm": {
      "command": "npx",
      "args": ["-y", "@theyahia/retailcrm-mcp"],
      "env": {
        "RETAILCRM_DOMAIN": "yourstore.retailcrm.ru",
        "RETAILCRM_API_KEY": "your-api-key"
      }
    }
  }
}

Streamable HTTP Mode

Run as an HTTP server instead of stdio:

RETAILCRM_DOMAIN=yourstore.retailcrm.ru \
RETAILCRM_API_KEY=your-key \
npx @theyahia/retailcrm-mcp --http
  • POST /mcp — MCP Streamable HTTP endpoint (stateless: a fresh server is created per request)
  • GET /health — health check (JSON with version, tool count)
  • GET/DELETE /mcp405 (not used in stateless mode)
  • Default bind: 127.0.0.1:3000. DNS-rebinding protection is on by default for local binds.

Smithery

npx @smithery/cli install @theyahia/retailcrm-mcp

Demo Prompts

1. Daily order overview: "Show me all orders created today with status 'new'. Summarize the total count and revenue."

2. Customer lookup and order history: "Find the customer with email anna@example.com. Show their full profile and recent orders."

3. Stock check: "Is the product with externalId SKU-42 in stock, and in which warehouse?"

Webhooks / Triggers

RetailCRM does not support API-created webhooks. Use Triggers in the admin panel (Settings > Triggers) to send HTTP requests to external endpoints on order/customer events.

Error Handling

  • Rate limits / 5xx: automatic retry with exponential backoff + jitter (up to 3 attempts).
  • API errors: RetailCRM error details are parsed and returned to the model as a tool result with isError: true, so the agent can self-correct (e.g. retry with by:"externalId").
  • Timeouts: 15-second per-request timeout with retry.

Development

npm install
npm test          # vitest (mock-based; no live API key needed)
npm run lint      # eslint
npm run typecheck # tsc --noEmit
npm run dev       # stdio dev mode (tsx)
npm run build     # clean + compile to dist/

License

MIT