swiggy-mcp-agent
v0.1.5
Published
Swiggy MCP CLI and Telegram commerce agent for Food, Instamart, and Dineout automation.
Maintainers
Readme
🍽️ swiggy-cli
🍽️ Repo kitchen:
anikeaty08/swiggy-cli· Built for Food, Instamart, Dineout, and automation.
Terminal-grade access to Swiggy's MCP platform.
swiggy-mcp-agent turns Swiggy Food, Instamart, and Dineout into a clean command-line interface and Telegram agent for humans, scripts, and coding agents. It wraps the live MCP servers with a sharper command surface, stable machine output, OAuth handling, profiles, and safer defaults for real commerce workflows.
If you want to inspect live tool schemas, script against Swiggy from CI, or give an agent a deterministic CLI instead of a browser-shaped workflow, this repo is built for that.
Why This Repo Exists
Swiggy's MCP servers are already tool-native. What they do not give you is a strong terminal experience.
This repo fills that gap:
- ergonomic commands for day-to-day use
- a generic discovery and
calllayer for long-term stability - JSON output shaped for automation
- consistent auth, profile, and endpoint handling
- safety rails around destructive operations
The result is a CLI that feels practical in a shell and dependable inside an agent loop.
Core Capabilities
- Search delivery restaurants, inspect menus, manage food carts, place orders, and track them
- Search Instamart products, update grocery carts, run checkout, and track orders
- Search Dineout restaurants, inspect details, fetch reservation slots, and check booking status
- Discover live tools and schemas directly from Swiggy MCP
- Return a stable machine envelope with
--json - Run a Telegram Food, Instamart, and Dineout agent on top of isolated per-user CLI profiles
Command Model
The CLI has two layers.
Layer A is human-friendly:
swiggy food search-restaurants --query "biryani" --address-id <addressId>
swiggy instamart search --query "milk bread eggs" --address-id <addressId>
swiggy dineout search --query "italian" --address "Indiranagar, Bengaluru"Layer B is generic and automation-first:
swiggy servers --json
swiggy tools food --json
swiggy schema food search_restaurants --json
swiggy call food search_restaurants --input '{"query":"pizza","addressId":"addr_123"}' --jsonThat split matters. Human-friendly commands make the tool pleasant to use. The generic layer makes it durable when upstream tools evolve.
Install
Requirements:
- Node.js 20+
Global install:
npm i -g swiggy-mcp-agent
swiggy --helpOne-off use:
npx -p swiggy-mcp-agent swiggy --helpLocal development:
npm install
npm run build
npm testQuick Start
Authenticate the servers you plan to use:
swiggy auth init --server food
swiggy auth init --server instamart
swiggy auth init --server dineoutCheck auth state:
swiggy auth status --jsonInspect the live MCP surface:
swiggy servers --json
swiggy tools food --json
swiggy schema food search_restaurants --jsonMake a generic call:
swiggy call food search_restaurants --input '{"query":"pizza","addressId":"addr_123"}' --jsonHuman Mode
Food:
swiggy food addresses
swiggy food search-restaurants --query "biryani" --address-id <addressId>
swiggy food menu --restaurant-id <restaurantId> --address-id <addressId>
swiggy food search-menu --query "paneer tikka" --address-id <addressId>
swiggy food cart --address-id <addressId>
swiggy food checkout --address-id <addressId> --yes
swiggy food track <orderId>Instamart:
swiggy instamart addresses
swiggy instamart search --query "milk bread eggs" --address-id <addressId>
swiggy instamart add-to-cart --address-id <addressId> --spin-id <spinId> --quantity 2
swiggy instamart cart
swiggy instamart checkout --address-id <addressId> --yes
swiggy instamart track <orderId> --address "Indiranagar, Bengaluru"Dineout:
swiggy dineout locations
swiggy dineout search --query "italian" --address "Indiranagar, Bengaluru"
swiggy dineout details <restaurantId> --address "Indiranagar, Bengaluru"
swiggy dineout slots --restaurant-id <restaurantId> --date 2026-06-01 --address "Indiranagar, Bengaluru"
swiggy dineout status <orderId>Agent and Script Mode
For automation, use machine mode consistently:
swiggy servers --json --no-interactive --quiet
swiggy tools food --json --no-interactive --quiet
swiggy schema food search_restaurants --json --no-interactive --quiet
swiggy call food search_restaurants --input '{"query":"pizza","addressId":"addr_123"}' --json --no-interactive --quietRecommended flags:
--dry-runvalidates and prints the planned MCP call without sending it. Use it to test add-to-cart, checkout, clear-cart, and booking payloads safely.--jsonfor the stable envelope on stdout--no-interactiveto fail instead of prompting--quietto suppress non-essential logs--yeswhen intentionally acknowledging a destructive action
Success envelope:
{
"ok": true,
"server": "food",
"tool": "search_restaurants",
"data": {},
"meta": {
"profile": "default"
}
}Failure envelope:
{
"ok": false,
"error": {
"code": "AUTH_REQUIRED",
"message": "Authentication required for server \"food\"."
}
}Auth and Local State
The CLI uses browser-based OAuth with PKCE.
Useful commands:
swiggy auth init
swiggy auth init --server food
swiggy auth status
swiggy auth whoami
swiggy auth logout --server foodState lives under:
~/.swiggy/config.json~/.swiggy/auth.json
Override the base path with:
SWIGGY_HOME=/path/to/stateProfiles
Profiles let you store output defaults and endpoint overrides.
Examples:
swiggy profile list
swiggy profile create work --output json
swiggy profile use work
swiggy --profile work food addressesShell Completion
Generate shell completion setup:
swiggy completion bash
swiggy completion zsh
swiggy completion fishSafety
This CLI is wired to real commerce actions. It should behave like it.
These commands require confirmation in normal use, or --yes in machine mode:
food checkoutfood clear-cartinstamart delete-addressinstamart clear-cartinstamart checkoutdineout book
In human mode, checkout, booking, cart clearing, and address deletion print a best-effort summary before asking for confirmation.
Operational rules:
- do not blindly retry
place_food_order,checkout, orbook_table - after ambiguous failures, prefer checking
get_*_ordersorget_booking_status - do not assume cart or order mutations are safe to replay
Development
Scripts:
npm run build
npm run lint
npm test
npm run pack:checkRun locally:
npm run dev -- --helpPackage sanity check:
npm run pack:checkProject Layout
src/
cli.ts
commands/
lib/
types/
test/
skills/
docs/Key areas:
src/commands/contains the ergonomic command layersrc/commands/generic.tsexposes live discovery and generic tool callingsrc/lib/mcp.tscontains the MCP transport and session handlingsrc/lib/auth.tscontains OAuth and token persistence
Troubleshooting
Auth failures:
swiggy auth init --server <server>
swiggy auth status --jsonLive tool drift:
swiggy tools <server> --json
swiggy schema <server> <tool> --jsonHealth check:
swiggy doctornpx confusion:
npx -p swiggy-mcp-agent swiggy --helpDocs
Additional docs live in docs/:
docs/architecture.mddocs/auth.mddocs/commands.mddocs/deployment.mddocs/output-contract.mddocs/telegram-bot.mddocs/troubleshooting.md
License
MIT
