Shopline MCP Server

A local MCP bridge from AI clients to the Shopline Open API

shopline mcp gives Claude Code, Claude Desktop, Codex, and other MCP-compatible AI clients structured access to your Shopline orders, products, inventory, customers, campaigns, conversations, reviews, and merchant settings through stdio.

143AI-callable tools
75read tools
68write tools
stdioMCP transport

What It Provides

Shopline MCP is a TypeScript/Node.js MCP server for Shopline analysis and store operations, built on the Shopline Open API and published as the shopline-mcp npm package.

Store data access

75 read tools cover orders, products, inventory, customers, promotions, analytics, reviews, conversations, delivery, and store settings.

Analysis-ready outputs

Hand-ported analytical tools summarize sales, rank products, compare channels, segment customers, calculate stock risk, and measure promotion performance.

Controlled operations

68 write tools can create, update, or delete Shopline resources when the connected API token has the required permissions.

Claude CodeClaude DesktopCodexNode.js 24+SHOPLINE_API_TOKEN

Commerce Analysis

Built-in analytical tools turn Shopline order, customer, product, inventory, and promotion data into answers that are useful for daily e-commerce decisions.

Sales performance

Use get_sales_summary, get_top_products,get_sales_trend, and get_channel_comparison to inspect revenue, AOV, product ranking, sales trends, and online versus POS performance.

Customer behavior

Use get_rfm_analysis, get_repurchase_analysis, andget_customer_lifecycle to understand segments, repeat purchase patterns, and customer movement between periods.

Inventory and promotions

Use get_inventory_turnover, get_promotion_roi,get_slow_movers, and get_stock_transfer_suggestions to spot stock risk, promotion lift, slow-moving products, and transfer opportunities.

Merchant Workflows It Can Answer

The higher-level tools combine multiple Shopline resources so an AI client can answer merchant questions without asking you to manually join orders, products, customers, and warehouse data.

Revenue and channel review

Compare online and POS revenue, average order value, discount totals, payment mix, delivery mix, and store-level contribution over a date range.

Customer retention and lifecycle

Segment customers with RFM, inspect repeat purchase behavior, and compare two periods to find upgrades, churn risk, new customers, and lost customers.

Inventory decisions

Review stock overview, low-stock SKUs, inventory turnover, slow-moving products, locked inventory, warehouse stock, and cross-warehouse transfer suggestions.

Campaign and refund checks

Use get_promotion_analysis, get_promotion_roi,get_category_sales, get_refund_summary, andget_refund_by_store to review campaign impact and refund patterns.

Requirements

Run the server with the supported Node.js runtime and a Shopline Open API token.

Runtime

  • Node.js 24 or newer
  • stdio transport support in your MCP client
  • Executable command: shopline-mcp

Shopline access

  • Shopline Open API access token
  • Token env var: SHOPLINE_API_TOKEN
  • Token scopes control which tools are available

Install and Run

Install the npm package, or run the published server directly with npx.

Install

npm install shopline-mcp

Run directly

npx shopline-mcp

Set the API token before running the server

export SHOPLINE_API_TOKEN=your_token_here

Shopline MCP Client Configuration

Configure your MCP client to start shopline-mcp over stdio.

Claude Code

claude mcp add --transport stdio shopline \
  -e SHOPLINE_API_TOKEN=your_token_here \
  -- npx shopline-mcp

Claude Desktop

{
  "mcpServers": {
    "shopline": {
      "command": "npx",
      "args": ["shopline-mcp"],
      "env": {
        "SHOPLINE_API_TOKEN": "your_token_here"
      }
    }
  }
}

Codex and other MCP-compatible clients

Use stdio transport with npx shopline-mcp or the installedshopline-mcp executable, and pass SHOPLINE_API_TOKEN in the environment.

Tool Coverage

The 143 tools span 75 read tools and 68 write tools across the core Shopline Open API resources used by merchants and store operators.

Orders

Query orders by date, status, channel, and store; inspect line items, labels, tags, action logs, transactions, archived orders, and shipment state.

Products and inventory

Search products, inspect variants, product images, tags, categories, warehouse stock, locked inventory, low stock alerts, price, and quantity.

Customers and membership

Work with customer profiles, search, groups, store credits, member points, membership tiers, tier history, custom fields, and customer promotions.

Promotions and campaigns

Cover promotions, coupons, flash price campaigns, affiliate campaigns, gifts, add-on products, subscriptions, campaign detail, and usage stats.

Conversations and reviews

Read customer service conversations and messages, reply to order or shop threads, and manage product review comments when token permissions allow.

Delivery and returns

Inspect delivery options, time slots, order delivery records, return orders, return order details, and update delivery or pickup store data.

Store settings

Access merchants, channels, payments, taxes, staff permissions, app settings, agents, and token information.

Purchase orders and POS

List purchase orders, inspect purchase order detail, create purchase orders, and work with POS-related inventory and revenue rules.

Media and metafields

Upload media and create merchant app metafields for Shopline resources when the API token includes the necessary scopes.

Write Tools

This server includes 68 tools that can create, update, or delete Shopline data. Token permissions determine which write actions your AI client can actually use; the server does not bypass Shopline's access controls.

Clearly marked side effects

Write tool descriptions start with [WRITE] and include a【副作用】 section so AI clients can distinguish operations that change store data.

Merchant-controlled access

Use the narrowest Shopline Open API token scopes needed for your workflow. Read tools are marked read-only, while write tools are marked as non-read-only and destructive.

Practical write coverage

Write tools cover common merchant operations such as order shipping, product updates, customer credits, coupon actions, return orders, replies, reviews, and inventory-related updates.

Operational areas

Write coverage includes orders, customers, products, promotions, categories, returns, conversations, reviews, gifts and add-ons, purchase orders, media, metafields, delivery, and merchant settings.

API Notes

These notes describe the Shopline Open API behavior handled by the server.

Endpoint and auth

  • Base URL: https://open.shopline.io
  • Auth: Authorization: Bearer <SHOPLINE_API_TOKEN>
  • The shared client handles auth, retry, pagination, and DELETE bodies

Pagination and limits

  • Pagination uses page and per_page
  • per_page max is 50
  • Search limit is 10,000 results
  • Large order searches are paginated internally

Order and money rules

  • Orders search does not support sort_by
  • Online revenue orders use confirmed
  • POS revenue orders use completed
  • Channel source is shop or pos
  • Money values come from dollars

Built for MCP Clients

The package is a TypeScript/Node.js implementation with static tool metadata, a shared Shopline HTTP client, custom analytical handlers, and local tests around the MCP-facing contract.

Python parity baseline

The TypeScript package was rebuilt with reference to the MIT-licensed Python project and keeps the same 143-tool baseline, tool names, read/write split, and endpoint mapping expectations.

MCP annotations

Tool registration marks read tools as read-only and write tools as non-read-only and destructive, matching the side-effect labels in the tool descriptions.

Shared API handling

The server handles bearer-token auth, retries, pagination, request parameters, JSON bodies, DELETE bodies, and analytical outputs with Shopline money values converted from dollars.

Local verification

The repository includes tests for tool counts, write-tool markings, request bodies, read-output shapes, endpoint coverage, client behavior, and a stdiotools/list smoke check.

Use Shopline MCP with your AI client

Shopline MCP runs locally over stdio with a Shopline Open API token, giving your AI client structured access to store analysis and operations.

Install and RunView Tool Coverage