AgentSkillsCN

shoprenter

通过 `n shoprenter` 命令集成 Shoprenter CLI。适用于使用 Shoprenter 电商平台、运行 `n shoprenter` 命令、设置 Shoprenter 身份验证、将 SSO 令牌兑换为访问令牌、刷新过期令牌,或修改 Shoprenter CLI 子命令时使用。此外,当用户提及 Shoprenter 商店管理、通过 n-cli 查询产品/订单/客户,或需要连接至 Shoprenter 商店时也适用。

SKILL.md
--- frontmatter
name: shoprenter
description: Shoprenter CLI integration via `n shoprenter` commands. Use when working with the Shoprenter e-commerce platform, running `n shoprenter` commands, setting up Shoprenter authentication, exchanging SSO tokens for access tokens, refreshing expired tokens, or modifying Shoprenter CLI subcommands. Also use when the user mentions Shoprenter shop management, product/order/customer queries via the n-cli, or needs to connect to a Shoprenter store.

Shoprenter CLI

CLI for interacting with Shoprenter stores via MCP (JSON-RPC 2.0 over HTTP).

Authentication

The CLI requires SHOPRENTER_ACCESS_TOKEN and SHOPRENTER_SHOP_NAME env vars. Ask the user for shop name and SSO token before proceeding.

Obtaining the SSO token

The SSO token can be found on any Shoprenter admin page in the DOM:

js
document.ShopRenter.userData.ssoToken;

Ask the user to open their Shoprenter admin panel, open the browser console, and run the above to get the token.

Obtaining an access token from an SSO token

Exchange an SSO token for an OAuth2 access token using the Token Exchange grant (RFC 8693). The SHOPRENTER_CLIENT_ID and SHOPRENTER_CLIENT_SECRET are available as global env vars.

sh
curl -s -X POST "https://oauth.app.shoprenter.net/{shopName}/admin/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "token_exchange",
    "subject_token_type": "sso_token",
    "subject_token": "{ssoToken}",
    "client_id": "'"$SHOPRENTER_MCP_CLIENT_ID"'",
    "client_secret": "'"$SHOPRENTER_MCP_CLIENT_SECRET"'"
  }'

Response (access token valid 1 hour, refresh token valid 30 days):

json
{
  "access_token": "eyJ...",
  "token_type": "Bearer",
  "expires_in": 3600,
  "refresh_token": "eyJ..."
}

Refreshing an expired access token

When an access token expires (after 1 hour), exchange the refresh token for a new access token:

sh
curl -s -X POST "https://oauth.app.shoprenter.net/{shopName}/admin/token" \
  -H "Content-Type: application/json" \
  -d '{
    "grant_type": "refresh_token",
    "client_id": "'"$SHOPRENTER_MCP_CLIENT_ID"'",
    "client_secret": "'"$SHOPRENTER_MCP_CLIENT_SECRET"'",
    "refresh_token": "{refreshToken}"
  }'

The refresh token is valid for 30 days.

Usage

Set env vars and run commands directly:

sh
export SHOPRENTER_ACCESS_TOKEN="eyJ..."
export SHOPRENTER_SHOP_NAME="myshopname"

n shoprenter list                                            # list all available tools
n shoprenter list --withDescriptions                         # list with descriptions
n shoprenter shoprenter-test-connection                      # show tool schema
n shoprenter shoprenter-test-connection '{}'                 # call tool (no params)
n shoprenter shoprenter-get-products '{"limit":5}'           # call tool with inline JSON
echo '{"limit":5}' | n shoprenter shoprenter-get-products -  # call tool with stdin JSON
n shoprenter shoprenter-get-products '{"limit":5}' --json    # output full JSON-RPC result
n shoprenter shoprenter-get-products '{"limit":5}' --raw     # output raw text content only

Tools are called by their full MCP name (e.g. shoprenter-get-products).

Options

OptionDescription
--withDescriptionsinclude tool descriptions in list
--jsonoutput as JSON (for scripting)
--rawoutput raw text content

Behaviour

  • n shoprenter or n shoprenter list lists all tools
  • n shoprenter <tool> shows tool schema (name, description, input schema)
  • n shoprenter <tool> '<json>' calls the tool with inline JSON args
  • n shoprenter <tool> - reads JSON args from stdin

Architecture

Key files

FilePurpose
packages/n-cli/utils/mcp.jsGeneral MCP JSON-RPC 2.0 client via fetch()
packages/n-cli/cmd/shoprenter.jsSingle command with positional args and options
packages/n-cli/bin/cli.jsCLI entry point

Available tools

To discover params for any tool, run n shoprenter <tool-name> (no args) to see the input schema.

Products (mcp.product.product:read, mcp.product.product:write)

ToolParams
shoprenter-get-productspage?, limit?, full?, innerId?, sku?
shoprenter-get-productid
shoprenter-search-productskeyword, page?, limit?
shoprenter-update-product-seoproductId, languageId, name?, metaTitle?, metaKeywords?
shoprenter-get-product-specialspage?, limit?, productId?, full?
shoprenter-get-product-specialid, full?
shoprenter-create-product-specialpriority, price, dateFrom, dateTo, productId
shoprenter-update-product-specialid, priority?, price?, dateFrom?, dateTo?
shoprenter-delete-product-specialid
shoprenter-get-product-stocksproductId?, sku?
shoprenter-update-product-stocksproductId?, sku?, stock1?, stock2?, stock3?
shoprenter-get-product-physical-attributesproductId?, sku?
shoprenter-update-product-physical-attributesproductId?, sku?, weight?, width?, height?
shoprenter-get-product-catalog-infoproductId?, sku?
shoprenter-update-product-catalog-infoproductId?, sku?, modelNumber?, status?, orderable?
shoprenter-get-product-category-relationspage?, limit?, full?, productId?, categoryId?
shoprenter-get-product-category-relationid
shoprenter-get-product-attributesproductId?

Product addons (mcp.product.addon:read)

ToolParams
shoprenter-get-product-addonspage?, limit?, full?
shoprenter-get-product-addonid

Categories (mcp.product.category:read)

ToolParams
shoprenter-get-categoriespage?, limit?, full?, innerId?
shoprenter-get-categoryid
shoprenter-get-category-tree(none)
shoprenter-get-category-descriptionspage?, limit?, full?, categoryId?
shoprenter-get-category-customer-group-relationspage?, limit?, full?, categoryId?, customerGroupId?
shoprenter-get-category-customer-group-relationid

Orders (mcp.order.order:read)

ToolParams
shoprenter-get-orderspage?, limit?, emailFilter?, statusFilter?, dateFromFilter?
shoprenter-get-orderid
shoprenter-get-order-statisticsdateFrom?, dateTo?
shoprenter-get-order-summaryorderId
shoprenter-get-order-productspage?, limit?, full?, orderId?
shoprenter-get-order-productid
shoprenter-get-order-totalspage?, limit?, full?, orderId?
shoprenter-get-order-totalid
shoprenter-get-order-statusespage?, limit?, full?
shoprenter-get-order-statusid
shoprenter-get-order-status-descriptionspage?, limit?, full?, orderStatusId?
shoprenter-get-order-status-descriptionid
shoprenter-get-order-invoicespage?, limit?, full?
shoprenter-get-order-invoiceid
shoprenter-get-order-invoices-by-orderorderId
shoprenter-get-order-product-optionspage?, limit?, full?
shoprenter-get-order-product-optionid
shoprenter-get-order-product-options-by-productorderProductId
shoprenter-get-order-product-addonspage?, limit?, full?
shoprenter-get-order-product-addonid
shoprenter-get-order-product-addons-by-orderorderId

Customers (mcp.customer.customer:read)

ToolParams
shoprenter-get-customerspage?, limit?, emailFilter?, nameFilter?, phoneFilter?
shoprenter-get-customerid
shoprenter-search-customerskeyword, page?, limit?
shoprenter-get-customer-statistics(none)
shoprenter-get-customer-addressescustomerId
shoprenter-get-customer-loyalty-pointscustomerId

Customer groups (mcp.customer.customerGroup:read)

ToolParams
shoprenter-get-customer-groupspage?, limit?, nameFilter?, full?
shoprenter-get-customer-groupid
shoprenter-get-customers-in-groupgroupId, page?, limit?
shoprenter-get-customer-group-statistics(none)
shoprenter-get-customer-group-product-pricespage?, limit?, productId?, customerGroupId?, full?
shoprenter-get-customer-group-product-priceid

Localization

ToolScopeParams
shoprenter-get-geozonesmcp.localization.location:readpage?, limit?, full?
shoprenter-get-geozonemcp.localization.location:readid
shoprenter-get-languagesmcp.localization.language:readpage?, limit?, full?
shoprenter-get-languagemcp.localization.language:readid
shoprenter-get-weight-classesmcp.localization.weightUnit:readpage?, limit?, full?
shoprenter-get-weight-classmcp.localization.weightUnit:readid
shoprenter-get-length-classesmcp.localization.lengthUnit:readpage?, limit?, full?
shoprenter-get-length-classmcp.localization.lengthUnit:readid
shoprenter-get-tax-classesmcp.taxClass.taxClass:readpage?, limit?, full?
shoprenter-get-tax-classmcp.taxClass.taxClass:readid

Stock statuses (mcp.product.stockStatus:read)

ToolParams
shoprenter-get-stock-statusespage?, limit?, full?
shoprenter-get-stock-statusid

Coupons (mcp.marketing.coupon:read, mcp.marketing.coupon:write)

ToolParams
shoprenter-get-couponspage?, limit?, full?, code?
shoprenter-get-couponid
shoprenter-create-couponcode, discountType, percentDiscountValue?, fixDiscountValue?, descriptions
shoprenter-update-couponid, code?, discountType?, percentDiscountValue?, fixDiscountValue?
shoprenter-delete-couponid
shoprenter-get-coupon-product-relationspage?, limit?, full?, couponId?
shoprenter-get-coupon-product-relationid
shoprenter-create-coupon-product-relationcouponId, productId
shoprenter-delete-coupon-product-relationid
shoprenter-get-coupon-category-relationspage?, limit?, full?, couponId?
shoprenter-get-coupon-category-relationid
shoprenter-create-coupon-category-relationcouponId, categoryId
shoprenter-delete-coupon-category-relationid

CMS content (mcp.cms.content:read, mcp.cms.content:write)

ToolParams
shoprenter-create-cms-contentsortOrder?, enabled?, author?, datePublished?, descriptions
shoprenter-get-cms-content-listspage?, limit?, full?
shoprenter-get-cms-content-listid
shoprenter-get-cms-content-list-relationspage?, limit?, full?, cmsContentId?, cmsContentListId?
shoprenter-create-cms-content-list-relationcmsContentId, cmsContentListId
shoprenter-delete-cms-content-list-relationid

Utility

ToolParams
shoprenter-test-connection(none)