Skip to main content
Glama
liuxzhong-dev

mcp-cn-commerce

基于 MCP 协议的电商数据分析 Agent (mcp-cn-commerce)

本项目是一个基于 Anthropic MCP (Model Context Protocol) 标准架构构建的电商自动化分析智能体(Agent)。 系统通过将大语言模型(LLM)与拼多多/抖店工具链进行解耦对接,实现了利用自然语言驱动工具调用(Tool Calling),完成店铺商品查询、订单分析与经营决断输出。


🌟 核心亮点与工程改进

  1. MCP 标准架构落地:遵循 Model Context Protocol 协议规范,通过 Stdio 管道实现 Client 与 本地 MCP Server 的双向通信。

  2. Mock 代理层设计(鉴权绕过):重写服务端核心 _call 响应逻辑,注入规范的电商业务模拟 JSON 数据,无需企业级真实 API 凭证即可实现全流程离线运行与 Agent 链路验证。

  3. 多客户端与多模型解耦:验证了架构的跨平台兼容性,成功从 Claude Desktop 迁移至 Cherry Studio,并适配 DeepSeek-V3 / R1 大模型,将工具调用成本降低 90% 以上。


Related MCP server: Haravan MCP

🛠️ 技术栈

  • Protocol: Model Context Protocol (MCP)

  • Language: Python 3.10+

  • Dependency Manager: uv

  • Clients Supported: Cherry Studio, Claude Desktop, Cursor

  • Models Tested: DeepSeek-V3, DeepSeek-R1, Claude 3.5 Sonnet


🚀 快速本地部署

1. 克隆本项目与安装依赖

git clone [https://github.com/你的用户名/mcp-cn-commerce-agent.git](https://github.com/你的用户名/mcp-cn-commerce-agent.git)
cd mcp-cn-commerce-agent
uv sync
2. 在 Cherry Studio 中配置 MCP 服务
在 Cherry Studio 的 设置 -> MCP 服务器 中添加:

名称: mcp-cn-commerce

类型: stdio

命令: uv

参数: run mcp-cn-commerce start pinduoduo

环境变量:
PINDUODUO_CLIENT_ID=mock_client_id
PINDUODUO_CLIENT_SECRET=mock_client_secret
PINDUODUO_ACCESS_TOKEN=mock_access_token

💡 使用示例
在客户端对话框中发送指令:

"帮我查一下拼多多店铺的商品和订单列表,分析一下哪款衬衫卖得最好。"

Agent 智能体执行链路:

识别意图,触发 get_product_list 和 get_order_list 工具。

本地 MCP Server 拦截请求并返回 Mock 结构化数据。

大模型解析 JSON 数据并生成诊断报告。

Related MCP Connectors

Related MCP Servers

  • A
    license
    D
    quality
    D
    maintenance
    Enables natural-language control of e-commerce operations including product management, order processing, inventory tracking, customer service, content generation, and advertising analytics through 15 integrated MCP tools. Provides a local-first commerce automation solution with SQLite storage and extensible channel adapters for end-to-end online store workflows.
    15
    3
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with Haravan e-commerce platforms via MCP protocol for natural language management of stores. Provides 7 smart analytics tools for insights and 63 base tools for CRUD operations on products, orders, customers, and inventory.
    18
    Apache 2.0
  • A
    license
    A
    quality
    B
    maintenance
    An open-source MCP server that wraps the Shopline Open API into 143 AI-callable tools for e-commerce data analysis, enabling AI agents to query orders, products, inventory, customer behavior, and promotions from Shopline stores through natural language.
    100
    20
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    A suite of MCP servers that give AI agents read-only access to Chinese e-commerce platform business data, including advertising, orders, products, and more from platforms like Douyin, JD.com, Taobao, etc.
    22
    48 PyPI
    53
    MIT