flipkart-seller-mcp
A token-optimized MCP server that enables AI agents to manage Flipkart Seller operations including order fulfillment, inventory, returns, ad campaigns, and financial settlements via the Flipkart v3 API.
README
Flipkart Seller MCP Server
A high-performance, token-optimized Model Context Protocol (MCP) server for the Flipkart Seller v3 API. Built using Python (FastMCP + Pydantic), this server enables AI agents (Claude Desktop, Antigravity, OpenCode, Cursor, AutoGen) to manage order fulfillment, listing inventory & pricing CRUD, customer returns, ad campaigns, and payout settlements.
📚 Table of Contents
- Features
- ⚡ Token Optimization Architecture
- 🔑 How to Get Flipkart Credentials
- Installation & Setup
- 🤖 Guidance for AI Agents
- Available Domain Tools
- 🔮 Future Scope & Roadmap
- Development & Testing
- License
Features
- Token-Optimized Architecture: Returns clean, concise Markdown tables (~100–300 tokens) by default, saving up to 90% context tokens for LLM reasoning loops.
- Consolidated Master Domain Tools: Exposes 5 unified master tools (
shipments,inventory,returns,ads,financials) with strict action parameters to prevent tool schema clutter in agent prompts. - Full Catalog & Listings CRUD: Search, create, update details/prices/stock, and deactivate catalog listings.
- Auto OAuth Lifecycle: Proactive OAuth2 client-credentials authentication with 5-minute pre-expiration token auto-refresh.
- Out-of-the-Box Mock Mode: Runs seamlessly in mock mode if API credentials are missing, making development and agent testing instant.
⚡ Token Optimization Architecture
flipkart-seller-mcp was architected from the ground up to minimize context token usage for LLM agents:
- Schema Consolidation (5 Master Tools vs 30+ Micro-Tools):
By grouping endpoints into 5 master domain tools (
flipkart_manage_shipments,flipkart_manage_inventory,flipkart_manage_returns,flipkart_manage_ads,flipkart_manage_financials), we reduce the tool schema footprint in the agent's system prompt from ~4,000 tokens down to ~500 tokens. detail_level: "summary"Defaulting: Raw API payloads for Flipkart orders/listings can exceed 5,000 tokens per single API call. Every tool defaults todetail_level="summary", extracting only essential columns (e.g.shipmentId,orderId,sku,status,dispatchByDate) formatted into Markdown tables (~100–300 tokens).- Pydantic Type Compression: Field annotations and descriptions are written concisely without redundant verbose prose, avoiding schema inflation during agent initialization.
- Pagination & Output Capping: Responses cap summary listings at 10 items per page by default, preventing unexpected context window overflows.
🔑 How to Get Flipkart Credentials
To connect to a live Flipkart Seller Hub account, you need a Client ID and Client Secret.
👉 Read the Step-by-Step Credentials Guide
Quick Overview:
- Log in to Flipkart Seller Hub.
- Go to Manage Profile > Developer Access.
- Create a Self Access Application and enable required scopes (
Orders,Listings,Returns,Financials,Ads). - Copy your Application ID (
FLIPKART_CLIENT_ID) and Application Secret (FLIPKART_CLIENT_SECRET).
Installation & Setup
1. Prerequisites
- Python 3.10+
uv,pip, ornpx
2. Environment Setup
Create a .env file in your workspace root:
FLIPKART_CLIENT_ID=your_flipkart_application_id
FLIPKART_CLIENT_SECRET=your_flipkart_application_secret
# Optional: defaults to https://api.flipkart.net
FLIPKART_API_BASE_URL=https://api.flipkart.net
3. Usage with MCP Clients
Claude Desktop / Antigravity / OpenCode Configuration
{
"mcpServers": {
"flipkart": {
"command": "uvx",
"args": ["flipkart-seller-mcp"],
"env": {
"FLIPKART_CLIENT_ID": "your_client_id_here",
"FLIPKART_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
Or via Node/NPM runner:
{
"mcpServers": {
"flipkart": {
"command": "npx",
"args": ["-y", "flipkart-seller-mcp"],
"env": {
"FLIPKART_CLIENT_ID": "your_client_id_here",
"FLIPKART_CLIENT_SECRET": "your_client_secret_here"
}
}
}
}
🤖 Guidance for AI Agents
When interacting with flipkart-seller-mcp, follow these best practices for maximum performance and token efficiency:
- Use
actionParameters: Each master tool uses a requiredactionswitch (e.g.flipkart_manage_shipments(action="search")). Check the tool docstrings for supported actions. - Leverage Token Efficiency (
detail_level):detail_level="summary"(Default): Returns a compact Markdown summary table (~100–300 tokens). Ideal for scanning and planning.detail_level="full": Returns the un-truncated raw API JSON response. Use only when deep data extraction is required.
- Multi-Step Fulfillment Flow:
- Step 1:
flipkart_manage_shipments(action="search", state="APPROVED")to list new orders. - Step 2:
flipkart_manage_shipments(action="inspect", shipment_ids=["SHIP_ID"])to view item & SLA details. - Step 3:
flipkart_manage_shipments(action="mark_rtd", shipment_ids=["SHIP_ID"])to pack and mark Ready for Dispatch. - Step 4:
flipkart_manage_shipments(action="get_label", shipment_ids=["SHIP_ID"])to fetch printable PDF label & invoice.
- Step 1:
- Listings & Inventory CRUD Flow:
- Use
flipkart_manage_inventory(action="create_listing", sku="SKU123", title="...", selling_price=499.0)to create new products. - Use
update_stockorupdate_pricefor quick operational changes.
- Use
Available Domain Tools
| Tool Name | Actions Supported | Primary Description |
|---|---|---|
flipkart_manage_shipments |
search, inspect, mark_rtd, get_label, cancel |
Order fulfillment, packing, SLA inspection, label & invoice PDF retrieval, cancellations. |
flipkart_manage_inventory |
search, get_details, update_stock, update_price, create_listing, update_listing, delete_listing |
Catalog listings CRUD, warehouse stock updates, MRP and Selling Price management. |
flipkart_manage_returns |
list_returns, track_rto, approve_return, spf_claim |
Customer return requests, courier RTO tracking, return approvals, Seller Protection Fund (SPF) claims. |
flipkart_manage_ads |
list_campaigns, get_metrics, update_budget, update_bid |
Ad campaign performance (PLA/PCA), daily spend, ROAS tracking, budget & bid updates. |
flipkart_manage_financials |
get_settlements, request_report, download_report |
Bank payouts, settlement summaries, tax/sales report generation & download links. |
🔮 Future Scope & Roadmap
- Unified Multi-Marketplace Adapter (
unified-ecom-mcp): Extraction ofFlipkartClientinto a unified e-commerce protocol alongside Amazon SP-API, Shopify, and Meesho adapters. - AI-Powered SPF Dispute & Claims Assistant: Automated filing of Seller Protection Fund (SPF) claims with AI image verification for wrong/damaged return items.
- Dynamic Re-Pricing Rules: Rule-based automated price adjustments according to competitor listings and buy-box status.
- Bulk CSV Batch Uploads: Batch listing creation and inventory sync via CSV/Excel parsing tool actions.
Development & Testing
git clone https://github.com/ron2111/flipkart-seller-mcp.git
cd flipkart-seller-mcp
python -m venv .venv
source .venv/bin/activate # Or .venv\Scripts\activate on Windows
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Run full pytest suite
pytest
License
MIT License. See LICENSE for details.
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。