Openworker E-Commerce MCP Server
Enables automated product management on Shopee, TikTok Shop, and Lazada by controlling an existing Chrome or Edge browser session, intercepting internal APIs for fast updates, and pausing for captcha resolution.
README
Openworker E-Commerce MCP Server
MCP (Model Context Protocol) Server ออกแบบสำหรับใช้งานร่วมกับ Openworker เพื่อควบคุม Chrome หรือ Microsoft Edge ในการบริหารจัดการสินค้าบนแพลตฟอร์ม E-Commerce หลัก ได้แก่ Shopee, TikTok Shop และ Lazada
🚀 จุดประสงค์โครงการ (Project Overview)
ระบบนี้พัฒนาขึ้นเพื่อแก้ปัญหาการควบคุมเบราว์เซอร์อัตโนมัติของบอททั่วไปบนหน้า Seller Center:
- ล็อกอินผ่าน Session จริง: เชื่อมต่อ Chrome/Edge ที่ผู้ใช้ล็อกอินค้างไว้อยู่แล้วผ่าน Remote Debugging Port (
9222) ไม่ต้องล็อกอินใหม่หรือเจอ OTP/2FA ซ้ำซ้อน - การอัปเดตรวดเร็วผ่าน Internal API Interception: ดึง Session Cookies/Tokens จากเบราว์เซอร์แล้วส่งคำสั่งอัปเดตผ่าน API โดยตรง รวดเร็ว แม่นยำ ไม่ต้องพึ่งพาการคลิกบน UI เพียงอย่างเดียว
- Safety Guard & Captcha Pause: ตรวจสอบขอบเขตราคาและสต็อกก่อน Save และหยุดรอเมื่อเจอ Captcha ให้ผู้ใช้ช่วยปลดล็อกได้ทันที
👥 บทบาทและการทำงาน (Team & Development Roles)
- Jules (Google AI Agent): พัฒนาโค้ด TypeScript, พัฒนา Tools แต่ละหมวดหมู่ (Browser Attach, Session Interceptor, API Client, Safety Guard) และทำ Unit Tests
- Controller Agent (Cowork / GitHub Controller): ควบคุมโครงสร้างโปรเจกต์, Review Code/PR, ออกแบบ Task Issues, จัดทำ Tag Release และ Deploy เข้าสู่ Openworker
🛠️ โครงสร้างโปรเจกต์ (Project Structure)
openworker-ecommerce-mcp/
├── src/
│ ├── index.ts # Entry point หลักของ MCP Server
│ ├── types.ts # Type Definitions & Schemas
│ ├── services/
│ │ ├── cdp-connection.ts # ตัวจัดการเชื่อมต่อ Chrome/Edge CDP (Port 9222)
│ │ ├── session-extractor.ts# ตัวดึง Auth Cookies / Bearer Tokens จาก Tab
│ │ └── api-client.ts # Internal API Wrapper สำหรับ Shopee/TikTok/Lazada
│ └── tools/
│ ├── browser-profile.ts # Tool: browser_attach_existing
│ ├── ecommerce-search.ts # Tool: ecommerce_product_search
│ ├── ecommerce-update.ts # Tool: ecommerce_update_price_stock
│ └── safety-guard.ts # Tool: ecommerce_safety_guard
├── docs/
│ ├── ARCHITECTURE.md # สถาปัตยกรรมและรายละเอียด Tool Contracts
│ └── TASKS.md # รายการงานสำหรับการพัฒนาราย Phase
├── JULES_PROMPT.md # ข้อแนะนำการสั่งงาน Jules (Google AI Agent)
├── package.json
└── tsconfig.json
💻 การเปิดใช้งาน Chrome / Edge สำหรับการเชื่อมต่อ
ก่อนเริ่มใช้งาน ให้เปิด Chrome หรือ Microsoft Edge ด้วยคำสั่ง Remote Debugging:
Windows (Chrome):
"C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="C:\ChromeAutomationProfile"
Windows (Edge):
"C:\Program Files (x86)\Microsoft\Edge\Application\msedge.exe" --remote-debugging-port=9222 --user-data-dir="C:\EdgeAutomationProfile"
⚙️ การติดตั้งและใช้งาน (Installation & Build)
# ติดตั้ง dependencies
npm install
# Build TypeScript
npm run build
# ทดสอบรัน MCP Server
npm start
📄 ใบอนุญาต (License)
MIT License - พัฒนาโดย tukimtk-design
🚀 Phase 7 Features
Auto-Launch on Windows
If the CDP connection fails on Windows, the system will attempt to automatically launch Chrome/Edge with the correct remote debugging port to provide a seamless 1-click experience.
Playwright E2E Mocks
You can run the mocked E2E flows via:
npm test
Openworker Auto-Installer
Run the PowerShell script to build the project and generate the MCP config:
.\scripts\install-openworker-mcp.ps1
🚀 Phase 8 Features
Multi-Platform Stock Sync
Automatically synchronize stock and prices across Shopee, TikTok Shop, and Lazada. The system orchestrates safety bounds and logs operations.
Fuzzy Variant Matching
The system uses string similarity (Levenshtein Distance) to match product variants that are named differently across platforms, leveraging SQLite to cache successful matches for immediate future retrievals.
🚀 Phase 9 Features (Enterprise)
Docker & Headless Run
Deploy 24/7 on the cloud using the official Playwright Docker image with Xvfb:
docker-compose up -d
Visual DOM Self-Correction
Captures viewport screenshots and bounding boxes to allow AI to self-correct during unexpected DOM overlays.
Proxy Rotation
Supports rotating proxies for multi-account isolation.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。