Lazada MCP

Lazada MCP

A read-only MCP server for Lazada Open Platform that provides access to orders, transactions, fee breakdowns, and per-SKU profit analysis.

Category
Visit Server

README

Lazada MCP

A read-only MCP server for Lazada Open Platform. It provides access to orders, transactions, fee breakdowns, and per-SKU profit analysis.

Features

  • Summarize sales, deductions, and net received amounts
  • Retrieve transaction details from the Lazada Finance API
  • Break down fees using the transaction types returned by Lazada
  • Retrieve order and order-item details
  • Calculate profit per SKU using seller-defined costs

Available MCP tools:

  • get_finance_summary
  • get_transaction_details
  • get_fee_breakdown
  • get_order
  • get_order_items
  • get_order_finance
  • get_order_profit
  • list_orders

Requirements

  • Python 3.14+
  • A Lazada Open Platform app
  • Lazada App Key and App Secret
  • Seller Access Token
  • An MCP-compatible client such as Codex

Installation

git clone https://github.com/chanoktrue/lazada-mcp.git
cd lazada-mcp

python3.14 -m venv .venv
./.venv/bin/pip install -r requirements.txt

Environment Configuration

Create a .env file. Never commit this file:

URL_THAI=https://api.lazada.co.th/rest
LAZADA_APP_KEY=your_app_key
LAZADA_APP_SECRET=your_app_secret
ACCESS_TOKEN=your_access_token

LAZADA_FINANCE_API_PATH=/finance/transaction/details/get
LAZADA_FINANCE_PAGE_SIZE=100

# Product costs in Thai baht, keyed by seller SKU
LAZADA_SKU_COSTS_JSON={"SKU-001":{"unit_cost":120,"packaging_cost":5}}

Protect the environment file and verify that it is ignored by Git:

chmod 600 .env
git status --ignored

Run as an stdio MCP Server

./.venv/bin/python lazada_mcp_server.py

Example Codex configuration:

[mcp_servers.lazada_finance]
command = "/absolute/path/lazada-mcp/.venv/bin/python"
args = ["/absolute/path/lazada-mcp/lazada_mcp_server.py"]
cwd = "/absolute/path/lazada-mcp"

Restart Codex or start a new session after changing the configuration.

Usage Examples

Retrieve transaction details:

get_transaction_details
start_date = "2026-07-01"
end_date = "2026-07-15"

View the fee breakdown for an order:

get_fee_breakdown
start_date = "2026-07-01"
end_date = "2026-07-15"
order_id = "123456789"

Analyze order profitability:

get_order_profit
order_id = "123456789"
start_date = "2026-07-01"
end_date = "2026-07-15"

Profit Calculation

Profit = sales price - discounts - Lazada fees - product cost - packaging cost

When Lazada reports a fee at order level instead of SKU level, the server allocates the fee based on each SKU's share of the order value. The response includes a warning indicating that the value is allocated rather than directly reported at SKU level.

Security

  • Never commit .env, access tokens, refresh tokens, or App Secrets
  • Keep using the included .gitignore
  • Use the MCP in read-only mode unless write operations are explicitly required
  • Set .env permissions to 600
  • Rotate the Lazada App Secret and tokens immediately if they were ever exposed
  • Do not expose this stdio server directly to the public internet

License

Distributed under the MIT License. See LICENSE for details.

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured