iFood MCP
Talks to the iFood Merchant API (merchant-api.ifood.com.br) with OAuth2 client_credentials to run a store on the merchant's behalf: polls order events (PLACED/CONFIRMED/CANCELLED) and acknowledges them, fetches order detail, then confirms, starts preparation, dispatches or marks orders ready for pickup, and cancels orders using valid cancellation reasons. Also manages the merchant account (merchant list/detail, availability per operation/sales channel, weekly opening hours, and temporary store pauses via interruptions) and the catalog v2.0 (list catalogs, categories and products, toggle item and complement availability, update prices, and upsert full items with their dependencies).
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@iFood MCP poll for new orders, confirm them, and dispatch the deliveries"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
iFood MCP — gerencie pedidos, loja e cardápio conversando com uma IA
Se você procurava como conectar sua loja do iFood a uma IA, aceitar e despachar pedidos conversando, abrir ou fechar a loja e ajustar o cardápio sem programar, é isto. São 26 ferramentas para pedidos, loja e catálogo, usadas a partir do Claude Desktop, Cursor ou qualquer cliente MCP.
Talks to the iFood Merchant API (merchant-api.ifood.com.br) using OAuth2 client_credentials. One shared, auto-refreshed token is used across all tools.
Quick Start
{
"mcpServers": {
"ifood": {
"command": "npx",
"args": ["-y", "@theyahia/ifood-mcp"],
"env": {
"IFOOD_CLIENT_ID": "<YOUR_IFOOD_CLIENT_ID>",
"IFOOD_CLIENT_SECRET": "<YOUR_IFOOD_CLIENT_SECRET>"
}
}
}
}Get credentials from the iFood Developer Portal (create an application; this server uses the client_credentials grant, which reaches the merchants your application directly owns).
Related MCP server: amazon-mcp
Order workflow
iFood delivers orders as events you must poll and acknowledge:
list_orders— poll for new events (~every 30s). Returns events likePLACED,CONFIRMED,CANCELLED.acknowledge_events— acknowledge the event IDs you received, or iFood redelivers them on every poll forever.get_order— fetch full detail for an order ID from aPLACEDevent.confirm_order→start_preparation(optional) →dispatch_order(delivery) orready_to_pickup(takeout/dine-in).To cancel:
get_cancellation_reasons(get valid codes for that order) →cancel_order(with a code).
Tools (26)
Orders
Tool | What it does |
| Poll order events (PLACED/CONFIRMED/…). |
| Acknowledge events so they stop being redelivered. |
| Get full order detail by ID. |
| Confirm/accept an order. |
| Mark an order as in preparation (optional). |
| Mark an order ready for pickup (required for takeout/dine-in). |
| Mark a delivery order as dispatched. |
| Get valid cancellation codes for an order. |
| Request cancellation using a code. |
Merchant
Tool | What it does |
| List accessible merchants (paginated). |
| Full merchant detail (name, address, operations). |
| Availability per operation/sales channel. |
| Read weekly opening hours. |
| Replace the entire weekly schedule. |
| List active/future store pauses. |
| Temporarily pause the store (the correct pause mechanism). |
| Resume the store. |
Catalog (v2.0)
Tool | What it does |
| Set an item AVAILABLE/UNAVAILABLE. |
| Update an item's price. |
| Set a complement/option AVAILABLE/UNAVAILABLE. |
| Update a complement/option price. |
| List the merchant's catalogs. |
| List categories (use |
| List items/products/options in a category. |
| List products (paginated). |
| Create or fully replace an item with its dependencies. |
To discover an item_id for the write tools: list_merchants → list_catalogs → list_categories (include_items: true).
Tools carry MCP annotations (readOnlyHint / destructiveHint / idempotentHint) so clients can warn before write/destructive actions.
Environment Variables
Variable | Required | Default | Description |
| Yes | — | OAuth client ID. |
| Yes | — | OAuth client secret. |
| No |
| Override the API base URL (staging/sandbox). |
| No |
| Override the token endpoint. |
| No |
| Per-request timeout in ms. |
| No |
| Total attempts (initial + retries) for transient failures. |
The client automatically: retries 429/5xx/network/timeout with exponential backoff (honoring Retry-After), refreshes the OAuth token once on a 401, and tolerates the empty 202/204 bodies iFood returns for state transitions.
Troubleshooting
401 / auth errors — check
IFOOD_CLIENT_ID/IFOOD_CLIENT_SECRET; the client re-auths once automatically on a mid-session 401.Empty merchant list —
client_credentialsonly reaches merchants your application directly owns. The iFood distribution model (per-merchantauthorization_codetokens) is not implemented here.429 rate limit —
list_orderspolling is limited to ~one request per 30s per token; the client backs off automatically.get_order404 right after PLACED — order detail can lag the event; retry with backoff (up to ~10 min).
⚠️ Endpoints pending verification
iFood's developer portal blocks automated access, so two endpoints were implemented from best available (cross-source) evidence rather than a verbatim spec read. Verify against the live iFood docs / Postman collection before depending on them in production (see code comments in the relevant tool files):
acknowledge_events— usesPOST /order/v1.0/events/acknowledgment. Theeventspath segment is a best-guess (the alternative is/order/v1.0/acknowledgment).cancel_order— sends{ "reason": "<code>" }. The exact order-module body is uncertain (a two-field{ reason, cancellationCode }shape may belong to the shipping module).
Development
npm ci
npm run build # tsc → dist/
npm test # vitest
npm run dev # tsx src/index.tsLicense
MIT
Telegram: @vhodvai
Available Tools
26 toolsacknowledge_eventsAIdempotent
Acknowledge polled events so iFood stops redelivering them. WARNING: endpoint path is best-guess — verify against live iFood docs.
Inputs: event_ids (required).
cancel_orderADestructiveIdempotent
Request cancellation of an order using a code from get_cancellation_reasons. WARNING: request body is best-guess — verify against live iFood docs.
Inputs: code (required), order_id (required).
confirm_orderAIdempotent
Confirm/accept an order (first transition after PLACED; orders auto-cancel if not confirmed in time).
Inputs: order_id (required).
create_interruptionA
Temporarily PAUSE a store for a time window (correct pause mechanism, not opening-hours).
Inputs: end (required), start (required), description (required), merchant_id (required).
delete_interruptionBIdempotent
RESUME a store by removing an interruption.
Inputs: merchant_id (required), interruption_id (required).
dispatch_orderCIdempotent
Mark a DELIVERY order as dispatched.
Inputs: order_id (required), delivered_by.
get_cancellation_reasonsARead-only
Get valid cancellation codes for an order at its current state (feed into cancel_order).
Inputs: order_id (required).
get_merchantARead-only
Get full detail for one merchant (name, address, operations).
Inputs: merchant_id (required).
get_merchant_statusBRead-only
Get merchant availability per operation/sales-channel (open/closed, reasons).
Inputs: merchant_id (required).
get_opening_hoursCRead-only
Get a merchant's configured weekly opening hours.
Inputs: merchant_id (required).
get_orderARead-only
Get full order detail by ID. May 404 briefly right after PLACED — retry with backoff.
Inputs: order_id (required).
list_catalogsARead-only
List a merchant's catalogs (step 1 of catalog discovery).
Inputs: merchant_id (required).
list_categoriesARead-only
List categories in a catalog (use include_items=true to get item IDs).
Inputs: catalog_id (required), merchant_id (required), include_items.
list_interruptionsARead-only
List active/future store interruptions (temporary pauses).
Inputs: merchant_id (required).
list_items_by_categoryCRead-only
List items/products/options in a category.
Inputs: category_id (required), merchant_id (required).
list_merchantsARead-only
List merchants the token can access (paginated; size default 100).
Inputs: page, size.
list_ordersARead-only
Poll iFood order events (one GET per ~30s). Returns new events (PLACED/CONFIRMED/...) or none. Each event MUST be passed to acknowledge_events or it is redelivered forever.
Inputs: types, groups, categories, merchant_ids.
list_productsARead-only
List catalog products (paginated; response wrapped in elements).
Inputs: merchant_id (required), page, limit.
ready_to_pickupAIdempotent
Mark an order ready for pickup (REQUIRED for TAKEOUT/DINE_IN).
Inputs: order_id (required).
set_opening_hoursBIdempotent
Replace a merchant's ENTIRE weekly schedule (days not sent are removed).
Inputs: shifts (required), storeId (required), merchant_id (required).
start_preparationAIdempotent
Mark an order as in preparation (optional, recommended between confirm and dispatch/pickup).
Inputs: order_id (required).
update_item_priceBIdempotent
Update a menu item's price (reais).
Inputs: value (required), item_id (required), merchant_id (required), original_value.
update_item_statusCIdempotent
Set a menu item AVAILABLE/UNAVAILABLE.
Inputs: status (required), item_id (required), merchant_id (required).
update_option_priceCIdempotent
Update a complement/option price (reais).
Inputs: value (required), option_id (required), merchant_id (required), original_value, +1 more.
update_option_statusCIdempotent
Set a complement/option AVAILABLE/UNAVAILABLE.
Inputs: status (required), option_id (required), merchant_id (required).
upsert_itemAIdempotent
Create or fully replace an item with its products/optionGroups/options (idempotent).
Inputs: item (required), merchant_id (required), options, products, +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 26 tools
Most tools target distinct resources and actions, with clear separation between order lifecycle, merchant, interruption, and catalog operations. A few catalog tools overlap conceptually (list_products vs. list_items_by_category) and item update vs. upsert_item may require careful selection, but descriptions largely clarify the boundaries.
Almost all tools use snake_case verb_noun naming consistently (e.g., list_merchants, get_order, cancel_order, update_item_price). The main deviation is ready_to_pickup, which is a status-like name rather than a verb_noun action, but the overall pattern remains predictable.
The server exposes 26 tools, which is heavy for a single MCP surface, though the count is distributed across several real subdomains: orders, merchants, interruptions, and catalogs. Each tool maps to a plausible operation, but the set is borderline large and could benefit from consolidation or grouping.
Order lifecycle coverage is strong, including polling, acknowledgement, confirmation, preparation, dispatch, pickup, cancellation reasons, and cancellation. Merchant, interruption, and catalog discovery/upsert coverage is also solid, though category/merchant update-delete operations and some endpoints flagged as best-guess represent minor gaps.
Maintenance
Related MCP Connectors
Unified MCP server for 70+ eCommerce platforms: products, orders, customers, and more.
Official caBRAPI MCP server to manage stores, products, coupons, payments, and webhooks.
Multi-tenant MCP gateway for AI commerce. One connection, every store.
Multi-tenant MCP gateway for AI commerce. One connection, every store.
Related MCP Servers
- AlicenseCqualityDmaintenanceEnables interaction with the BeezUP Merchant API for reading and writing BeezUP data, including store management and configuration.100MIT
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to access Amazon Selling Partner and Advertising APIs for orders, inventory, pricing, ads, reports, and related read paths.MIT
- AlicenseNot gradedqualityCmaintenanceEnables MCP clients to connect marketplace seller accounts, explore and call shop-level APIs, and manage orders, products, returns, inventory, pricing, and tracking with scoped read-only or read-write access.2MIT
- AlicenseBqualityBmaintenanceEnables sellers to read and write their Mercado Libre operations, including listing products, orders, questions, metrics, reputation, and competitor data, plus updating prices, stock, answers, and ads. It also proxies the official Mercado Libre MCP documentation tools and can query a configurable external knowledge base for reusable features and client context.1622 npmMIT