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.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.