Ifood MCP
Unofficial Model Context Protocol server for iFood β browse, search, cart and order food via AI
iFood MCP Server 
Unofficial Model Context Protocol server for iFood β 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.
What This MCP Server Does
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
Two Authentication Modes
| Mode | Transport | Login | Best for |
|---|---|---|---|
| HTTP + OAuth 2.1 | Streamable HTTP | Real iFood OTP (eβmail / SMS / WhatsApp) on a hosted login page | Multiβuser deploys, remote MCP, sharing with friends |
| stdio | Standard input / output | Tokens pasted from browser DevTools into a .env file | Local singleβuser setup, fastest to wire up |
You can run either mode independently; the same tool definitions back both.
Prerequisites
- Node.js β₯ 20
- An active iFood account (any region in Brazil)
- For HTTP+OAuth mode: nothing else β the login UI handles everything
- For stdio mode: a recent JWT extracted from browser DevTools (see below)
Check your install with node -v and npm -v.
Installation
1. Clone and build
git clone https://github.com/AriOliv/ifood-mcp.git
cd ifood-mcp
npm install
npm run build
2. Pick a mode
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 Code
claude mcp add --transport http ifood http://localhost:3001/mcp
Run /mcp inside Claude Code β click ifood β 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.
Cursor
Add to ~/.cursor/mcp.json:
{
"mcpServers": {
"ifood": {
"type": "http",
"url": "http://localhost:3001/mcp"
}
}
}
Cursor will trigger the OAuth flow on first use.
Codex
codex mcp add --transport http ifood http://localhost:3001/mcp
Option B β stdio (single user)
Extract your iFood credentials from browser DevTools:
- Open iFood and sign in
- DevTools β Network tab β reload, do any action (e.g. open a restaurant)
- Click any
site-apirequest - Copy the
authorizationheader value (drop theBearerprefix) - From the cookies tab, copy
aRefreshToken,aDeviceId,aSessionIdandaAccountId - Drop them into a
.env:
cp .env.example .env
# fill in IFOOD_ACCESS_TOKEN, IFOOD_ACCOUNT_ID, IFOOD_DEVICE_ID, IFOOD_SESSION_ID
Claude Desktop
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 Code (stdio)
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
Available Tools
π€ Customer
| Tool | Description |
|---|---|
ifood_customer_me | Authenticated customer profile |
ifood_addresses | Saved delivery addresses |
ifood_contact_methods | Verified eβmails and phones |
ifood_external_identities | Linked identity providers (Google, Apple, OTP) |
π¦ Orders
| Tool | Description |
|---|---|
ifood_orders_list | Past orders, paginated |
ifood_order_detail | Full details of a single order |
ifood_reorder | Pre-fill cart with items from a previous order |
π Discovery
| Tool | Description |
|---|---|
ifood_search | Search restaurants and items by term + location |
ifood_filter_options | Available search filters (categories, dietary, price) |
ifood_home | Localized home feed |
ifood_browse_page | Curated browse pages linked from the home feed |
ifood_categories | Top-level categories (restaurants, groceries, drugstore, β¦) |
π Merchants
| Tool | Description |
|---|---|
ifood_merchant_info | Delivery fees, methods, hours, rating, address |
ifood_merchant_catalog | Full menu with items, prices, add-ons |
ifood_item_detail | Single item details (price, description, options) |
ifood_customer_merchant_items | Customer's previouslyβordered items at a merchant |
ifood_reviews | Customer reviews/ratings, paginated |
ifood_merchant_payment_methods | Payment methods accepted by a specific merchant |
π Loyalty & Wallet
| Tool | Description |
|---|---|
ifood_loyalty_cards | iFood Club, stamps, etc. |
ifood_benefits | Wallet benefits, coupons and promotions near a location |
ifood_payment_methods | Customer's saved payment methods |
π Cart & Checkout
| Tool | Description |
|---|---|
ifood_cart_create | Create a new cart with items for a merchant |
ifood_cart_set_delivery_method | DEFAULT / PRIORITY / TAKEOUT |
ifood_cart_set_payment_method | Apply payment method UUIDs to the cart |
ifood_checkout | Place the order (final step) |
Example Prompts
Once connected, ask your AI assistant:
"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 needs
latitude/longitudeand you don't know yours, ask the AI to callifood_addressesfirst β your saved addresses include coordinates.
Architecture
ββββββββββββββββββββ 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 flow wrapped in
src/http/ifood-auth.ts:/authorization-codesβ/access-tokensβ/challengesβ/authentications.
Development
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
Project layout:
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
Security & Disclaimer
- π 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 respect iFood'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.
Contributing
Issues and PRs welcome. When opening an issue please include:
- Output of
npm run typecheck - Whether you're using stdio or HTTP+OAuth mode
- Redacted request/response (no tokens) when reporting an API failure
License
Released under the MIT License.
Made by Ari and Claude a.k.a ClaudΓ£o.
Related Servers
Data Wallets MCP
It connects Agents to data wallet with DID and verifiable credentials
Tokyo WBGT MCP Server
Provides real-time and forecast WBGT (Heat Index) data for Tokyo from Japan's Ministry of the Environment.
Time MCP Server
Provides time-related functions such as current time queries, timezone conversions, and time difference calculations.
ShippingRates
Ocean container shipping intelligence β D&D tariffs, freight rates, vessel schedules, and total cost calculation across 6 major carriers.
WhisperGraph MCP
Open-source, self-hostable MCP server for WhisperGraph β a graph of 7.39B nodes / 39B edges mapping DNS, BGP, GeoIP, WHOIS, and threat intelligence. Six read-only tools (Cypher query + schema introspection + threat assessment), six resources, eight investigation prompts. stdio and Streamable HTTP transports.
Umami MCP server
MCP server exposing Umami analytics (Cloud + self-hosted)
Microsoft Ads MCP
Bring your Microsoft Ads data into Claude or ChatGPT with Two Minute Reports MCP to analyze keyword performance, search queries, CTR, CPC, and conversion trends.
root-mcp
MCP server for ROOT CERN files
Pybullet MCP Server
An mcp server for the pybullet library, it supports 20 tools (ex: simulation creation, steps, loading robots urdf, etc)
Network - AI
Multi-agent orchestration MCP server with atomic shared blackboard, FSM governance, per-agent budget enforcement, and adapters for 12 AI frameworks including LangChain, AutoGen, CrewAI, and OpenAI Assistants.