摘要
通过 MCP 将 WooCommerce REST API 连接到 ChatGPT。使用 AnythingMCP 以自然语言分析订单、产品和销售数据。
使用 ChatGPT 管理你的 WooCommerce 商店
WooCommerce 没有官方的 MCP 连接器。使用 AnythingMCP,你可以将 WooCommerce REST API 转换为 MCP 服务器,让 ChatGPT 分析你的订单、产品和销售表现。
分步指南
第一步:部署 AnythingMCP
curl -fsSL https://raw.githubusercontent.com/HelpCode-ai/anythingmcp/main/docker-compose.quickstart.yml -o docker-compose.yml
printf 'JWT_SECRET=%s\nENCRYPTION_KEY=%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d
第二步:生成 WooCommerce API 密钥
在你的 WordPress 管理后台,前往 WooCommerce > 设置 > 高级 > REST API。创建一个具有 读取 权限的密钥。
第三步:创建 REST 连接器
创建一个基础 URL 为 https://yourstore.com/wp-json/wc/v3 的 REST 连接器。使用消费者密钥和密钥进行身份验证。
第四步:暴露关键端点
GET /orders— 所有订单GET /products— 产品目录GET /reports/sales— 销售报告GET /customers— 客户列表GET /coupons— 活动优惠券GET /products/{id}/variations— 产品变体
第五步:连接 ChatGPT
ChatGPT 从 OpenAI 的服务器发起连接,因此你的 AnythingMCP 实例需要公网 HTTPS URL,localhost 无法使用。也可以直接使用 cloud.anythingmcp.com。
- 前往 chatgpt.com/plugins,点击 Add,然后选择 Add custom MCP server。
- 填写名称,例如 Name:
AnythingMCP。 - 在 Connection 下的 Server URL 中填入
https://your-anythingmcp-instance.com/mcp,Authentication 保持为 OAuth。 - 选择 I understand and want to continue,然后点击 Create as a plugin。ChatGPT 提示时,登录 AnythingMCP 并允许访问。
- 在个人插件中安装这个新插件,然后在对话中输入 @ 并选择它。
第六步:分析你的商店
- "我们最畅销的前 10 款产品是什么?"
- "我们这周收到多少订单?"
- "我们这个月的平均订单价值是多少?"
- "哪些产品库存不足?"
- "显示过去 30 天内所有退款订单"
下一步
- 如何将 REST API 转换为 MCP
- 将 eBay 连接到 ChatGPT
- 连接到 Claude
- 连接到 Cursor
- 连接到 Gemini
- 连接到 Meta Muse
- 连接到 Microsoft Copilot
这份指南对你有帮助吗?