mcpField
M
mcp-shopee

mcp-shopee

Local
github.com/codesparBusiness & Marketing275Updated 4w ago

About mcp-shopee

mcp-shopee is an MCP server for the Shopee Open Platform Partner API v2, exposing 22 tools for orders, products, shipping, returns and promotions. It is aimed at merchants and developers operating Shopee shops in LatAm, and can be paired with @codespar/mcp-mercadolibre.

Key features

  1. 01Order listing, shipping arrangement and cancellation
  2. 02Product create, read, update and delete
  3. 03Tracking number and shipping document retrieval
  4. 04Return request review and confirmation
  5. 05Discount and bundle deal creation

Use cases

  1. 01Sync Shopee orders and arrange shipments
  2. 02Update stock and prices across marketplace listings
  3. 03Handle buyer return and refund requests

MCP support

This is an MCP server that exposes Shopee shop orders, products, logistics, returns and chat operations as 22 tools to MCP clients.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"codespar-mcp-shopee": {
"command": "npx",
"args": [
"-y",
"@codespar/mcp-shopee"
],
"env": {
"SHOPEE_PARTNER_ID": "<SHOPEE_PARTNER_ID>",
"SHOPEE_PARTNER_KEY": "<SHOPEE_PARTNER_KEY>",
"SHOPEE_ACCESS_TOKEN": "<SHOPEE_ACCESS_TOKEN>",
"SHOPEE_SHOP_ID": "<SHOPEE_SHOP_ID>",
"SHOPEE_ENV": "<SHOPEE_ENV>"
}
}
}
}
Run commandnpx -y @codespar/mcp-shopee
Environment variables to set
SHOPEE_PARTNER_IDShopee Open Platform partner_id (integer) assigned when the app is registered.
SHOPEE_PARTNER_KEYSecretShopee partner_key used as the secret for HMAC-SHA256 request signing.
SHOPEE_ACCESS_TOKENSecretMerchant access_token obtained via the shop authorization OAuth flow (expires every 4 hours; refresh via refresh_token).
SHOPEE_SHOP_IDShop identifier (integer) returned after merchant authorization.
SHOPEE_ENVEnvironment: 'sandbox' uses partner.test-stable.shopeemobile.com, 'production' (default) uses partner.shopeemobile.com.

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
npm@codespar/mcp-shopee0.2.0-alpha.3

Tools

22

Saved tool list · updated 2w ago

This tool takes no parameters.

Details

From the project README

@codespar/mcp-shopee

MCP server for Shopee — the Shopee Open Platform Partner API v2.

Shopee is one of the two marketplaces where LatAm merchants concentrate the bulk of their online GMV (dominant in Brazil, rapidly expanding across the region). Paired with @codespar/mcp-mercadolibre, this package gives agents full reach across LatAm's major ecommerce marketplaces — each has its own seller ecosystem, so merchants typically operate on both.

Tools (22)

ToolPurpose
get_shop_infoGet basic information about the authorized Shopee shop (shop_name, region, status, auth expiry).
list_ordersList orders within a time window, optionally filtered by order_status.
get_order_detailGet full detail for one or more orders by order_sn (comma-separated, up to 50).
ship_orderArrange shipment for an order — either request pickup, drop off, or pass a tracking number depending on the...
cancel_orderCancel an order that has not yet shipped.
list_productsList items (products) in the shop with optional status filter.
get_product_detailGet detailed base info for up to 50 items by item_id.
update_product_stockUpdate stock levels for an item (or its models/variants).
update_product_priceUpdate prices for an item (or its models/variants).
get_shipment_listList orders currently in shipment (status SHIPPED or in-transit).
get_return_listList return/refund requests on the shop, optionally filtered by status and time window.
confirm_returnConfirm (accept) a buyer-initiated return request by return_sn.
add_itemCreate a new product (item) in the shop.
update_itemUpdate an existing product.
delete_itemDelete an item (product) from the shop by item_id.
get_shipping_parameterFetch the required shipping parameters for an order before calling ship_order.
get_tracking_numberGet the tracking number (and courier info when available) for a shipped order.
download_shipping_documentRequest the shipping label / air waybill PDF for one or more orders.
accept_return_offerAccept the buyer's return offer (proposed solution) for a return_sn, ending negotiation in the buyer's favor.
add_discountCreate a new shop-level discount (promotion) with a time window.
add_bundle_dealCreate a bundle-deal promotion (e.g.
send_chat_messageSend a text or sticker message to a buyer in Shopee's seller chat.

Install

npm install @codespar/mcp-shopee@alpha

Environment

SHOPEE_PARTNER_ID="2001234"        # partner_id (integer) from Shopee Open Platform
SHOPEE_PARTNER_KEY="..."           # partner_key (secret) for HMAC signing
SHOPEE_ACCESS_TOKEN="..."          # merchant access_token (4h lifetime; refresh via refresh_token)
SHOPEE_SHOP_ID="123456789"         # shop_id (integer) from authorization flow
SHOPEE_ENV="production"            # or "sandbox"

Authentication

Shopee uses partner-signed requests. For shop-level endpoints the signature is:

base_string = partner_id + api_path + timestamp + access_token + shop_id
sign        = hex(HMAC_SHA256(partner_key, base_string))

partner_id, timestamp, access_token, shop_id, and sign are attached as URL query parameters on every request. The signing helper (src/index.ts) handles this on each call.

The access_token is obtained via the merchant authorization OAuth flow on Shopee Open Platform; it expires every 4 hours. Refresh it using the refresh_token (30-day lifetime) — that exchange lives outside this MCP's scope, typically in a separate token-management service.

Run

# stdio (default — for Claude Desktop, Cursor, etc)
npx @codespar/mcp-shopee

# HTTP (server-to-server testing)
MCP_HTTP=true MCP_PORT=3000 npx @codespar/mcp-shopee

Base URLs

  • Production: https://partner.shopeemobile.com/api/v2
  • Sandbox: https://partner.test-stable.shopeemobile.com/api/v2

Select with SHOPEE_ENV.

Status

0.1.0-alpha.1 — Shopee's Partner API documentation portal requires developer registration, so some endpoint payloads and field-level contracts (especially around ship_order pickup/dropoff objects and logistics channel specifics) should be validated against the live docs before production use. The signing recipe and base-URL selection are implemented to spec.

Enterprise

Need governance, budget limits, and audit trails for agent payments? CodeSpar Enterprise adds policy engine, payment routing, and compliance templates on top of these MCP servers.

License

MIT

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.