Ifood MCP
About
Unofficial Model Context Protocol server for iFood — browse, search, cart and order food via AI
Details
- Author
- arioliv
- Categories
- Other, Automation
Jump to
Setup
Install Ifood MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).
Repository: https://github.com/arioliv/ifood-mcp
Follow the installation instructions in the repository README, then restart your MCP client.
UnofficialModel Context Protocolserver foriFood— Brazil's largest food delivery platform. Browse restaurants, search food, manage your cart and place orders through any AI assistant that speaks MCP.
Not affiliated with iFood. Wraps the public consumer web API for personal use.
This MCP server gives AI assistants (Claude Code, Claude Desktop, Cursor, Codex, etc.) access to your iFood account. It exposes 25 tools that let an AI:
- 🔍 Search restaurants and food items near you
- 🍔 Browse merchants, full catalogs, item details and customer reviews
- 🛒 Build a cart with items, delivery method and payment
- 💳 List your saved payment methods and addresses
- 📦 List past orders, get order details, and reorder
- 🎁 Check loyalty cards, wallet benefits and coupons
- 📍 Explore the home feed, categories and curated browse pages
You can run either mode independently; the same tool definitions back both.
Check your install withnode -vandnpm -v.
git clone https://github.com/AriOliv/ifood-mcp.git cd ifood-mcp npm install npm run build
Option A — HTTP + OAuth 2.1 (recommended)
# Generate a JWT signing secret (≥32 chars) echo "MCP_JWT_SECRET=$(openssl rand -hex 32)" >> .env echo "PORT=3001" >> .env # Run with auto-reload npm run dev
Then register the server with your client.
claude mcp add --transport http ifood http://localhost:3001/mcp
Run/mcpinside Claude Code → clickifood→ it'll open the browser at the OTP login page. Authenticate with your iFood e‑mail and the 6‑digit code that arrives via WhatsApp/SMS/Email.
{ "mcpServers": { "ifood": { "type": "http", "url": "http://localhost:3001/mcp" } } }
Cursor will trigger the OAuth flow on first use.
codex mcp add --transport http ifood http://localhost:3001/mcp
Extract your iFood credentials from browser DevTools:
cp .env.example .env # fill in IFOOD_ACCESS_TOKEN, IFOOD_ACCOUNT_ID, IFOOD_DEVICE_ID, IFOOD_SESSION_ID
Edit~/Library/Application Support/Claude/claude_desktop_config.json(macOS) or%APPDATA%\Claude\claude_desktop_config.json(Windows):
{ "mcpServers": { "ifood": { "command": "node", "args": ["/absolute/path/to/ifood-mcp/build/index.js"], "env": { "IFOOD_ACCESS_TOKEN": "eyJraWQi...", "IFOOD_ACCOUNT_ID": "fa0ac7f3-...", "IFOOD_DEVICE_ID": "1141f82b-...", "IFOOD_SESSION_ID": "97fe984b-..." } } } }
claude mcp add --transport stdio ifood \ --env IFOOD_ACCESS_TOKEN=eyJraWQi... \ --env IFOOD_ACCOUNT_ID=fa0ac7f3-... \ --env IFOOD_DEVICE_ID=1141f82b-... \ --env IFOOD_SESSION_ID=97fe984b-... \ -- node /absolute/path/to/ifood-mcp/build/index.js
"encontre opções de açaí perto de -23.59182, -46.648688" "qual é o cardápio da hamburgueria mais bem avaliada na minha região?" "liste meus 5 últimos pedidos e me mostre o status de cada um" "crie um carrinho no Burger King com 2 Whoppers e finalize com Pix" "me mostre as avaliações do restaurante <id> nas últimas 30 reviews" "existe algum cupom ativo na minha carteira pra delivery agora?"
[!TIP] If a tool needslatitude/longitudeand you don't know yours, ask the AI to callifood_addressesfirst — your saved addresses include coordinates.
┌──────────────────┐ OAuth 2.1 ┌─────────────────────┐ Bearer JWT ┌─────────────────┐ │ AI assistant │◄────────────────►│ ifood-mcp server │◄─────────────────►│ iFood API │ │ (Claude/Cursor) │ /mcp endpoint │ (Express + MCP) │ site-api / wsl. │ (consumer web) │ └──────────────────┘ └─────────────────────┘ └─────────────────┘ │ ▼ ┌──────────────┐ │ /login │ HTML — iFood OTP │ (browser) │ e‑mail / SMS / WhatsApp └──────────────┘
- Stateless transport: each/mcpcall creates a freshStreamableHTTPServerTransport+McpServerbound to the authenticated user's session — handles concurrent users without sticky sessions.
- In‑memory token stores: per‑user iFood JWT pairs auto‑refreshed every 60s. Single‑process; for horizontal scaling move to Redis.
- OAuth 2.1 + PKCE S256, audience‑bound HS256 JWTs, opaque rotating refresh tokens.
- 5‑step iFood OTP flowwrapped insrc/http/ifood-auth.ts:/authorization-codes→/access-tokens→/challenges→/authentications.
npm run dev # http-server with auto-reload (tsx watch) npm run dev:stdio # stdio with auto-reload npm run build # tsc → build/ npm run typecheck # tsc --noEmit
src/ index.ts tool definitions + executeTool dispatcher + stdio entry http-server.ts Express + OAuth + Streamable HTTP transport http/ store.ts in-memory OAuth + iFood token stores provider.ts OAuthServerProvider implementation session-provider.ts SessionTokenProvider + background refresh loop login-router.ts OTP login HTML pages ifood-auth.ts chained iFood OTP HTTP client
- 🔒 In HTTP mode, iFood tokens live only in memory — never written to disk. Process restart = re‑login.
- 🚫 Don't commit.env, HAR files or any DevTools captures — they contain bearer tokens. The.gitignoreblocks all common spots.
- ⚠️Unofficial. iFood does not publish a public API. This wraps the consumer website's endpoints, which can change without notice. Use at your own discretion and respectiFood's Terms of Service.
- 🛡️ The login flow may eventually trip iFood's bot‑detection. If you see opaque errors during login, try the/login/pastefallback to provide tokens manually.
Issues and PRs welcome. When opening an issue please include:
- Output ofnpm run typecheck
- Whether you're using stdio or HTTP+OAuth mode
- Redacted request/response (no tokens) when reporting an API failure
Pepesto gives your agent the ability to turn any recipe (a URL, plain text, or a photo) into a matched basket of real supermarket products with live prices, across 26 European supermarkets. The MCP covers the recipe → matched cart half of the grocery shopping workflow (parse / search / map ingredients to SKUs / check catalogs)
MCP server for Instacart - let AI agents order groceries and household items from local stores
Indie board game designers, tabletop creators, and TGC users who want to manage their projects through an AI assistant instead of navigating the TGC web interface manually.
D2C eCommerce fulfillment platform: manage orders, inventory, shipments, campaigns, and billing via AI agents
Hosted MCP server for Amazon sellers using Claude, ChatGPT, and other AI clients.
Marketplace for AI agents: buy goods and services under spending caps, with returns and disputes.
Real-time product search across Southeast Asia with 3.8M+ items — the first SEA e-commerce MCP server
MCP server for meal delivery service. Browse menus, manage carts, confirm orders, skip/unskip deliveries, and view order history.
Living economy for AI agents - Conway physics, energy currency, marketplace, reputation.
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.


