Milkbasket MCP Server
Enables AI assistants to interact with Milkbasket for grocery shopping, including OTP authentication, product search, cart management, wallet balance checks, and order summaries through natural language.
README
@anujsup/milkbasket-mcp
AI-powered grocery shopping for India — a Model Context Protocol (MCP) server for the Milkbasket API.
Connect your AI assistant (Cursor, Claude Desktop, Windsurf, or any MCP client) to your Milkbasket account and let it handle your daily groceries — log in with OTP, browse products, build your cart, check your wallet, and review your full order summary, all through natural language.
What you can do with this:
- Ask your AI to find products — "Search for low-fat milk under ₹50"
- Build and manage your cart — "Add 2 Amul butter, remove the lassi"
- Check your order before delivery — "Show me my cart with the full bill"
- Keep track of your wallet — "What's my Milkbasket balance?"
- Fetch account details — "What city and hub am I assigned to?"
Prerequisites
- Node.js 18 or higher
- A Milkbasket account (Indian mobile number)
- An MCP client (Cursor, Claude Desktop, etc.)
Installation
Option 1: npx (recommended, no install needed)
{
"mcpServers": {
"milkbasket": {
"command": "npx",
"args": ["-y", "@anujsup/milkbasket-mcp@latest"]
}
}
}
Option 2: Global install
npm install -g @anujsup/milkbasket-mcp
{
"mcpServers": {
"milkbasket": {
"command": "milkbasket-mcp"
}
}
}
Option 3: Local install
npm install @anujsup/milkbasket-mcp
{
"mcpServers": {
"milkbasket": {
"command": "node",
"args": ["node_modules/@anujsup/milkbasket-mcp/dist/index.js"]
}
}
}
Cursor setup
Add the config to .cursor/mcp.json in your project root (project-level) or ~/.cursor/mcp.json (global):
{
"mcpServers": {
"milkbasket": {
"command": "npx",
"args": ["-y", "@anujsup/milkbasket-mcp@latest"]
}
}
}
Reload Cursor after saving.
Available Tools
Authentication
| Tool | Description |
|---|---|
auth_request_otp |
Send OTP to your registered mobile number |
auth_verify_otp |
Verify OTP and log in |
auth_status |
Check if you are currently authenticated |
auth_logout |
Log out and clear stored tokens |
User
| Tool | Description |
|---|---|
get_user_details |
Fetch your name, email, city, hub, and membership info |
get_wallet_balance |
Fetch your current Milkbasket wallet balance and cashback |
Products
| Tool | Description |
|---|---|
list_products |
List featured/flash-deal products (paginated) |
search_products |
Search products by name or keyword (paginated) |
get_hero_collections |
Fetch hero banner collections shown on the home screen |
Cart
| Tool | Description |
|---|---|
add_to_cart |
Add a new product or increase quantity in the cart |
remove_from_cart |
Decrease quantity or remove a product from the cart |
get_basket |
Lightweight cart snapshot — item count, product IDs, basic totals |
get_extended_basket |
Full cart view — product names, images, discounts, delivery fee, GST, final payable amount |
Authentication Flow
1. auth_request_otp → { phone: "9XXXXXXXXX" }
2. Receive OTP via SMS
3. auth_verify_otp → { phone: "9XXXXXXXXX", otp: "XXXX" }
4. You are now logged in
Security & Privacy
This server runs 100% locally on your machine. Your phone number, OTP, and tokens never leave your device — they are never sent to any third party, including the AI assistant. Here's exactly what happens:
- Your phone number is sent directly from your machine to Milkbasket's servers to request an OTP
- The OTP you share with the AI is passed directly from your machine to Milkbasket to verify login
- The AI model only sees the response (success/failure) — it cannot intercept or store your credentials
- Access tokens are stored in your OS keychain (macOS Keychain, Windows Credential Manager, Linux Secret Service) using
keytar— the same secure storage used by apps like VS Code and 1Password - If
keytaris unavailable, an AES-256-GCM encrypted file is used as fallback - You can log out at any time using
auth_logout, which clears all stored tokens immediately
Cart Flow
search_products → find productId and price
add_to_cart → { productId, price, quantity }
remove_from_cart → { productId, price, quantity: 0 } ← set 0 to delete
get_extended_basket → full checkout view
What you can ask your AI
Once connected, just talk to your AI naturally:
| What you say | What happens |
|---|---|
| "Log me in to Milkbasket" | Sends OTP → verifies → stores token |
| "Search for paneer" | Calls search_products and returns matches |
| "Add 2 Amul Gold milk to my cart" | Calls add_to_cart with the right product |
| "Remove the lassi from my cart" | Calls remove_from_cart with quantity 0 |
| "Show me my cart with full bill" | Calls get_extended_basket with itemized bill |
| "What is my wallet balance?" | Calls get_wallet_balance |
| "What are my account details?" | Calls get_user_details — name, city, hub, membership |
| "What deals are on today?" | Calls list_products for flash deals |
| "Log me out" | Clears tokens from keychain |
Example usage in Cursor
Search for Amul milk products
→ search_products({ query: "amul milk" })
Add 2 units to cart
→ add_to_cart({ productId: 1234, price: 28, quantity: 2 })
View full cart with bill breakdown (product names, discounts, delivery fee, GST, payable)
→ get_extended_basket()
Reduce quantity by 1
→ remove_from_cart({ productId: 1234, price: 28, quantity: 1 })
Remove product entirely
→ remove_from_cart({ productId: 1234, price: 28, quantity: 0 })
Check wallet balance
→ get_wallet_balance()
Get account info
→ get_user_details()
License
MIT © Anujsup
推荐服务器
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 模型以安全和受控的方式获取实时的网络信息。