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.
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.
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.
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.
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.
Neon Database
MCP server for interacting with Neon Management API and databases
E2B
Using MCP to run code via e2b.
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.