RappiMCP
Enables Claude to browse stores, search products, manage the cart, and open checkout on Rappi Chile through natural language, automating grocery and delivery purchases.
README
RappiMCP
<!-- mcp-name: io.github.bgirardi99/rappi-mcp -->
Program : RappiMCP
Author : Bastian Girardi
Date : April 2, 2026
Purpose : Built to automate grocery and delivery purchases on Rappi Chile
through Claude — eliminating the need to manually browse the app
when you just want to tell an AI what you need and have it ordered.
An MCP (Model Context Protocol) server that gives Claude full control over Rappi Chile — browse stores, search products, manage the cart, and open checkout — all through natural language.
How it works
The server is built with FastMCP and exposes tools that Claude can call. It communicates with Rappi via their internal web API (services.rappi.cl), authenticated with tokens extracted directly from a Chrome browser session using the Chrome DevTools Protocol (CDP).
Claude ──tools──▶ rappi_mcp.py ──HTTP──▶ services.rappi.cl
│
└──CDP──▶ Chrome (auth + checkout navigation)
Setup
1. Install dependencies
pip install -r requirements.txt
2. Configure Claude Code
Add this to your Claude Code MCP settings (claude_desktop_config.json or equivalent):
{
"mcpServers": {
"RappiMCP": {
"command": "python",
"args": ["C:/path/to/RappiMCP/rappi_mcp.py"]
}
}
}
3. Authenticate
On first use, call rappi_auth to extract your Rappi credentials from Chrome and save them to .env. No manual token copying needed.
Authentication
Rappi uses rotating JWT tokens stored as browser cookies. The auth flow:
rappi_auth(use_existing_chrome=False)— launches a dedicated Chrome window at rappi.cl (on CDP port9223) and waits up to 2 minutes for you to log in- Once logged in, it reads three cookies via CDP:
rappi.data(Base64 JSON) →user_iddeviceid→device_idrappi_refresh_token→refresh_token
- Exchanges the refresh token for a fresh
access_tokenviaPOST /api/rocket/refresh-token - Writes all four values to
.env
rappi_auth(use_existing_chrome=True) (default) — attaches to an already-running Chrome with --remote-debugging-port=9223 and reads cookies immediately (you must already be logged in).
Token refresh
RappiClient handles token rotation automatically. If any API response includes the header x-refresh-token: true, it transparently refreshes both tokens and retries the request.
Environment variables
RAPPI_ACCESS_TOKEN — Bearer token for API calls
RAPPI_REFRESH_TOKEN — Used to obtain new access tokens
RAPPI_DEVICE_ID — UUID identifying the browser session
RAPPI_USER_ID — Numeric Rappi user ID
See .env.example for the expected format.
Tools reference
rappi_auth(use_existing_chrome=True)
Extract credentials from Chrome and write them to .env. Set use_existing_chrome=False to launch a fresh Chrome window and wait for login.
rappi_reload()
Reload tokens from .env and restart the API client — without restarting the MCP server. Useful after manually editing .env.
rappi_list_stores(category, query, limit)
List stores available for delivery near your saved address.
| Param | Default | Description |
|---|---|---|
category |
"market" |
Store category: "market", "restaurant", "farma", "licores", "express-big", or any Rappi store_type slug |
query |
"" |
Optional name filter |
limit |
50 |
Max results |
Returns: store_id, name, store_type, lat, lng, eta, shipping_cost.
store_idis used byrappi_search_products.store_typeis used by all cart tools.
rappi_get_store(store_id)
Look up metadata for a specific store by its numeric ID. Returns store_type (the slug needed for cart operations).
rappi_search_products(store_id, query, size, offset)
Search products within a store. Queries in Spanish work best.
| Param | Default | Description |
|---|---|---|
store_id |
required | From rappi_list_stores |
query |
required | Search term (e.g. "cerveza", "preservativos") |
size |
40 |
Results per page (max 40) |
offset |
0 |
Pagination offset |
Returns: composite_id, name, trademark, price, real_price, discount, quantity, unit_type, sale_type, in_stock.
Use
composite_idandsale_typewhen adding to cart.
rappi_get_cart(store_type)
Read the current cart contents for a given store. Returns a list of items with composite_id, units, sale_type, name, price.
rappi_add_to_cart(store_id, store_type, composite_id, units, sale_type)
Add a product to the cart (or increment its quantity if already present). Internally: reads current cart → appends/increments → writes back via a full PUT.
rappi_remove_from_cart(store_id, store_type, composite_id)
Remove a specific product from the cart by its composite_id.
rappi_clear_cart(store_id, store_type)
Empty the entire cart for a store.
rappi_checkout(store_type)
Navigate Chrome to the checkout page for a store. Each store has its own checkout URL:
https://www.rappi.cl/checkout/{store_type}
Examples:
turbo_rappidrinks_nc→rappi.cl/checkout/turbo_rappidrinks_nccruz_verde_rappido_nc→rappi.cl/checkout/cruz_verde_rappido_nclider→rappi.cl/checkout/lider
Rappi does not support consolidated multi-store checkout. Each store cart must be checked out separately.
Typical flow
1. rappi_auth() # authenticate once
2. rappi_list_stores(category="farma") # find pharmacies
3. rappi_search_products(store_id, "preservativos") # search
4. rappi_add_to_cart(store_id, store_type, composite_id, 1, "U")
5. rappi_checkout(store_type) # open checkout in Chrome
File structure
RappiMCP/
├── rappi_mcp.py # MCP server — tool definitions, auth logic, CDP helpers
├── rappi_client.py # Rappi API client with automatic token refresh
├── requirements.txt # Python dependencies
├── .env # Credentials (git-ignored)
└── .env.example # Credentials template
Notes
- The server uses CDP port
9223(not the default9222) to avoid conflicts with other tools - Checkout navigation also uses CDP — the same Chrome instance used for auth
store_typeslugs come fromrappi_list_storesand must be passed exactly as returned (e.g."turbo_rappidrinks_nc", not"turbo")
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。