# MCP Integration Guide

# Overview

CJ Dropshipping provides an MCP (Model Context Protocol) Server that allows AI assistants to directly call CJ's API capabilities. Through MCP, you can use natural language in AI platforms such as ChatGPT and VS Code Copilot to search products, query orders, manage logistics, and more — no manual code integration required.

# What is MCP?

MCP (Model Context Protocol) is an open standard protocol developed by Anthropic that allows AI models to call external tools and services in a standardized way. The CJ MCP Server wraps core CJ API operations as a set of callable tools available to AI clients.

# Available Tools

Tool Description
search_products Search for CJ products by keyword, price range, category, etc.
query_sku_details Query product variant details and pricing
get_order_list Retrieve order list by status, time range, or order ID
get_pay_order_list Retrieve pending payment orders
create_order Create a new CJ order
calculate_freight Calculate logistics freight for a product
get_logistics_timeliness Query logistics timeliness for a destination
get_warehouses Get available warehouse list
list_shops Get authorized store list
list_disputes Query dispute list
get_dispute_detail Get dispute detail information
create_dispute Create a new dispute
cancel_dispute Cancel an existing dispute
merge_orders Merge multiple orders into one
check_login_status Check current login status
verify_credentials Log in with email and password
add_to_cart Add a product to the shopping cart

# Connection Methods

CJ MCP Server supports two connection modes:

Mode Transport Best For
Local (stdio) Standard I/O VS Code Copilot, Claude Desktop, Cursor, etc.
Remote (HTTP) StreamableHTTP ChatGPT, any HTTP-capable client

# Platform Integration Guides

# 1. Local Mode — VS Code Copilot / Claude / Cursor and more

This guide covers the unified approach for running the CJ MCP Server locally in stdio (standard I/O) mode. Compatible with all AI clients that support local MCP APPS: VS Code GitHub Copilot, Claude Desktop, Cursor, and more.

# Prerequisites

  • Node.js >= 20.0.0 (recommended: use nvm (opens new window) for version management)
  • Any AI client with local MCP stdio support

# Step 1: Clone and Build CJ MCP Server

git clone https://github.com/CJ-dropshipping/api-mcp.git
cd api-mcp
npm install
npm run build

After building, the entry file is at dist/mcp-server/index.cjs. Note the absolute path of the project (needed for configuration):

# macOS / Linux
pwd
# Windows (PowerShell)
(Get-Location).Path

# Step 2: Configure Your AI Client

Replace <absolute-path> with the path obtained in Step 1, then follow the configuration for your AI client:

VS Code (GitHub Copilot)

Create .vscode/mcp.json in any workspace root:

{
  "servers": {
    "cj-dropshipping": {
      "type": "stdio",
      "command": "node",
      "args": ["<absolute-path>/dist/mcp-server/index.cjs"]
    }
  }
}

Claude Desktop

Edit the Claude Desktop config file (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "cj-dropshipping": {
      "command": "node",
      "args": ["<absolute-path>/dist/mcp-server/index.cjs"]
    }
  }
}

Cursor / Other MCP APPS

Refer to your client's MCP documentation and use these settings:

  • Transport type: stdio
  • Command: node
  • Args: <absolute-path>/dist/mcp-server/index.cjs

Optional environment variables

Variable Default Description
CJ_LOG_LEVEL info Log level: debug, info, warn, error
CJ_LOG_FILE false Output logs to file (true / false)
CJ_LANGUAGE en Language: en (English), zh (Chinese)
CJ_CURRENCY USD Default currency

# Step 3: First-Time Login

After applying the configuration (restart or reload your AI client):

  1. Tell your AI: log in to CJ account (or use the show_login_form tool)
  2. The MCP server will open the CJ login page — enter your CJ account email and password
  3. Once logged in, the token is encrypted and stored in a local .cj-token file — no need to log in again

# Usage Examples

Search for "wireless earbuds" products
Show my recent orders
Get details for order DP2605200604000336000
Calculate shipping cost to the US for this product

# Troubleshooting

Issue Solution
Tools not showing in client Check config file syntax; restart your AI client
node command not found Install Node.js 20+; ensure node is in your PATH
Login failed Verify CJ account email/password; check network connection
Viewing logs Set CJ_LOG_FILE=true then check the local log file

# 2. ChatGPT (Remote HTTP Mode)

ChatGPT supports connecting to CJ's official MCP server directly via HTTPS — no self-hosting required.

# Step 1: Get Your CJ API Key

  1. Log in to your CJ account and go to API Key Management (opens new window).
  2. Click Generate to create your API Key if you don't have one yet.

# Step 2: Get Your Access Token

Run the following curl command in your terminal, replacing YOUR_API_KEY with the key obtained in Step 1:

curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/authentication/getAccessToken' \
  --header 'Content-Type: application/json' \
  --data-raw '{
    "apiKey": "YOUR_API_KEY"
  }'

A successful response looks like:

{
  "code": 200,
  "result": true,
  "message": "Success",
  "data": {
    "accessToken": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "accessTokenExpiryDate": "2021-08-18T09:16:33+08:00"
  }
}

Copy the accessToken value — you will use it in the next step.

Note: The access token is valid for 180 days. The server caches the token for 24 hours, so repeated calls within 24 hours return the same token.

# Step 3: Create a ChatGPT App with CJ MCP

  1. Open chatgpt.com (opens new window) and go to Settings (bottom-left) → AppsAdvanced Settings.
  2. Enable Developer Mode.
  3. Click Create App.
  4. Fill in:
    • Name: A recognizable name, e.g. CJMCP-YourName
    • Description: e.g. CJ Dropshipping assistant via MCP
    • MCP Server URL: https://developers.cjdropshipping.cn/mcp/YOUR_ACCESS_TOKEN (replace YOUR_ACCESS_TOKEN with the token from Step 2)
    • Authentication: Select No authentication
  5. Agree to the terms and click Create. Wait for the app to initialize.

# Step 4: Start Using CJ MCP in ChatGPT

  1. Open a new conversation in ChatGPT.
  2. Type /CJMCP-YourName and select your app from the suggestion list.
  3. Start chatting with natural language, for example:
    • Use CJMCP-YourName to show my account information
    • Search for "phone case" products on CJ
    • Show me my recent orders

Tip: If your token expires after 180 days, repeat Steps 1–2 to get a new token and update the MCP Server URL in your app settings.

# Multiple Accounts

To use multiple CJ accounts, create a separate app for each one:

  • Run Steps 1–2 for each account to obtain the corresponding Access Token.
  • In Step 3, use the account's token when creating the app, and give each app a unique name (e.g. CJMCP-Account1, CJMCP-Account2).
  • Switch between accounts by typing /AppName in the chat to select the desired app.

# Refreshing the App's Tool List

When CJ MCP server adds new tools or capabilities, manually refresh your app to load the latest tool list:

  1. Go to ChatGPT SettingsApps and open your CJ MCP app.
  2. Click the Refresh button on the app detail page and wait for the tool list to update.

# Authentication

# Local Mode (VS Code Copilot / Claude / Cursor / etc.)

CJ MCP Server uses token-based authentication when running locally:

  1. Call check_login_status to check if already authenticated.
  2. If not authenticated, call verify_credentials with your CJ email and password.
  3. The token is encrypted and stored locally — you won't need to log in again on next startup.

Security Note: Your credentials are only used to obtain an access token from CJ's official API. The token is stored encrypted on your local machine and never transmitted to third parties.

# ChatGPT

Authentication for ChatGPT is handled directly via the Access Token embedded in the MCP Server URL (see Step 2 of Section 2 ChatGPT setup above). No additional authentication step is required within the chat.


# Verifying Your Setup

After configuration, test with these commands in your AI client:

Check my CJ login status
Search for "phone case" products on CJ
Show me my recent orders

If configured correctly, the AI will call the appropriate MCP tools and return results.


# Troubleshooting

Issue Solution
Tools not appearing Restart your AI client; check config file syntax
Authentication failed Verify your CJ email/password; check CJ account permissions
Remote MCP connection error Verify the server is running; check firewall rules and SSL
Tool call timeout Increase proxy_read_timeout in nginx; check network connectivity
npx not found Install Node.js 18+ from nodejs.org (opens new window)