Skip to main content
Glama
Salla MCP Server

Salla MCP Server

by theYahia

salla-mcp

CI

MCP server for the Salla e-commerce platform (Saudi Arabia). Manage products, categories, brands, orders, customers, coupons, branches, and store settings through the Salla Admin API v2 — with OAuth 2.0, automatic token refresh, and rate-limit aware retries.

Tools (22)

Products

Tool

Description

list_products

List products (pagination + status filter)

get_product

Get a product by ID

get_product_by_sku

Get a product by SKU

create_product

Create a new product

update_product

Update an existing product

delete_product

Delete a product

bulk_update_quantities

Bulk-update stock by product/variant ID or SKU

Categories & brands

Tool

Description

list_categories

List categories (keyword + status filter)

get_category

Get a category by ID

create_category

Create a category

list_brands

List brands

Orders

Tool

Description

list_orders

List orders (pagination + status filter)

get_order

Get an order by ID

update_order_status

Update an order's fulfillment status

list_order_statuses

List valid order statuses for the store

get_order_histories

Get an order's status-change timeline

Customers, store & operations

Tool

Description

list_customers

List customers

get_customer

Get a customer by ID

get_store_info

Get store information and settings

list_coupons

List discount coupons

list_abandoned_carts

List abandoned carts

list_branches

List store branches

Related MCP server: Shopify MCP Server

Quick Start

{
  "mcpServers": {
    "salla": {
      "command": "npx",
      "args": ["-y", "@theyahia/salla-mcp"],
      "env": {
        "SALLA_ACCESS_TOKEN": "<YOUR_ACCESS_TOKEN>"
      }
    }
  }
}

Authentication

Salla uses OAuth 2.0. You can run this server in one of two ways.

Option 1 — Static access token (simplest)

Set SALLA_ACCESS_TOKEN. Salla access tokens expire after 14 days, after which calls fail with 401 and you must supply a new token. Good for quick local use; for anything long-running, use auto-refresh below.

Provide your app's OAuth credentials and a refresh token, and the server refreshes the access token automatically — proactively before expiry and reactively on a 401:

{
  "mcpServers": {
    "salla": {
      "command": "npx",
      "args": ["-y", "@theyahia/salla-mcp"],
      "env": {
        "SALLA_CLIENT_ID": "<CLIENT_ID>",
        "SALLA_CLIENT_SECRET": "<CLIENT_SECRET>",
        "SALLA_REFRESH_TOKEN": "<REFRESH_TOKEN>"
      }
    }
  }
}

Salla refresh tokens are single-use and rotate on every refresh (and themselves expire after ~1 month). To survive restarts, the server persists the latest tokens to a token store file (SALLA_TOKEN_STORE, default ~/.salla-mcp/token.json) and reloads them on start. Concurrent refreshes are collapsed into one request, which Salla requires.

Where credentials come from

Create an app in the Salla Partners portal and install it on a store. In Easy Mode, Salla delivers the access token to your app's configured webhook on the app.store.authorize event. In Custom Mode, you take the Client ID / Client Secret from the app's keys and run the standard authorization-code exchange against https://accounts.salla.sa/oauth2/token. See the Salla authorization docs.

Environment Variables

Variable

Required

Default

Description

SALLA_ACCESS_TOKEN

One of these two setups

–

OAuth 2.0 access token

SALLA_CLIENT_ID

For auto-refresh

–

OAuth app client ID

SALLA_CLIENT_SECRET

For auto-refresh

–

OAuth app client secret

SALLA_REFRESH_TOKEN

For auto-refresh

–

OAuth refresh token (rotated on use)

SALLA_TOKEN_STORE

No

~/.salla-mcp/token.json

Where rotated tokens are persisted

SALLA_BASE_URL

No

https://api.salla.dev/admin/v2

API base URL

SALLA_TIMEOUT_MS

No

15000

Per-request timeout

SALLA_MAX_RETRIES

No

3

Retries for 429/5xx responses

SALLA_TOKEN_URL

No

https://accounts.salla.sa/oauth2/token

OAuth token endpoint

Rate Limits

Salla enforces per-plan limits over a 1-minute window (Plus 120, Pro 360, Special 720 requests/min). On 429 the server honors the Retry-After header and retries with exponential backoff; transient 5xx responses are retried too, up to SALLA_MAX_RETRIES.

Demo Prompts

  • "List all products in my Salla store"

  • "Create a new product called 'Premium Dates' for 150 SAR"

  • "What order statuses can I set, and move order 1001 to completed"

  • "Sync stock: set SKU ABC-1 to 40 units"

  • "Show me the abandoned carts from this week"

Troubleshooting

  • Salla authentication is not configured — set SALLA_ACCESS_TOKEN, or the three SALLA_CLIENT_ID / SALLA_CLIENT_SECRET / SALLA_REFRESH_TOKEN variables.

  • Salla HTTP 401 with a static token — the token has expired (14-day lifetime); generate a new one or switch to auto-refresh.

  • Repeated 401 after refresh — your refresh token may have been consumed elsewhere (they are single-use). Delete the token store file and re-supply a fresh refresh token.

  • Salla HTTP 429 — you hit the plan rate limit; the server already retries, but sustained high volume needs a higher Salla plan.

Development

npm install
npm run dev          # run the server with tsx (stdio)
npm test             # vitest
npm run lint         # eslint
npm run typecheck    # tsc --noEmit
npm run build        # emit dist/

License

MIT

Available Tools

22 tools
bulk_update_quantitiesBulk Update QuantitiesA
DestructiveIdempotent

Bulk-update product or variant stock quantities by product id, variant id, or SKU. The update is queued and may take several minutes to complete.

Inputs: products (required).

create_categoryCreate CategoryC

Create a new product category in the Salla store.

Inputs: name (required), image, status, parent_id, +1 more.

create_productCreate ProductC

Create a new product in the Salla store.

Inputs: name (required), price (required), sku, quantity, +2 more.

delete_productDelete ProductB
DestructiveIdempotent

Permanently delete a product from the Salla store by its ID.

Inputs: product_id (required).

get_categoryGet CategoryB
Read-only

Get the details of a single product category by its ID.

Inputs: category_id (required).

get_customerGet CustomerA
Read-only

Get the details of a single customer by their ID, including their groups.

Inputs: customer_id (required).

get_orderGet OrderC
Read-only

Get the details of a single order by its ID.

Inputs: order_id (required).

get_order_historiesGet Order HistoriesA
Read-only

List the status-change history (timeline) of a single order.

Inputs: order_id (required).

get_productGet ProductC
Read-only

Get the details of a single product by its ID.

Inputs: product_id (required).

get_product_by_skuGet Product by SKUC
Read-only

Get the details of a single product by its SKU code.

Inputs: sku (required).

get_store_infoGet Store InfoC
Read-only

Get the store's information and settings.

Inputs: no named parameters.

list_abandoned_cartsList Abandoned CartsA
Read-only

List abandoned shopping carts for revenue-recovery workflows, with pagination.

Inputs: page, per_page.

list_branchesList BranchesA
Read-only

List the store's branches (physical locations / pickup points), with pagination.

Inputs: page, per_page.

list_brandsList BrandsB
Read-only

List the brands available in the Salla store, with pagination.

Inputs: page, per_page.

list_categoriesList CategoriesB
Read-only

List the store's product categories, with optional keyword and status filters.

Inputs: page, status, keyword.

list_couponsList CouponsB
Read-only

List the discount coupons configured in the Salla store, with pagination.

Inputs: page, per_page.

list_customersList CustomersC
Read-only

List the store's customers, with pagination.

Inputs: page, per_page.

list_ordersList OrdersB
Read-only

List orders from the Salla store, with pagination and an optional status filter.

Inputs: page, status, per_page.

list_order_statusesList Order StatusesA
Read-only

List all order statuses and sub-statuses configured for the store. Use this to discover valid values for update_order_status.

Inputs: no named parameters.

list_productsList ProductsA
Read-only

List products from the Salla store, with pagination and an optional status filter.

Inputs: page, status, per_page.

update_order_statusUpdate Order StatusC
DestructiveIdempotent

Update the fulfillment status of an order.

Inputs: status (required), order_id (required).

update_productUpdate ProductC
DestructiveIdempotent

Update fields (name, price, quantity, status) of an existing product.

Inputs: product_id (required), name, price, status, +1 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    B3.2/5.0

    Scored across 22 tools

    Disambiguation4/5

    Most tools have clearly distinct resource-and-action purposes. Minor potential overlap exists between get_product and get_product_by_sku, and between update_product and bulk_update_quantities, but the descriptions differentiate them adequately.

    Naming Consistency5/5

    All tools use snake_case with a predictable verb_noun pattern (list_products, get_order, update_order_status, delete_product). The few longer names like get_product_by_sku and bulk_update_quantities remain readable and consistent with the overall convention.

    Tool Count3/5

    22 tools is on the heavy side for the stated rubric range, though the broad e-commerce domain justifies many of them. The set is not bloated with duplicates, but it sits at the upper boundary of manageable scope.

    Completeness3/5

    Core product CRUD and order read/status workflows are covered well. However, categories lack update/delete, and brands, coupons, branches, and abandoned carts are mostly list-only, leaving notable gaps for full store administration.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers