Power your agent
Install from the publisher. Not a PlugMCP endpoint.
Host a copy with our keys and logs.
No packaged release in the registry yet. Follow the repository README.
Remote URL or a command on your machine? How the two installs differ
Run on PlugMCP
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
LaunchAn open-source MCP (Model Context Protocol) server that wraps the Shopline Open API into 143 AI-callable tools (75 read + 68 write) for e-commerce data analysis.
Built for Claude Code, Claude Cowork, and any MCP-compatible AI client. Enables AI agents to query orders, products, inventory, customer behavior, and promotions from Shopline stores through natural language.
requestsYYYY-MM-DD, not timestamps)This project is built on the Shopline Open API v1.
https://open.shopline.io/v1/You need a valid Shopline API access token from a Shopline merchant account. Refer to the Shopline API authentication guide for how to obtain one.
pip install mcp-shopline
Or use uvx (no install needed):
uvx --from mcp-shopline mcp-shopline
Set your API token:
export SHOPLINE_API_TOKEN=your_token_here
Add the server via the Claude CLI:
claude mcp add --transport stdio shopline -- mcp-shopline
Or with the environment variable inline:
claude mcp add --transport stdio shopline -e SHOPLINE_API_TOKEN=your_token_here -- mcp-shopline
If you clone the repo locally, the .mcp.json config will be auto-detected by Claude Code and all 143 tools become available immediately.
Add to your claude_desktop_config.json:
{
"mcpServers": {
"shopline": {
"command": "mcp-shopline",
"env": {
"SHOPLINE_API_TOKEN": "your_token_here"
}
}
}
}
Or with uvx:
{
"mcpServers": {
"shopline": {
"command": "uvx",
"args": ["--from", "mcp-shopline", "mcp-shopline"],
"env": {
"SHOPLINE_API_TOKEN": "your_token_here"
}
}
}
}
This server includes tools that create, update, and delete data in your Shopline store. Your API token's permission scope controls which operations are available.
[WRITE] prefix in their descriptionsSHOPLINE_TEST_WRITES=1 to runWrite tools are marked with [WRITE] in their descriptions. They require appropriate token permissions and SHOPLINE_TEST_WRITES=1 to run in tests.
Based on Shopline Open API v1:
Note: Endpoint availability depends on your Shopline API token permissions. The status above reflects full-permission access. Restrict your token to only the scopes you need.
mcp-shopline/
├── mcp_server.py # MCP Server (stdio JSON-RPC 2.0)
├── .mcp.json # Claude Code MCP auto-discovery config
├── .env.example # Environment variable template
├── config/
│ └── settings.py # API config (token from env, endpoints)
├── tools/
│ ├── base_tool.py # Shared HTTP client (retry, pagination)
│ ├── order_tools.py # Order read tools (12)
│ ├── product_tools.py # Product/inventory read tools (9)
│ ├── analytics_tools.py # Analytics read tools (11)
│ ├── customer_tools.py # Customer read tools (9)
│ ├── category_tools.py # Category & promotion read tools (14)
│ ├── extended_tools.py # Order extended read tools (8)
│ ├── settings_tools.py # Store settings read tools (12)
│ ├── writes/
│ │ ├── order_writes.py # Order write tools (8)
│ │ ├── customer_writes.py # Customer write tools (6)
│ │ ├── product_writes.py # Product write tools (15)
│ │ ├── promotion_writes.py # Promotion/coupon write tools (12)
│ │ ├── category_writes.py # Category write tools (3)
│ │ ├── return_writes.py # Return order write tools (2)
│ │ ├── conversation_writes.py # Conversation write tools (2)
│ │ ├── review_writes.py # Review write tools (6)
│ │ ├── gift_writes.py # Gift/addon write tools (7)
│ │ ├── purchase_writes.py # Purchase order write tools (2)
│ │ ├── media_writes.py # Media/metafield write tools (2)
│ │ └── delivery_writes.py # Delivery/merchant write tools (3)
│ └── tool_registry.py # Unified tool registry
├── tests/
│ └── test_all_tools.py # E2E tests for all 143 tools
└── scripts/
├── auth/
│ ├── test_connection.py # API connection validator
│ └── inspect_data_structure.py # API response structure explorer
└── audit/
└── scope_check.py # Token scope and permission auditor
These are Shopline Open API limitations handled internally by the tools:
page + per_page (max 50), 0.2s delay between pages for rate limitingfetch_all_pages_by_date_segments() splits large queries by date rangeconfirmed, POS uses completed — tools include both by defaultcreated_from = "shop" (online) / "pos" (retail); store name from order.channel.created_by_channel_namemoney_to_float()git clone https://github.com/asgard-ai-platform/mcp-shopline.git
cd mcp-shopline
pip install -e .
# Read tools (no side effects)
python tests/test_all_tools.py
# Include write tools (creates/updates/deletes data)
SHOPLINE_TEST_WRITES=1 python tests/test_all_tools.py
python scripts/auth/test_connection.py
tool_use format with name, description, input_schema)api_get / fetch_all_pages from base_tool.py{"schema": ..., "function": ...} to the module's tool listtool_registry.py and mcp_server.py — no extra wiring neededThe following tools are implemented and registered but have not been fully E2E tested due to test-store data or token-scope limitations. They compile correctly, import successfully, and follow all project conventions — they just need real data or broader token permissions to verify end-to-end.
All 68 write tools have been verified at the import/registration level. Full E2E write tests require SHOPLINE_TEST_WRITES=1 and a dedicated test store to avoid modifying production data. See tests/test_writes/ for gated test scripts.
get_refund_by_store — return order breakdown by store/channelget_stock_transfer_suggestions — auto-generate inter-warehouse transfer recommendations based on sales velocity and stock levelsget_category_tree — standalone category structure viewerget_promotion_roi — cross-reference promotion periods with sales trend data to calculate lift and ROIget_customer_lifecycle — compare RFM segments across two periods to track customer migration (upgrade/churn)get_slow_movers — identify products with high inventory but low sales for clearance planningYou: 這個月的銷售摘要是什麼?
AI calls:
get_sales_summary(
start_date = "2026-04-01",
end_date = "2026-04-09",
channel = "all"
)
Result: 本月營業額 NT$1,234,567,共 456 筆訂單,客單價 NT$2,707,線上佔 62%、門市佔 38%。
You: 上個月最暢銷的前 5 名商品是什麼?
AI calls:
get_top_products(
start_date = "2026-03-01",
end_date = "2026-03-31",
top_n = 5,
sort_by = "revenue"
)
Result: 第一名「經典帆布休閒鞋 Classic Canvas」營收 NT$892,000(268 雙),第二名「輕量機能防風外套」營收 NT$654,000...
You: 幫我查一下客戶「陳大明」的完整資訊
AI calls:
list_customers(search_keyword = "陳大明")
→ get_customer_profile(customer_id = "5f3a8b2c...")
Result: 陳大明,VIP 會員,累計消費 NT$56,330,近 30 天消費 5 次,會員點數餘額 2,800 點,儲值金餘額 NT$500。
You: 哪些商品快缺貨了?
AI calls:
get_low_stock_alerts(threshold = 5)
Result: 共 3,098 個 SKU 低於門檻,其中 2,847 個已完全缺貨。最嚴重的是「經典帆布休閒鞋 Classic Canvas」深藍色 M 號(庫存 0)。
You: 比較一下線上和門市這個月的業績
AI calls:
get_channel_comparison(
start_date = "2026-04-01",
end_date = "2026-04-09"
)
Result: 線上官網營收 NT$780,000(佔 63%),信義旗艦店 NT$220,000(佔 18%),中山概念店 NT$120,000(佔 10%)...
You: 分析一下客戶 RFM 分群
AI calls:
get_rfm_analysis(
start_date = "2026-01-01",
end_date = "2026-04-09"
)
Result: 共 1,618 位客戶。最佳客戶 70 人(HHH),近期新客 433 人(HLL),流失高消費客戶 188 人(LLH)需要挽回。
You: 幫我建立一個新客戶,姓名王小明,email [email protected]
AI calls:
create_customer(
name = "王小明",
email = "[email protected]"
)
Result: [WRITE] 客戶王小明建立成功,ID: 69d77d57...
Contributions are welcome! Please open an issue or submit a pull request.
When adding new tools, follow the existing pattern in tools/ and ensure the tool passes the E2E test suite.
MIT
MCP server wrapping the Shopline Open API into 143 AI-callable tools (75 read + 68 write) for e-commerce operations. Built for Claude Code, Claude Desktop, and any MCP-compatible AI client.
Tools
No tool list yet. Remote servers get one after the first health check.
FAQ
Copy the stdio config for Cursor, Claude Desktop, Claude Code, or VS Code on this page. It uses the publisher's install, not a PlugMCP proxy.
No required environment variable is listed on this record.
MCP Shopline runs locally over stdio.
Last checked 2026-10-27. MCP server wrapping the Shopline Open API into 143 AI-callable tools (75 read + 68 write) for e-commerce operations. Built for Claude Code, Claude Desktop, and any MCP-compatible AI client.