yandex-lavka-mcp
An MCP server that lets an AI assistant order groceries from — search products, build a cart, and place a real order — with an explicit human confirmation before any money is charged.
에이전트 강화
게시자의 자체 명령입니다. PlugMCP 엔드포인트가 아닙니다.
Host a copy with our keys and logs.
uvx yandex-lavka-mcp==0.1.6Claude Code에는 로컬 명령용 설치 링크가 없습니다. 아래 명령을 복사해 터미널에서 실행합니다.
claude mcp add io.github.dudude-bit-yandex-lavka-mcp -- uvx yandex-lavka-mcp==0.1.6터미널에서 실행합니다.
{ "mcpServers": { "io.github.dudude-bit-yandex-lavka-mcp": { "command": "uvx", "args": [ "yandex-lavka-mcp==0.1.6" ] } }}claude_desktop_config.json
원격 URL인가요, 내 컴퓨터에서 실행하는 명령인가요? 두 설치 방식의 차이
PlugMCP에서 실행
A new server you create. It is not this listing's official endpoint. Use the publisher install when you want their URL and their credentials.
실행게시자 제공
An MCP server that lets an AI assistant order groceries from — search products, build a cart, and place a real order — with an explicit human confirmation before any money is charged.
Unofficial MCP server for ordering Yandex Lavka groceries: search, cart, checkout.
[!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).
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).
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.
uv venv && uv pip install -e .
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):
uv pip install -e '.[browser]'
python scripts/extract_chrome_cookies.py # auto-detects your profile
Any OS — paste the Cookie header from DevTools (Network → any
lavka.yandex.ru request → Request Headers → Cookie):
python scripts/import_cookies.py --header "Session_id=...; yandexuid=...; L=..."
Session cookies expire — re-run when calls start failing with "Lavka session is not authorized".
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:
python scripts/smoke.py "молоко"
Claude Code:
claude mcp add yandex-lavka -- uv run --directory /path/to/yandex-lavka-mcp yandex-lavka-mcp
Claude Desktop (mcpServers):
{
"yandex-lavka": {
"command": "uv",
"args": ["run", "--directory", "/path/to/yandex-lavka-mcp", "yandex-lavka-mcp"]
}
}
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:
docker build -t yandex-lavka-mcp .
docker run -p 8000:8000 \
-e YANDEX_LAVKA_MCP_TRANSPORT=streamable-http \
-e YANDEX_LAVKA_MCP_CONFIG_JSON="$(cat ~/.config/yandex-lavka-mcp/config.json)" \
yandex-lavka-mcp
(The image defaults to stdio; the TRANSPORT env above switches it to HTTP.)
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.
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:
ssh -f -N -D 1080 <your-server> # SOCKS proxy out of the server's IP
uv run --with playwright python scripts/solve_captcha.py --proxy socks5://127.0.0.1:1080
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.
uv pip install -e ".[dev]"
pytest
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.
~/.config/yandex-lavka-mcp/config.json
(chmod 600), git-ignored. Never commit them.MIT. Unofficial project, not affiliated with Yandex.
Unofficial MCP server for ordering Yandex Lavka groceries: search, cart, checkout.
{ "mcpServers": { "io.github.dudude-bit-yandex-lavka-mcp": { "command": "uvx", "args": [ "yandex-lavka-mcp==0.1.6" ] } }}도구
아직 도구 목록이 없습니다. 원격 서버는 첫 상태 확인 후에 도구 목록이 생깁니다.
FAQ
이 페이지에서 Cursor, Claude Desktop, Claude Code 또는 VS Code용 stdio 설정을 복사합니다. PlugMCP 프록시가 아니라 게시자의 설치 방식을 사용합니다.
이 레코드에는 필수 환경 변수가 등록되어 있지 않습니다.
Yandex Lavka은(는) stdio를 통해 로컬에서 실행됩니다.
마지막 확인: 2026-11-09. Unofficial MCP server for ordering Yandex Lavka groceries: search, cart, checkout.