Skip to main content
Glama
Marketplace Hub MCP

Marketplace Hub MCP

by 91wallace

title: Marketplace Hub MCP emoji: 📦 colorFrom: blue colorTo: green sdk: docker app_port: 7860

Marketplace Hub MCP

Open-source, read-only FastMCP server for Shopee and TikTok Shop e-commerce integrations, supporting DEMO (offline synthetic fixtures) and LIVE modes, stdio and Streamable HTTP transports, and an interactive Gradio interface.

Derived from the production marketplace connectors of Loja3D, a real multi-channel e-commerce management application. The Shopee and TikTok Shop integrations are operationally validated in daily production use; this repository packages a clean, read-only, security-audited MCP layer on top of that architecture for AI agents, portfolio demonstration, and the Hugging Face MCP Course.

flowchart LR
  Client[MCP Client / AI Agent] -->|stdio or /mcp| FastMCP
  Browser[Browser] -->|/demo| Gradio
  FastMCP --> Services[Validated Read-Only Services]
  Gradio --> Services
  Services --> Registry[Provider Registry]
  Registry --> Demo[DEMO Synthetic Fixtures]
  Registry --> Live[LIVE Store APIs]

Related MCP server: MCP Shopline

Capabilities

MCP Tools (Read-Only)

Tool

Purpose

list_marketplaces

Channels, capabilities, and effective mode (demo or live)

list_orders

Minimal paged order records

get_sales_summary

Estimated gross paid/completed order sales across every page

get_inventory

SKU and warehouse balances, with unknown stock as null

MCP Prompts

Prompt

Purpose

sales_analysis_prompt

Guides AI assistants through currency-safe sales analysis using list_marketplaces, get_sales_summary, and list_orders

inventory_audit_prompt

Guides AI assistants through stock auditing using list_marketplaces and get_inventory without summing shared physical stock

Tool Parameters

Parameter

Tools

Meaning

channel

orders, summary, inventory

Optional shopee or tiktok_shop; omit for all configured channels

start_date, end_date

orders, summary

Optional inclusive ISO dates, YYYY-MM-DD

cursor

orders, inventory

Opaque continuation returned by the previous page

limit

orders, inventory

Page size from 1 to 100

sku

inventory

Optional exact SKU filter

Install and Run (Local)

py -m venv .venv
.\.venv\Scripts\python.exe -m pip install -r requirements.txt
.\.venv\Scripts\python.exe -m marketplace_hub_mcp

MCP Client Configuration (stdio)

{
  "mcpServers": {
    "marketplace-hub-mcp": {
      "command": "C:\\path\\to\\marketplace-hub-mcp\\.venv\\Scripts\\python.exe",
      "args": ["-m", "marketplace_hub_mcp"],
      "env": { "DEMO_MODE": "true" }
    }
  }
}

Streamable HTTP + Gradio

Run python space.py and open http://localhost:7860/ (redirects to /demo/). Connect MCP clients to http://localhost:7860/mcp. space.py calls create_server(force_demo=True), so it strictly enforces DEMO mode even if LIVE environment variables are present.

DEMO vs. LIVE Modes

  • DEMO mode (DEMO_MODE=true, default): Uses exclusively synthetic offline fixtures. Zero credentials, database, or network egress required. Public deployments (space.py) always force DEMO mode.

  • LIVE mode (DEMO_MODE=false): Connects to official Shopee and TikTok Shop APIs using store credentials supplied via environment variables or a local .env (see .env.example). Set LIVE_CHANNEL=shopee, tiktok_shop, or shopee,tiktok_shop. OAuth/token renewal is handled externally. No demo records are returned on LIVE errors.

Hugging Face Spaces & MCP Course Alignment

This project is packaged with a Dockerfile (python:3.12-slim, port 7860, DEMO_MODE=true) for Hugging Face Docker Spaces. Note that hosting Docker or Gradio Spaces on Hugging Face currently requires a Hugging Face PRO subscription (the free tier returns 402 Payment Required for Docker Spaces).

MCP Course Mapping

Publishing this repository does not automatically grant certification; passing the official quiz Spaces while logged into Hugging Face is required.

Quality & Security Checks

Verified locally and in GitHub Actions (.github/workflows/quality.yml):

  • python -m pytest -q — 20 automated tests passing (unit, regression, and stdio/HTTP transport tests with synthetic HTTP responses)

  • ruff check . — 0 lint errors

  • pip-audit -r requirements.txt — 0 known vulnerabilities

  • gitleaks — 0 secrets/leaks detected

Future Extensibility

The modular provider registry in marketplace_hub_mcp/core.py is designed to support additional marketplaces (such as Mercado Livre, Amazon, and Shein) without changing the MCP tool surface.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      A read-only MCP server for SimpleShop accounting data, enabling AI agents to find documents, download PDFs, inspect products, and review sales exports.
      5
      MIT
    • A
      license
      A
      quality
      D
      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
      50 PyPI
      21
      MIT