Albert Heijn

io.github.olekpuchkav1.4.0更新於 Oct 5, 2026

Unofficial Albert Heijn server: products, bonus deals, recipes, shopping list, orders and receipts.

概覽

AI 產生的概覽

讓助理搜尋 Albert Heijn 商品與優惠、規劃食譜、管理購物清單與收藏清單,並查看訂單與收據。

功能
這是針對荷蘭超市 Albert Heijn 的非官方 MCP 伺服器。它提供工具來搜尋商品與本週優惠、取得商品詳細資料、營養資訊與替代商品,搜尋 Allerhande 食譜並把食材加入購物清單,管理購物清單與收藏清單,查看配送時段與目前訂單的購物車,以及讀取歷史訂單與門市收據。唯讀工具會標示為唯讀,刪除資料的工具需要確認。
適用情境
如果你有 Albert Heijn 帳號,並希望助理協助採買規劃,例如尋找優惠、依人數換算食譜、建立購物清單、調整進行中的配送訂單或回顧已購買的商品,就適合使用。不在 Albert Heijn 購物則不需要安裝。
執行需求
需要 Node.js 24 與 Albert Heijn 帳號。可透過 npx 以 stdio 在本機執行,也可作為 Streamable HTTP 伺服器供遠端用戶端使用。登入是兩步瀏覽器流程:助理回傳登入連結,你從瀏覽器開發者主控台複製 appie://login-exit 代碼貼回去。權杖儲存在本機,路徑可用 AH_TOKENS_PATH 覆寫。HTTP 傳輸需要 AH_MCP_TOKEN,伺服器部署還涉及 AH_MCP_BASE_URL、AH_MCP_HOST 與 AH_MCP_PORT。
安裝前請注意
它會操作你真實的 Albert Heijn 帳號:工具會新增、修改與刪除購物清單、收藏清單與購物車內容,部分刪除類工具要求 confirm="yes"。持有 AH_MCP_TOKEN 的任何人都能使用你的帳號,請使用長隨機值,並優先採用 OAuth 或 Authorization 標頭,而不是把權杖放在 URL 中。登入權杖儲存在使用者可讀的檔案裡。本專案為非官方,使用與 AH 應用程式相同的 API,該 API 可能隨時變更。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Albert Heijn,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

[圖片]

albert-heijn-mcp

[npm] [License: Apache-2.0] [Node.js 24] [MCP]

Your Albert Heijn account, in your AI assistant.

albert-heijn-mcp is a Model Context Protocol server for Albert Heijn 🇳🇱. Connect it to any MCP client and just ask: find products and bonus deals, plan meals from Allerhande recipes, keep your shopping list and delivery order up to date, and look back at what you've bought.

[!NOTE] An unofficial project, not affiliated with or endorsed by Albert Heijn. It uses the same API as the AH mobile app, which may change without notice.


Contents

What you can ask

Ask in Dutch, English or any language your assistant speaks:

"Wat is er deze week in de bonus van wat ik meestal koop?"

Plan meals

"Find a vegetarian Allerhande recipe under 30 minutes for two, and put the ingredients on my shopping list. I already have olive oil and salt."

"Scale the panlasagne recipe to six people and tell me how much salmon I need."

"Plan three weeknight dinners around what's on bonus this week."

Save money

"Which products I usually buy are on bonus this week?"

"Rebuild tonight's stir-fry with ingredients that are on bonus, without changing the recipe too much."

"Is next week's bonus out yet? If not, when does it appear?"

"What's in the 2+1 gratis kaas deal?"

Shop

"Put the products I've had delivered at least three times back on my list."

"Find organic, gluten-free pasta, cheapest first."

"Compare the protein and sugar in these three yoghurts and add the best one to my list."

"When can AH deliver on Saturday?"

"The courgettes are sold out. What else would work in this recipe?"

"Add two more packs of milk to my upcoming delivery."

"Make a favourites list called Pasta night with everything from this recipe."

"Any vandaag-af bread or vegetables at my local AH worth picking up tonight?"

Look back

"How much did my in-store receipts add up to in September, and what were the five priciest items?"

"Show the receipt from my last shop and list anything I bought more than once."

Quick start

Requirements: Node.js 24 (LTS) and an Albert Heijn account.

There's nothing to install: connect a client with npx -y albert-heijn-mcp, which downloads and runs the latest version, then ask it to log you in to Albert Heijn.

To install it permanently instead, run npm install --global albert-heijn-mcp and use the albert-heijn-mcp command. To build from source, clone the repository.

Logging in

AH's login page has a captcha that only works on AH's own site, so logging in takes two steps:

  1. Ask your assistant to log you in. It calls ah_login and gives you a link to AH's login page; locally, it also opens in your browser. Log in as usual.

  2. Paste the code back. After you log in, AH redirects to a link meant for its iPhone app, which the browser can't open, so the page stays put. Open the developer console (Chrome: ⌘ ⌥ J on Mac, Ctrl Shift J on Windows/Linux) and find this line:

    Failed to launch 'appie://login-exit?code=…' because the scheme does not have a registered handler.

    Copy the appie://login-exit?code=… link into the chat. The code works once and expires quickly, so paste it right away.

You only log in once. Tokens are stored on your machine and refreshed automatically:

OSLocation
macOS~/Library/Application Support/albert-heijn-mcp/tokens.json
Linux~/.config/albert-heijn-mcp/tokens.json
Windows%AppData%\albert-heijn-mcp\tokens.json

The file is readable only by your user. Override the location with AH_TOKENS_PATH.

Connecting a client

albert-heijn-mcp works with any MCP client. It runs locally over stdio, or on a server over Streamable HTTP.

Local clients (stdio)

Install it in one click:

[Install in Cursor] [Install in VS Code] Other clients that start MCP servers as a local command run npx -y albert-heijn-mcp. Most of them take this JSON in their MCP settings:

json
{  "mcpServers": {    "ah": {      "command": "npx",      "args": ["-y", "albert-heijn-mcp"]    }  }}

Where the settings live differs per client; see its documentation. Clients with a CLI usually have an add command instead, e.g. <client> mcp add ah -- npx -y albert-heijn-mcp. It is also listed in the MCP Registry, which some clients install from.

[!TIP] Desktop apps don't load your shell profile, so they may not find npx (common with nvm). Then set command to the output of which npx. For a source checkout, use node with the argument /path/to/albert-heijn-mcp/dist/index.js.

Remote clients (Streamable HTTP)

Web apps such as ChatGPT and Claude.ai only connect to servers on the internet. Set one up first (Deploying to a server). The endpoint is https://your-server/mcp.

Clients that support OAuth log in to the server themselves: add the endpoint with OAuth (or automatic) authentication, and the client opens a login page on your server. Enter your AH_MCP_TOKEN there once; the client then gets its own tokens and renews them. Clients without OAuth send AH_MCP_TOKEN as an Authorization: Bearer YOUR_TOKEN header, or in the URL as https://your-server/mcp?token=YOUR_TOKEN.

ChatGPT: needs Developer mode (Plus, Pro, Business, Enterprise and Education). Open Settings → advanced settings, turn on Developer mode, and create a connector with the endpoint. Set authentication to OAuth.

Claude.ai: Settings → Connectors → Add custom connector, then paste the endpoint and choose Connect.

[!IMPORTANT] Anyone with AH_MCP_TOKEN can use your Albert Heijn account. Use a long random value (openssl rand -hex 32). Changing it also logs out every OAuth client. A token in a URL can end up in proxy logs, so prefer OAuth or the header.

Configuration

Settings are environment variables. They can also go in a .env file in the working directory (see .env.example); variables already set in the environment take precedence.

VariableDefaultDescription
AH_REMOTEfalseDon't open a browser on login. Use on servers (same as --remote).
AH_TOKENS_PATHper OSWhere to store login tokens.
AH_MCP_HOST127.0.0.1Interface the HTTP server listens on. Keep the default behind a reverse proxy.
AH_MCP_PORT3000HTTP server port.
AH_MCP_BASE_URLhttp://localhost:3000Public URL of the HTTP server. Set it on a server: OAuth clients are sent to this URL to log in, and for a non-local URL the localhost-only Host check is turned off so a reverse proxy can forward requests.
AH_MCP_TOKEN—Secret for the HTTP transport, which doesn't start without it. Clients send it as Authorization: Bearer … or ?token=…, or enter it on the OAuth login page.
AH_LOG_FILE—Also append logs to this file. Logs always go to stderr.

Command-line flags:

node dist/index.js [--transport stdio|streamable-http] [--remote] [--version] [--help]

stdio (the default) is for local clients; streamable-http serves MCP at /mcp, with OAuth login at /authorize.

Deploying to a server

albert-heijn-mcp runs as a hardened systemd service behind a reverse proxy, installed from the latest release.

  1. Prepare the server. Install Node.js 24 and create a service user:

    bash
    sudo useradd -r -m -d /home/albert-heijn-mcp -s /sbin/nologin albert-heijn-mcp
  2. Configure it in /home/albert-heijn-mcp/.env:

    env
    AH_MCP_BASE_URL=https://albert-heijn-mcp.example.comAH_MCP_TOKEN=<output of: openssl rand -hex 32>
  3. Install it with the service unit that comes with the package (it runs in --remote mode):

    bash
    sudo npm install --global --prefix /usr/local albert-heijn-mcpsudo install -m 644 /usr/local/lib/node_modules/albert-heijn-mcp/deploy/albert-heijn-mcp.service /etc/systemd/system/sudo systemctl daemon-reloadsudo systemctl enable --now albert-heijn-mcp

    To update, run the same commands, then sudo systemctl restart albert-heijn-mcp.

  4. Add TLS with a reverse proxy that forwards to 127.0.0.1:3000. With Caddy:

    albert-heijn-mcp.example.com {    reverse_proxy 127.0.0.1:3000}

The service can write only to /home/albert-heijn-mcp, where it keeps its tokens. If you point AH_LOG_FILE elsewhere, add that path to ReadWritePaths in the unit file.

Tools

Read-only tools are marked as such, so clients can run them without asking. Tools that remove data are marked destructive, so clients ask for confirmation first.

Tools that return data also return it as structured output with a declared schema, for clients that use it. Products and recipes in tool results include a url to their page on ah.nl, and the server asks the assistant to link their names to it.

Account
ToolDescription
ah_loginLog in: returns AH's login link, then completes the login with the code you paste back.
ah_logoutDelete the stored tokens, to switch accounts or reset a session.
ah_get_member_profileName, masked email, and bonus card number (last 4 digits).
Products & offers
ToolDescription
ah_search_productsSearch one or more keywords at once; Dutch terms work best. Filter by bonus=true or by filters (organic, vegan, gluten_free and other diets, allergens and labels), and sort by price, what you buy most, or Nutri-Score.
ah_get_productsDetails for one or more products. include_nutritional_info=true adds the nutrition table.
ah_get_product_alternativesSimilar products and substitutes AH suggests for a product.
ah_get_bonus_offersThis week's bonus offers, or next week's with period=next. previously_bought=true limits them to products you bought before (AH's "Eerder gekocht"). Can filter by keyword.
ah_get_bonus_group_productsThe individual products behind a group deal such as "2+1 gratis".
ah_search_storesNearby stores, by postal code or your own address.
ah_get_last_chance_itemsVandaag-af markdowns in a store; the one nearest your address by default.
Recipes
ToolDescription
ah_search_recipesSearch Allerhande recipes; Dutch terms work best.
ah_get_recipeIngredients, steps, and nutrition per serving. servings scales the ingredients.
ah_add_recipe_to_shopping_listMatch a recipe's ingredients to products and add them to the list in one step. skip leaves out what you have; dry_run=true previews the matches.
Shopping list & favourites
ToolDescription
ah_get_shopping_listYour shopping list ("Mijn lijst"), the basket you fill while shopping.
ah_add_to_shopping_listPut products on the list, with a quantity each.
ah_add_free_text_to_shopping_listAdd a free-text item, like "verse bloemen".
ah_remove_from_shopping_listRemove products or free-text items.
ah_clear_shopping_listRemove everything. Requires confirm="yes".
ah_get_favorite_listsYour favourite lists ("Mijn lijstjes").
ah_add_to_favorite_listAdd products to a favourite list.
ah_remove_from_favorite_listTake products off a favourite list.
ah_create_favorite_listStart a new, empty favourite list.
ah_delete_favorite_listDelete a favourite list and its items. Requires confirm="yes".
Delivery order

Choosing a delivery or pick-up slot in the AH app moves your shopping list into an order. ah_get_delivery_slots shows when delivery is possible; the other tools work on that order.

ToolDescription
ah_get_delivery_slotsDelivery windows at your address for the coming days.
ah_get_cartProducts in the active order, with total price and discount.
ah_update_cart_itemChange a product's quantity; 0 takes it out.
ah_remove_from_cartRemove a product from the order.
ah_clear_cartRemove everything from the order. Requires confirm="yes".
Orders & receipts
ToolDescription
ah_get_ordersUpcoming delivery orders, or past ones with past=true.
ah_get_order_detailsProducts in one order.
ah_get_frequent_itemsYour most-ordered products, counted over your delivery orders.
ah_get_receiptsRecent in-store receipts (kassabonnen).
ah_get_receipt_detailsItems, discounts and payment for one receipt.

Limitations

  • Delivery orders can't be started through the API. ah_get_delivery_slots lists the windows, but booking one, which starts the order, happens in the AH app or on ah.nl. While the order is active, AH doesn't serve the shopping list; the tools say so and point to the order tools.
  • Ticking off shopping-list items isn't supported: the API returns no usable item IDs.
  • Bonus Box, AH's personal weekly deals, is not available: its API is unknown.

Development

bash
git clone https://github.com/olekpuchka/albert-heijn-mcpcd albert-heijn-mcpnpm cinpm run build    # compile to dist/npm run lint     # type-check

Run it from the checkout with node dist/index.js, or use /path/to/albert-heijn-mcp/dist/index.js as the argument in your client's config with node as the command.

PathContents
src/index.ts, src/config.tsEntry point, flags and settings
src/ahapi/Client for AH's REST and GraphQL API, on Node's built-in fetch
src/auth/Login code exchange, token storage and refresh
src/server/Streamable HTTP transport and token check
src/tools/The MCP tools, one file per area
deploy/systemd unit, shipped in the package
listing/Name, descriptions and icon to use in connector settings and app directories (how)
.github/CI, release workflow and Dependabot
assets/Logo for this README and the server icon shown by MCP clients

The only runtime dependencies are the official MCP TypeScript SDK and Zod, which the SDK uses for tool schemas.

To call tools by hand, use the MCP Inspector:

bash
npx @modelcontextprotocol/inspector node dist/index.js

Before deploying a change, run a quick check against a real account: log in, search for melk, add a product to your shopping list and remove it again, then view your cart and orders.

To release, set the new version in package.json and in both places in server.json, merge it to main, and push a tag: git tag v1.2.3 && git push origin v1.2.3. The release workflow checks that the versions match, builds the package, attaches it to the GitHub release as albert-heijn-mcp.tgz, and stages it on npm through trusted publishing, so no npm token is stored. Approve the staged version on npmjs.com (or with npm stage approve) to make it live; the workflow then updates the MCP Registry entry.

Troubleshooting

Login fails with "exchange code"

Codes work once and expire quickly. Ask to log in again and paste the new link straight away.

No "Failed to launch" line after logging in

Open the developer console before you submit the login form, or look for the appie://login-exit?code=… request in the Network tab. Browsers other than Chrome may show the link in an error page or dialog instead.

"Not logged in", or the session seems broken

Log out and back in through the assistant, or delete tokens.json from the token location and log in again.

"There is no active delivery order to change"

AH accepts order changes only once an order exists. Choose a delivery slot in the AH app or on ah.nl first.

"The shopping list is not available while a delivery order is active"

Choosing a slot moved your list into the order. Use ah_get_cart and ah_update_cart_item until the order is delivered or cancelled.

OAuth login opens at localhost, or the client can't reach it

Set AH_MCP_BASE_URL to the server's public https:// URL and restart it. Clients are sent there to log in.

Port 3000 is in use

Set AH_MCP_PORT to another port, in the environment or .env.

License

Apache 2.0

來源:README.md,提交 bec3876

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v1.4.0最新Oct 5, 2026