Skip to main content
Glama
README.md
# zoodex-mcp

**English** · [فارسی](README.fa.md) · [Examples](docs/EXAMPLES.md)

An [MCP](https://modelcontextprotocol.io) server for **[Zoodex](https://zoodex.ir)**, the food and grocery delivery app. It lets Claude (or any MCP client) search restaurants and food, find the best discounts, build a cart, log in, check out, top up the wallet, and track or rate orders. It covers the ordering features of the Zoodex web app.

It calls the Zoodex REST API (`https://api.zoodex.ir/api/`), with the same headers, query encoding and auth flow.

> "Find me the cheapest discounted pizza near Azadi Square, add two to my cart and show me the checkout."

## Features

- **Search**: food, products and vendors, with filters (discounted, Golden Off, specials, pickup, vendor type) and sorting (rating, newest, distance). Also browse vendor lists, read menus, search inside supermarkets, and see product details, reviews and pre-order slots.
- **Best discounts**: `zoodex_find_best_deals` scans Food Party, pickup parties, discounted items, specials, cash back, Pack Land and Golden Off in one call. With an optional query it also searches for discounted products. It ranks the results by discount %, money saved, or final price. Personal discount codes, vendor coupons for your cart, store credit and discount-code checks are separate tools.
- **Login**: SMS one-time code or password, with captcha support. You can also import an existing browser session. Items added to the cart while logged out are merged into your account when you log in.
- **Refresh tokens**: the access token is refreshed automatically shortly before it expires and whenever the API returns 401. Concurrent requests share one refresh, and the original request is replayed with its real method and body. If the refresh token is revoked, you get a clear "log in again" message.
- **Cart**: add, update or remove items (varieties, additionals, notes), remove a vendor, empty the cart, pre-order, vendor notes, delivery fee, order again, and Zoodex Plus.
- **Checkout**: lists payment options (online, cash, wallet keys), courier or pickup, discount codes, wallet use and store credit. `zoodex_place_order` shows a preview first and only places the order when called with `confirm=true`. Online payments return a `bank_url` that you open to pay; you can then check the payment status.
- **Wallet**: balances (Zoodex credit, other wallets, third-party and store credits), **top-up** through the bank gateway or a credit provider, top-up status, and history.
- **Orders**: current and past orders, details and tracking, support topics and tickets, and rating the vendor, courier and Zoodex.
- **Location**: cities, place search (geocoding), set your location (with a service-area check), and manage saved addresses.

All prices returned by the tools are in **toman**. The API itself uses rials (1 toman = 10 rials), and the tools convert for you.

## Install

Requires Node.js 18.17 or newer.

### Claude Code

```bash
claude mcp add zoodex -- npx -y github:MrMohebi/zoodex-mcp
```

### Claude Desktop / other MCP clients

```json
{
  "mcpServers": {
    "zoodex": {
      "command": "npx",
      "args": ["-y", "github:MrMohebi/zoodex-mcp"],
      "env": { "ZOODEX_CITY": "kerman" }
    }
  }
}
```

### From source

```bash
git clone https://github.com/MrMohebi/zoodex-mcp.git
cd zoodex-mcp
npm install        # also builds dist/
node dist/index.js # stdio server
```

Then point your client at `node /path/to/zoodex-mcp/dist/index.js`.

## Usage

1. **Location**: "set my city to Kerman" / "I'm at Azadi Square". This uses `zoodex_set_city`, `zoodex_search_place` and `zoodex_set_location`.
2. **Find food**: "what are the best food deals right now?" or "cheapest burger with a discount".
3. **Cart**: "add 2 of the first one". Browsing and the cart work without logging in.
4. **Log in**: "log me in with 0912xxxxxxx". An SMS code is sent; tell Claude the code.
5. **Checkout**: "check out with online payment to my home address". You see a preview and confirm, then you get a payment link.
6. **Wallet**: "add 200,000 toman to my Zoodex wallet". You get a payment link.

The server also provides an `order_food` prompt that runs this whole flow.

### More example prompts

- "What's in Food Party today and until when?"
- "Cheapest discounted pizza under 300,000 toman, sorted by final price."
- "Show the menu of `cafeafel`, only discounted items."
- "Find kebab places with Golden Off that also allow pickup, top rated first."
- "Do I have any discount codes? Is code `ABC123` valid on my cart?"
- "Add 2 pistachio waffles with the note 'extra syrup' and apply the best coupon."
- "Pay from my company credit wallet instead of online."
- "Reorder my last order and show the new total. Don't pay yet."
- "Where is my order? It's late, what support options do I have?"
- "Rate my last order 5 stars for the restaurant and 4 for the courier."
- Persian works too: «بهترین تخفیف‌های غذا الان چیه؟», «۲۰۰ هزار تومن کیف پولم رو شارژ کن.»

See **[docs/EXAMPLES.md](docs/EXAMPLES.md)** for many more prompts (English and Persian) and worked tool-call flows with sample responses.

### Using your existing browser login

You can skip SMS login. On zoodex.ir, open DevTools → Application → Local Storage → `token` and copy `accessToken` and `refreshToken`. Then ask Claude to call `zoodex_set_tokens` with them, or set `ZOODEX_ACCESS_TOKEN` / `ZOODEX_REFRESH_TOKEN`.

## Configuration

| Variable | Default | Description |
| --- | --- | --- |
| `ZOODEX_API_BASE` | `https://api.zoodex.ir/api/` | API base URL |
| `ZOODEX_WEB_URL` | `https://zoodex.ir` | Web app URL that payment gateways redirect back to |
| `ZOODEX_CITY` | `kerman` | Initial city slug |
| `ZOODEX_SESSION_FILE` | `~/.zoodex-mcp/session.json` | Where tokens, cart token, city and location are stored |
| `ZOODEX_ACCESS_TOKEN` / `ZOODEX_REFRESH_TOKEN` | – | Optional tokens to start the session with |
| `ZOODEX_CLIENT_ID` / `ZOODEX_CLIENT_SECRET` | web app's public client | OAuth client used for `grant_type=refresh_token` |
| `ZOODEX_DEVICE` | `1` | `device` header (1 = desktop web, 2 = mobile web) |
| `ZOODEX_TIMEOUT_MS` | `20000` | Request timeout |

## Tools

| Tool | What it does |
| --- | --- |
| **Auth** | |
| `zoodex_login_start` | Send an SMS code (or start password login) for a mobile number |
| `zoodex_get_captcha` | Get a captcha image when login asks for one |
| `zoodex_login_verify` | Verify the code or password and store tokens |
| `zoodex_session` | Login state, token expiry, city, location, address, cart |
| `zoodex_refresh_token` | Force a token refresh (normally automatic) |
| `zoodex_set_tokens` | Import tokens from a browser session |
| `zoodex_logout` | Forget tokens and cart |
| `zoodex_profile` | Identity and profile |
| **Location & addresses** | |
| `zoodex_list_cities` / `zoodex_set_city` | Cities and city selection |
| `zoodex_search_place` | Geocode a place name |
| `zoodex_set_location` | Set location (reverse geocode + service-area check) |
| `zoodex_list_addresses` / `zoodex_select_address` | Saved addresses and the delivery address |
| `zoodex_add_address` / `zoodex_update_address` / `zoodex_delete_address` | Manage addresses |
| **Discovery** | |
| `zoodex_search` | Search food, products or vendors (filters, sorts, paging) |
| `zoodex_search_options` | Popular and recent searches, available filters and sorts |
| `zoodex_vendor_types` / `zoodex_list_vendors` | Browse vendors by type |
| `zoodex_vendor_details` | Status, hours, minimum order, delivery fee |
| `zoodex_vendor_menu` | Menu with prices and discounts (filterable) |
| `zoodex_market_search` | Supermarket categories and product search |
| `zoodex_product_details` | Varieties and additionals |
| `zoodex_vendor_reviews` / `zoodex_preorder_times` | Reviews and pre-order slots |
| `zoodex_favorites` / `zoodex_toggle_favorite` | Favorites |
| **Deals & discounts** | |
| `zoodex_find_best_deals` | Ranked best deals across all discount sections |
| `zoodex_deal_section` / `zoodex_home_sections` | Browse Food Party, Golden Off, campaigns… |
| `zoodex_golden_off_vendors` | Vendors with Golden Off |
| `zoodex_my_discount_codes` | Personal discount codes and prizes |
| `zoodex_vendor_coupons` / `zoodex_select_coupon` | Vendor coupons for the cart |
| `zoodex_check_offer_code` | How much a discount code saves |
| **Cart** | |
| `zoodex_cart_view` | Cart with totals |
| `zoodex_cart_set_item` / `zoodex_cart_remove_item` | Add, update or remove items |
| `zoodex_cart_remove_vendor` / `zoodex_cart_clear` | Remove a vendor's items or empty the cart |
| `zoodex_cart_set_preorder` / `zoodex_cart_vendor_note` | Pre-order and vendor note |
| `zoodex_cart_shipping` | Delivery fee to an address |
| `zoodex_reorder` | Order again |
| `zoodex_plus` | Zoodex Plus plans, status, add or remove in cart, savings |
| **Checkout** | |
| `zoodex_checkout_options` | Payment methods, delivery options, wallet, addresses |
| `zoodex_place_order` | Preview, then place the order (`confirm=true`) |
| `zoodex_payment_status` | Payment result for an order |
| **Orders** | |
| `zoodex_orders` / `zoodex_order_details` | Order history and tracking |
| `zoodex_order_support` | Support options, answers and tickets |
| `zoodex_rate_order` | Rate the vendor, courier or Zoodex |
| **Wallet** | |
| `zoodex_wallet` | All balances |
| `zoodex_increase_credit` | Top up the wallet (returns a payment link) |
| `zoodex_credit_providers` / `zoodex_credit_payment_status` | Top-up providers and status |
| `zoodex_wallet_history` | Wallet transactions |

## Safety

- The server never pays on its own. Orders need an explicit `confirm=true` after a preview. Online payments and wallet top-ups only return a bank link, and you complete the payment in your browser.
- Tokens are stored only on your machine, in `~/.zoodex-mcp/session.json` (file mode `0600`). Delete the file or call `zoodex_logout` to sign out.

## Development

```bash
npm run build                 # compile to dist/
npm test                      # unit tests (token refresh, query encoding) against a mock API
node test/smoke.mjs           # live end-to-end smoke test (public endpoints + a guest cart)
```

The code is organised like this:

- `src/client.ts`: HTTP client (headers, `qs` bracket encoding, Bearer auth, refresh flow)
- `src/session.ts`: the stored session
- `src/format.ts`: compact views of API responses (rial → toman)
- `src/tools/*`: tool definitions, grouped by feature

## License

MIT

TDQS

B3.2/5.0

Scored across 59 tools

Disambiguation4/5

Most tools target distinct resources or lifecycle steps, and the descriptions provide strong guidance for choosing between similar-looking areas such as search, vendor listing, cart, checkout, and wallet. Some overlap remains among deal-discovery tools and payment-status tools, but the boundaries are generally recoverable from the descriptions.

Naming Consistency4/5

All tools share the zoodex_ prefix and snake_case style, making the set easy to scan. There is a minor mix of verb_noun names (e.g. zoodex_list_vendors) and noun-only names (e.g. zoodex_wallet, zoodex_orders), but the convention is still predictable overall.

Tool Count1/5

With 59 tools, the surface is far beyond a typical well-scoped MCP server and imposes a high selection burden on the agent. Even for a broad food-delivery domain, many session, deal-discovery, cart, and wallet operations could be consolidated into fewer tools.

Completeness4/5

The tool set covers the full commerce lifecycle: authentication, cities and addresses, search, vendor menus, cart management, coupons, checkout, payment, orders, support, ratings, wallet, and Plus membership. The main notable gap is explicit order cancellation/refund handling, though support tools may partially cover that path.

Maintenance

ActivityMaintained
ResponsivenessNo recent community issues