Skip to main content
Glama
Seanlhe

Shopee Log MCP Server

by Seanlhe
README.md
# Shopee Log MCP Server

TypeScript MCP server for Codex that runs Shopee log queries through the log platform's Mgmt API and Querymaster WebSocket flow.

## Status

This repository includes:

- A working MCP stdio server with a `query_logs` tool.
- Config-driven service and environment resolution.
- Session reuse from environment variables or a JSON session file.
- HTTP and WebSocket client implementations with typed orchestration.
- Protocol-capture templates so real browser-captured contracts can be dropped in without reshaping the code.
- Unit and fixture-backed integration tests.

This repository does not include real Shopee endpoint values or session secrets. Those must be provided through configuration after protocol capture.

## Configuration

Set `SHOPEE_LOG_MCP_CONFIG` to a JSON file path or inline JSON string matching [`config/log-mcp.example.json`](./config/log-mcp.example.json).

Session data can be supplied either by:

- `SHOPEE_LOG_SESSION_FILE`: path to a JSON file containing `cookieHeader` and optional `csrfToken`, or
- `SHOPEE_LOG_COOKIE_HEADER` plus optional `SHOPEE_LOG_CSRF_TOKEN`

## Scripts

- `npm run build`
- `npm test`
- `npm run start`

## Protocol Capture

Use [`docs/PROTOCOL_CAPTURE.md`](./docs/PROTOCOL_CAPTURE.md) to capture the real Mgmt API and Querymaster contract from browser traffic before pointing this server at production systems.