npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

swiggy-mcp-agent

v0.1.5

Published

Swiggy MCP CLI and Telegram commerce agent for Food, Instamart, and Dineout automation.

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 call layer 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"}' --json

That 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 --help

One-off use:

npx -p swiggy-mcp-agent swiggy --help

Local development:

npm install
npm run build
npm test

Quick Start

Authenticate the servers you plan to use:

swiggy auth init --server food
swiggy auth init --server instamart
swiggy auth init --server dineout

Check auth state:

swiggy auth status --json

Inspect the live MCP surface:

swiggy servers --json
swiggy tools food --json
swiggy schema food search_restaurants --json

Make a generic call:

swiggy call food search_restaurants --input '{"query":"pizza","addressId":"addr_123"}' --json

Human 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 --quiet

Recommended flags:

  • --dry-run validates and prints the planned MCP call without sending it. Use it to test add-to-cart, checkout, clear-cart, and booking payloads safely.

  • --json for the stable envelope on stdout

  • --no-interactive to fail instead of prompting

  • --quiet to suppress non-essential logs

  • --yes when 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 food

State lives under:

  • ~/.swiggy/config.json
  • ~/.swiggy/auth.json

Override the base path with:

SWIGGY_HOME=/path/to/state

Profiles

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 addresses

Shell Completion

Generate shell completion setup:

swiggy completion bash
swiggy completion zsh
swiggy completion fish

Safety

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 checkout
  • food clear-cart
  • instamart delete-address
  • instamart clear-cart
  • instamart checkout
  • dineout 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, or book_table
  • after ambiguous failures, prefer checking get_*_orders or get_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:check

Run locally:

npm run dev -- --help

Package sanity check:

npm run pack:check

Project Layout

src/
  cli.ts
  commands/
  lib/
  types/
test/
skills/
docs/

Key areas:

  • src/commands/ contains the ergonomic command layer
  • src/commands/generic.ts exposes live discovery and generic tool calling
  • src/lib/mcp.ts contains the MCP transport and session handling
  • src/lib/auth.ts contains OAuth and token persistence

Troubleshooting

Auth failures:

swiggy auth init --server <server>
swiggy auth status --json

Live tool drift:

swiggy tools <server> --json
swiggy schema <server> <tool> --json

Health check:

swiggy doctor

npx confusion:

npx -p swiggy-mcp-agent swiggy --help

Docs

Additional docs live in docs/:

  • docs/architecture.md
  • docs/auth.md
  • docs/commands.md
  • docs/deployment.md
  • docs/output-contract.md
  • docs/telegram-bot.md
  • docs/troubleshooting.md

License

MIT