
Yandex Lavka Mcp
io.github.Dudude-bit由 GitHub 帳號 Dudude-bit 發布v0.1.6更新於 Oct 25, 2026
Unofficial MCP server for ordering Yandex Lavka groceries: search, cart, checkout.
概覽
非官方本機 MCP 伺服器,讓助理在你自己的帳號上搜尋 Yandex Lavka 雜貨、管理購物車並下真實訂單。
- 可以做什麼
- 檢查工作階段與外送地點,列出已儲存的地址,並依名稱、文字地址或經緯度切換外送點。瀏覽商品目錄:搜尋商品、查看商品詳情與營養資訊、列出分類群組與分類商品。查看、加入、修改數量與清空購物車。預覽結帳總額,列出並選擇已儲存的付款卡,確認或取消訂單,並查看進行中訂單、歷史訂單與單筆訂單詳情。
- 適用情境
- 適合讓助理處理俄羅斯 Yandex Lavka 的日常買菜:尋找商品、組成購物車,並在扣款前經過預覽與確認步驟完成下單。
- 執行需求
- 以 Python 3.12+ 套件(yandex-lavka-mcp)在本機透過 stdio 執行。需要你自己的 Yandex Lavka 工作階段 Cookie,放在設定檔中或透過 YANDEX_LAVKA_MCP_CONFIG_JSON 傳入,並需先設定外送地點才能使用目錄。Cookie 會過期,需要重新取得。遠端使用可選 HTTP 傳輸與 OAuth 設定。
安裝
在 SourceWeft 中
- 開啟 儀表板中的 Yandex Lavka Mcp,將其新增到工作區。
- 為需要使用其工具的對話啟用該服務。
Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。
其他 MCP 客戶端
參照 儲存庫 中的啟動說明。
README
yandex-lavka-mcp
[PyPI] [Python] [License: MIT] [MCP]
An MCP server that lets an AI assistant order groceries from Yandex Lavka — search products, build a cart, and place a real order — with an explicit human confirmation before any money is charged.
[!WARNING] Unofficial. Yandex Lavka has no public API. This project talks to the same private web API that
lavka.yandex.ruuses, authenticated with your own Yandex session cookies. It automates your own account, for your own shopping.
- Not affiliated with or endorsed by Yandex. Using it may violate Yandex's Terms of Service, and the private API can change or be blocked at any time.
confirm_orderspends real money on your card. Use at your own risk.- Provided as is, without warranty (see LICENSE).
What it does
Money safety. Placing an order is a deliberate two-step flow: checkout_preview
returns the full summary and charges nothing; confirm_order(confirmed_total)
refuses unless a preview was just run and you pass back the exact total it showed.
Change the cart and the preview is invalidated — you must preview again.
3-D Secure. confirm_order submits the order and charges the on-file card,
then polls payment status. If your bank requires 3-D Secure, payment_status
comes back wait_user_action and a redirect_url is returned — open it to
finish paying (a headless charge cannot complete 3DS). cancel_order(order_id)
cancels.
Multiple locations / cities. Catalog, prices and cart are location-scoped.
use_address("Дача") switches to a saved address; set_delivery_address("Казань, улица Баумана, 1", flat="12") works for any address in any city (it geocodes via
Lavka's own address search).
How it's built
- Python 3.12+ · FastMCP ·
httpx. client.py— the async API client (session auth, CSRF, request building, trims huge payloads).endpoints.py— every API path in one place (overridable from config, no code change).server.py— the MCP tools the assistant sees.
The API sits under https://lavka.yandex.ru/api/v1/providers/* (plus
/api/v1/orders/submit for placing orders). Requests need the CSRF token from
the homepage HTML plus X-Lavka-Web-* headers — the client handles this.
Setup
1. Install
2. Provide your Yandex session (one time)
Log into Lavka in your browser first, then get the session cookies into
~/.config/yandex-lavka-mcp/config.json.
macOS — pull cookies straight from Chrome (one Keychain prompt → Allow):
Any OS — paste the Cookie header from DevTools (Network → any
lavka.yandex.ru request → Request Headers → Cookie):
Session cookies expire — re-run when calls start failing with "Lavka session is not authorized".
3. Set a delivery location
Copy config.example.json to ~/.config/yandex-lavka-mcp/config.json and edit,
or set it from the assistant with use_address / set_delivery_address. The
catalog only works once a location is set. Smoke-test:
4. Register with your assistant
Claude Code:
Claude Desktop (mcpServers):
Remote deploy (order from your phone)
By default the server speaks stdio (local clients). Set
YANDEX_LAVKA_MCP_TRANSPORT=streamable-http to expose it over HTTP so a hosted
instance can back a claude.ai custom connector
(phone / web).
A prebuilt Dockerfile is included. Secrets are injected at
runtime — never baked into the image:
(The image defaults to stdio; the TRANSPORT env above switches it to HTTP.)
Environment variables
Authentication (any OIDC provider)
A public endpoint spends real money, so protect it. claude.ai's custom
connector UI only supports OAuth (no static bearer / custom header — that
works only in Claude Code/Desktop). This server is a provider-agnostic OAuth 2.1
resource server: point it at any OpenID-Connect provider (Zitadel, Keycloak,
Auth0, Google, …) and it validates JWT access tokens against that provider's
JWKS and advertises it via OAuth protected-resource metadata.
Enable it by installing the server extra (pip install '.[server]', already in
the Docker image) and setting:
A network-exposed HTTP transport refuses to start unless OAuth is configured
(it spends real money). Set YANDEX_LAVKA_MCP_ALLOW_INSECURE=1 only if you front
it with your own auth. Leaving OAuth unset is allowed for loopback/local use.
Session cookies expire; when calls start failing, re-capture them and update the
YANDEX_LAVKA_MCP_CONFIG_JSONsecret. There is no headless Yandex login. The captcha pass (below) is a separate secret, so it survives this.
Captcha from a server
Yandex may start answering a hosted instance with a captcha — decided by the server's IP, not the session (the same cookies keep working from home). Tools then fail with "Yandex anti-bot returned a captcha". Solve it once through that IP:
A throwaway Chrome window opens on the captcha; solve it. The script prints the
spravka cookie to stdout — set it as the YANDEX_LAVKA_MCP_SPRAVKA secret
(pipe it straight in) and restart. It lasts about 30 days; repeat when the
captcha error comes back.
Develop
One account = one cart
Lavka keeps a single server-side cart per account, guarded by an optimistic
cartVersion. This server serializes its own cart writes and retries on version
conflicts, so parallel tool calls in one session are safe. But don't drive the
same Yandex account from two places at once (e.g. this server and a second
MCP session, and the Lavka app): they all write the one shared cart, and you'll
see items from the other writer appear in yours. Use a single client at a time.
Security & privacy
- Cookies and address live only in
~/.config/yandex-lavka-mcp/config.json(chmod 600), git-ignored. Never commit them. - The server never adds payment methods or changes account settings.
- Ordering always requires an explicit confirmed total.
License
MIT. Unofficial project, not affiliated with Yandex.
來源:README.md,提交 8ff40f5
工具
0版本歷史
4- v0.1.6最新Oct 5, 2026
- v0.1.5Oct 4, 2026
- v0.1.4Oct 4, 2026
- v0.1.1Sep 16, 2026
評分
已滿足適用檢查項的 50%
該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。
- 近 30 天內可連通25 分
請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。
- 已宣告認證方式10 分
請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。
- 已列出工具15 分
請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。
- 描述必需15 分
- 圖示10 分
- 文件15 分
- 授權條款10 分