albert-heijn-mcp 1.5.1 β†’ 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -9,7 +9,9 @@
9
9
 
10
10
  **Your Albert Heijn account, in your AI assistant.**
11
11
 
12
- albert-heijn-mcp is a [Model Context Protocol](https://modelcontextprotocol.io) 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.
12
+ Connect your Albert Heijn account to an AI assistant such as Claude, ChatGPT or Cursor, and do your grocery shopping by just asking. 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.
13
+
14
+ Technically, it's a [Model Context Protocol](https://modelcontextprotocol.io) (MCP) server for Albert Heijn πŸ‡³πŸ‡±. MCP is the standard way AI apps connect to other services, so it works with any app that supports MCP.
13
15
 
14
16
  > [!NOTE]
15
17
  > 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.
@@ -18,15 +20,18 @@ albert-heijn-mcp is a [Model Context Protocol](https://modelcontextprotocol.io)
18
20
 
19
21
  ## Contents
20
22
 
23
+ **For everyone**
24
+
21
25
  - [What you can ask](#what-you-can-ask)
22
- - [Quick start](#quick-start)
23
- - [Logging in](#logging-in)
24
- - [Connecting a client](#connecting-a-client)
26
+ - [Getting started](#getting-started): [connect your app](#connecting-a-client), then [log in](#logging-in)
27
+ - [Troubleshooting](#troubleshooting)
28
+
29
+ **Technical details**
30
+
31
+ - [Running it on a server](#running-it-on-a-server) for ChatGPT and Claude.ai
25
32
  - [Configuration](#configuration)
26
- - [Deploying to a server](#deploying-to-a-server)
27
33
  - [Tools](#tools) and [limitations](#limitations)
28
34
  - [Development](#development)
29
- - [Troubleshooting](#troubleshooting)
30
35
 
31
36
  ## What you can ask
32
37
 
@@ -76,49 +81,51 @@ Ask in Dutch, English or any language your assistant speaks:
76
81
 
77
82
  > *"Show the receipt from my last shop and list anything I bought more than once."*
78
83
 
79
- ## Quick start
84
+ ## Getting started
80
85
 
81
- **Requirements:** Node.js 24 (LTS) and an Albert Heijn account.
86
+ You need an Albert Heijn account. Then:
82
87
 
83
- There's nothing to install: [connect a client](#connecting-a-client) with `npx -y albert-heijn-mcp`, which downloads and runs the [latest version](https://www.npmjs.com/package/albert-heijn-mcp), then ask it to log you in to Albert Heijn.
88
+ 1. **[Connect your app](#connecting-a-client)**: pick yours below.
89
+ 2. **[Log in to Albert Heijn](#logging-in)**: ask your assistant to log you in, once.
90
+ 3. **Ask away.** See [what you can ask](#what-you-can-ask).
84
91
 
85
- To install it permanently instead, run `npm install --global albert-heijn-mcp` and use the `albert-heijn-mcp` command; run the same command again to update. To [build from source](#development), clone the repository.
92
+ ## Connecting a client
86
93
 
87
- ## Logging in
94
+ | Your app | How |
95
+ |---|---|
96
+ | **Claude Desktop** | [Download and double-click](#claude-desktop). Easiest; nothing else to install. |
97
+ | **Cursor**, **VS Code** | [One-click install button](#cursor-and-vs-code) |
98
+ | **ChatGPT**, **Claude.ai** (web and mobile) | [Needs your own server](#chatgpt-and-claudeai) (technical) |
99
+ | **Other apps** | [Add a command to the app's settings](#other-apps) |
88
100
 
89
- AH's login page has a captcha that only works on AH's own site, so logging in takes two steps:
101
+ ### Claude Desktop
90
102
 
91
- 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.
92
- 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: <kbd>⌘</kbd> <kbd>βŒ₯</kbd> <kbd>J</kbd> on Mac, <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>J</kbd> on Windows/Linux) and find this line:
103
+ 1. Download [`albert-heijn-mcp.mcpb`](https://github.com/olekpuchka/albert-heijn-mcp/releases/latest/download/albert-heijn-mcp.mcpb).
104
+ 2. Double-click it and choose **Install**. If it doesn't open in Claude, go to Settings β†’ Extensions β†’ Advanced settings β†’ Install Extension… and pick the file.
93
105
 
94
- ```
95
- Failed to launch 'appie://login-exit?code=…' because the scheme does not have a registered handler.
96
- ```
106
+ That's it: the file contains everything it needs. To update, do the same with the file from the newest release.
97
107
 
98
- Copy the `appie://login-exit?code=…` link into the chat. The code works once and expires quickly, so paste it right away.
108
+ Other desktop apps that support [MCP Bundles](https://github.com/modelcontextprotocol/mcpb) (`.mcpb` files) install it the same way.
99
109
 
100
- You only log in once. Tokens are stored on your machine and refreshed automatically:
110
+ ### Cursor and VS Code
101
111
 
102
- | OS | Location |
103
- |---|---|
104
- | macOS | `~/Library/Application Support/albert-heijn-mcp/tokens.json` |
105
- | Linux | `~/.config/albert-heijn-mcp/tokens.json` (or under `$XDG_CONFIG_HOME`) |
106
- | Windows | `%AppData%\albert-heijn-mcp\tokens.json` |
112
+ Install [Node.js 24 (LTS)](https://nodejs.org) first, then click:
107
113
 
108
- The file is readable only by your user. Override the location with `AH_TOKENS_PATH`.
114
+ [![Install in Cursor](https://img.shields.io/badge/Cursor-Install_server-000000?logo=cursor&logoColor=white)](https://cursor.com/en/install-mcp?name=ah&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImFsYmVydC1oZWlqbi1tY3AiXX0%3D)
115
+ [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_server-0098FF)](https://insiders.vscode.dev/redirect/mcp/install?name=ah&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22albert-heijn-mcp%22%5D%7D)
109
116
 
110
- ## Connecting a client
117
+ ### ChatGPT and Claude.ai
111
118
 
112
- albert-heijn-mcp works with any MCP client. It runs locally over stdio, or on a server over Streamable HTTP.
119
+ Web and mobile apps can't run anything on your computer; they only connect to servers on the internet. So you first need to [run it on a server](#running-it-on-a-server), which takes some technical know-how. Then add it as a connector:
113
120
 
114
- ### Local clients (stdio)
121
+ - **ChatGPT** needs Developer mode (Plus, Pro, Business, Enterprise and Education). Open Settings β†’ advanced settings, turn on Developer mode, and create a connector with `https://your-server/mcp`. Set authentication to **OAuth**.
122
+ - **Claude.ai**: Settings β†’ Connectors β†’ Add custom connector, paste `https://your-server/mcp` and choose Connect.
115
123
 
116
- Install it in one click:
124
+ The app then opens a login page on your server: enter your `AH_MCP_TOKEN` there, once.
117
125
 
118
- [![Install in Cursor](https://img.shields.io/badge/Cursor-Install_server-000000?logo=cursor&logoColor=white)](https://cursor.com/en/install-mcp?name=ah&config=eyJjb21tYW5kIjoibnB4IiwiYXJncyI6WyIteSIsImFsYmVydC1oZWlqbi1tY3AiXX0%3D)
119
- [![Install in VS Code](https://img.shields.io/badge/VS_Code-Install_server-0098FF)](https://insiders.vscode.dev/redirect/mcp/install?name=ah&config=%7B%22command%22%3A%22npx%22%2C%22args%22%3A%5B%22-y%22%2C%22albert-heijn-mcp%22%5D%7D)
126
+ ### Other apps
120
127
 
121
- 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:
128
+ Apps that start MCP servers as a local command need [Node.js 24 (LTS)](https://nodejs.org) and run `npx -y albert-heijn-mcp`, which downloads and runs the [latest version](https://www.npmjs.com/package/albert-heijn-mcp). Most of them take this JSON in their MCP settings:
122
129
 
123
130
  ```json
124
131
  {
@@ -131,49 +138,130 @@ Other clients that start MCP servers as a local command run `npx -y albert-heijn
131
138
  }
132
139
  ```
133
140
 
134
- 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](https://registry.modelcontextprotocol.io), which some clients install from.
141
+ Where the settings live differs per app; see its documentation. Apps with a command line 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](https://registry.modelcontextprotocol.io), which some apps install from.
142
+
143
+ To install it permanently instead, run `npm install --global albert-heijn-mcp` and use the `albert-heijn-mcp` command; run the same command again to update.
135
144
 
136
145
  > [!TIP]
137
- > 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`.
146
+ > 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`.
138
147
 
139
- ### Remote clients (Streamable HTTP)
148
+ ## Logging in
140
149
 
141
- Web apps such as ChatGPT and Claude.ai only connect to servers on the internet. Set one up first ([Deploying to a server](#deploying-to-a-server)). The endpoint is `https://your-server/mcp`.
150
+ Ask your assistant to log you in to Albert Heijn. You only do this once; the login is then kept and renewed automatically.
142
151
 
143
- Clients log in with OAuth: 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. The server accepts only these OAuth tokens, not `AH_MCP_TOKEN` itself, so clients without OAuth support can't connect over HTTP; run them locally over [stdio](#local-clients-stdio) instead.
152
+ **On your computer** (Claude Desktop, Cursor, VS Code and other local apps), a separate browser window opens with AH's login page. Log in there as usual: the window closes by itself and you're logged in. Then tell your assistant you're done.
144
153
 
145
- **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**.
154
+ The window uses a fresh, empty browser profile, so type your password: saved passwords and password-manager extensions aren't available there. It needs Chrome, Edge, Brave or Chromium (not the snap version on Ubuntu) and a screen; otherwise you copy the code by hand as below.
146
155
 
147
- **Claude.ai**: Settings β†’ Connectors β†’ Add custom connector, then paste the endpoint and choose Connect.
156
+ **On a server** (ChatGPT, Claude.ai), or when no login window can open, you copy a code by hand. AH's login page has a captcha that only works on AH's own website, so the code has to come from your browser:
148
157
 
149
- > [!IMPORTANT]
150
- > Anyone with `AH_MCP_TOKEN` can log in and use your Albert Heijn account. Use a long random value (`openssl rand -hex 32`). Changing it logs out every client.
158
+ 1. **Open the link** your assistant gives you and log in as usual.
159
+ 2. **Copy the code back into the chat.** After you log in, AH tries to open its phone app, which your browser can't do, so the page seems stuck. The code you need is in the browser's developer console, a panel for web developers that you can open safely:
160
+ - Open it in Chrome with <kbd>⌘</kbd> <kbd>βŒ₯</kbd> <kbd>J</kbd> on Mac, or <kbd>Ctrl</kbd> <kbd>Shift</kbd> <kbd>J</kbd> on Windows and Linux.
161
+ - Find this red line:
151
162
 
152
- ## Configuration
163
+ ```
164
+ Failed to launch 'appie://login-exit?code=…' because the scheme does not have a registered handler.
165
+ ```
153
166
 
154
- Settings are environment variables. They can also go in a `.env` file in the working directory (see [`.env.example`](.env.example)); variables already set in the environment take precedence.
167
+ - Copy the part from `appie://` up to the closing quote and paste it into the chat. The code works once and expires quickly, so paste it right away.
155
168
 
156
- | Variable | Default | Description |
157
- |---|---|---|
158
- | `AH_REMOTE` | `false` | Don't open a browser on login (same as `--remote`). Always on with `streamable-http`. |
159
- | `AH_TOKENS_PATH` | [per OS](#logging-in) | Where to store login tokens. |
160
- | `AH_MCP_HOST` | `127.0.0.1` | Interface the HTTP server listens on. Keep the default behind a reverse proxy. |
161
- | `AH_MCP_PORT` | `3000` | HTTP server port. |
162
- | `AH_MCP_BASE_URL` | `http://localhost:3000` | Public 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. |
163
- | `AH_MCP_TOKEN` | β€” | Secret for the HTTP transport, at least 32 characters; the transport doesn't start without it. You enter it on the OAuth login page; it also signs the OAuth tokens. |
164
- | `AH_LOG_FILE` | β€” | Also append logs to this file. Logs always go to stderr. |
169
+ No line there? See [Troubleshooting](#troubleshooting). To log a server in without the developer console, see [Running it on a server](#running-it-on-a-server).
165
170
 
166
- Command-line flags:
171
+ <details>
172
+ <summary><b>Where your login is stored</b></summary>
167
173
 
168
- ```
169
- node dist/index.js [--transport stdio|streamable-http] [--remote] [--version] [--help]
170
- ```
174
+ Your login is saved on your own computer and renewed automatically, in a file only your user can read:
175
+
176
+ | OS | Location |
177
+ |---|---|
178
+ | macOS | `~/Library/Application Support/albert-heijn-mcp/tokens.json` |
179
+ | Linux | `~/.config/albert-heijn-mcp/tokens.json` (or under `$XDG_CONFIG_HOME`) |
180
+ | Windows | `%AppData%\albert-heijn-mcp\tokens.json` |
181
+
182
+ Override the location with `AH_TOKENS_PATH`.
183
+ </details>
184
+
185
+ ## Troubleshooting
171
186
 
172
- `stdio` (the default) is for local clients; `streamable-http` serves MCP at `/mcp`, with OAuth login at `/authorize`.
187
+ <details>
188
+ <summary><b>No login window opens</b></summary>
189
+
190
+ The login window needs Chrome, Edge, Brave or Chromium installed in the usual place, and a screen: not over SSH, and not with Ubuntu's snap Chromium. Without one, your assistant gives you the link instead, and you [copy the code by hand](#logging-in). If the window closed before you finished, ask to log in again.
191
+ </details>
192
+
193
+ <details>
194
+ <summary><b>No "Failed to launch" line after logging in</b></summary>
195
+
196
+ 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.
197
+ </details>
198
+
199
+ <details>
200
+ <summary><b>Login fails with "exchange code"</b></summary>
201
+
202
+ Codes work once and expire quickly. Ask to log in again and paste the new link straight away.
203
+ </details>
204
+
205
+ <details>
206
+ <summary><b>"Not logged in", or the session seems broken</b></summary>
207
+
208
+ Ask your assistant to log you out and back in, or delete `tokens.json` from the [login location](#logging-in) and log in again.
209
+ </details>
210
+
211
+ <details>
212
+ <summary><b>"Already connected as …" when pasting a login code</b></summary>
213
+
214
+ A code never replaces a working login, so a code from someone else's account can't switch you over. To switch accounts, ask to log out first, then log in again.
215
+ </details>
173
216
 
174
- ## Deploying to a server
217
+ <details>
218
+ <summary><b>"There is no active delivery order to change"</b></summary>
175
219
 
176
- albert-heijn-mcp runs as a hardened systemd service behind a reverse proxy, installed from npm.
220
+ AH accepts order changes only once an order exists. Choose a delivery slot in the AH app or on ah.nl first.
221
+ </details>
222
+
223
+ <details>
224
+ <summary><b>"The shopping list is not available while a delivery order is active"</b></summary>
225
+
226
+ Choosing a slot moved your list into the order. Ask your assistant to change the order instead (`ah_get_cart`, `ah_update_cart_item`) until it is delivered or cancelled.
227
+ </details>
228
+
229
+ <details>
230
+ <summary><b>The server doesn't start: "needs AH_MCP_TOKEN of at least 32 characters"</b></summary>
231
+
232
+ Set `AH_MCP_TOKEN` to a long random value, e.g. the output of `openssl rand -hex 32`, and restart. Changing it logs out every client; reconnect them once.
233
+ </details>
234
+
235
+ <details>
236
+ <summary><b>Server login page shows "This login link is not valid"</b></summary>
237
+
238
+ Start connecting again from the app. If it keeps happening right after you enter the token, check that `AH_MCP_BASE_URL` is exactly the address in your browser, including `https://`: the login form is only accepted from that address.
239
+ </details>
240
+
241
+ <details>
242
+ <summary><b>Server login opens at localhost, or the app can't reach it</b></summary>
243
+
244
+ Set `AH_MCP_BASE_URL` to the server's public `https://` URL and restart it. Apps are sent there to log in.
245
+ </details>
246
+
247
+ <details>
248
+ <summary><b>Port 3000 is in use</b></summary>
249
+
250
+ Set `AH_MCP_PORT` to another port, in the environment or `.env`.
251
+ </details>
252
+
253
+ ---
254
+
255
+ ## Running it on a server
256
+
257
+ Web and mobile apps such as ChatGPT and Claude.ai need the server on the internet, over Streamable HTTP with HTTPS. The endpoint is `https://your-server/mcp`.
258
+
259
+ Apps log in with OAuth: add the endpoint with OAuth (or automatic) authentication, and the app opens a login page on your server. Enter your `AH_MCP_TOKEN` there once; the app then gets its own tokens and renews them. The server accepts only these OAuth tokens, not `AH_MCP_TOKEN` itself, so apps without OAuth support can't connect over HTTP; run them [locally](#other-apps) instead.
260
+
261
+ > [!IMPORTANT]
262
+ > Anyone with `AH_MCP_TOKEN` can log in and use your Albert Heijn account. Use a long random value (`openssl rand -hex 32`). Changing it logs out every client.
263
+
264
+ It runs as a hardened systemd service behind a reverse proxy, installed from npm:
177
265
 
178
266
  1. **Prepare the server.** Install Node.js 24 and create a service user:
179
267
 
@@ -209,26 +297,59 @@ albert-heijn-mcp runs as a hardened systemd service behind a reverse proxy, inst
209
297
  }
210
298
  ```
211
299
 
300
+ To log the server in to Albert Heijn, ask a connected app to log you in and [copy the code by hand](#logging-in). Or skip the code: log in on your own computer with the login window, then copy the login to the server:
301
+
302
+ ```bash
303
+ AH_TOKENS_PATH=./server-tokens.json npx -y albert-heijn-mcp login
304
+ scp server-tokens.json your-server:ah-tokens.json && rm server-tokens.json
305
+ ssh -t your-server 'sudo sh -c "install -d -o albert-heijn-mcp -g albert-heijn-mcp -m 700 /home/albert-heijn-mcp/.config/albert-heijn-mcp && install -o albert-heijn-mcp -g albert-heijn-mcp -m 600 $HOME/ah-tokens.json /home/albert-heijn-mcp/.config/albert-heijn-mcp/tokens.json.new && mv /home/albert-heijn-mcp/.config/albert-heijn-mcp/tokens.json.new /home/albert-heijn-mcp/.config/albert-heijn-mcp/tokens.json && rm $HOME/ah-tokens.json"'
306
+ ```
307
+
308
+ The server picks it up on the next request; no restart needed. The separate file keeps your computer's own login apart: AH replaces a login every time it's renewed, so only one place can use each login. On a host without SSH, upload it to where the server keeps its login: `AH_TOKENS_PATH`, or the [default location](#logging-in) for the user it runs as.
309
+
212
310
  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.
213
311
 
312
+ ## Configuration
313
+
314
+ Settings are environment variables. They can also go in a `.env` file in the working directory (see [`.env.example`](.env.example)); variables already set in the environment take precedence.
315
+
316
+ | Variable | Default | Description |
317
+ |---|---|---|
318
+ | `AH_REMOTE` | `false` | Don't open a browser on login; log in by copying the code instead (same as `--remote`). Always on with `streamable-http`. |
319
+ | `AH_TOKENS_PATH` | [per OS](#logging-in) | Where to store login tokens. |
320
+ | `AH_MCP_HOST` | `127.0.0.1` | Interface the HTTP server listens on. Keep the default behind a reverse proxy. |
321
+ | `AH_MCP_PORT` | `3000` | HTTP server port. |
322
+ | `AH_MCP_BASE_URL` | `http://localhost:3000` | Public 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. |
323
+ | `AH_MCP_TOKEN` | β€” | Secret for the HTTP transport, at least 32 characters; the transport doesn't start without it. You enter it on the OAuth login page; it also signs the OAuth tokens. |
324
+ | `AH_LOG_FILE` | β€” | Also append logs to this file. Logs always go to stderr. |
325
+
326
+ Command-line flags:
327
+
328
+ ```
329
+ node dist/index.js [--transport stdio|streamable-http] [--remote] [--version] [--help]
330
+ node dist/index.js login [--remote]
331
+ ```
332
+
333
+ `stdio` (the default) is for local clients; `streamable-http` serves MCP at `/mcp`, with OAuth login at `/authorize`. `login` logs in to Albert Heijn from the terminal, saves the tokens and exits; with `--remote` it asks for the code instead of opening a login window.
334
+
214
335
  ## Tools
215
336
 
216
- 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.
337
+ These are what your assistant uses behind the scenes; you don't call them yourself. Read-only tools are marked as such, so apps can run them without asking. Tools that remove data are marked destructive, so apps ask for confirmation first.
217
338
 
218
339
  Tools that return data also return it as [structured output](https://modelcontextprotocol.io/specification/2025-06-18/server/tools#structured-content) 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.
219
340
 
220
- <details open>
341
+ <details>
221
342
  <summary><b>Account</b></summary>
222
343
 
223
344
  | Tool | Description |
224
345
  |---|---|
225
- | `ah_login` | Log in: returns AH's login link, then completes the login with the code you paste back. |
346
+ | `ah_login` | Log in: opens a login window on your computer, or returns AH's login link and completes the login with the code you paste back. |
226
347
  | `ah_logout` | Delete the stored tokens, to switch accounts or reset a session. |
227
348
  | `ah_get_member_profile` | Name, masked email, and bonus card number (last 4 digits). |
228
349
 
229
350
  </details>
230
351
 
231
- <details open>
352
+ <details>
232
353
  <summary><b>Products & offers</b></summary>
233
354
 
234
355
  | Tool | Description |
@@ -243,7 +364,7 @@ Tools that return data also return it as [structured output](https://modelcontex
243
364
 
244
365
  </details>
245
366
 
246
- <details open>
367
+ <details>
247
368
  <summary><b>Recipes</b></summary>
248
369
 
249
370
  | Tool | Description |
@@ -254,7 +375,7 @@ Tools that return data also return it as [structured output](https://modelcontex
254
375
 
255
376
  </details>
256
377
 
257
- <details open>
378
+ <details>
258
379
  <summary><b>Shopping list & favourites</b></summary>
259
380
 
260
381
  | Tool | Description |
@@ -272,7 +393,7 @@ Tools that return data also return it as [structured output](https://modelcontex
272
393
 
273
394
  </details>
274
395
 
275
- <details open>
396
+ <details>
276
397
  <summary><b>Delivery order</b></summary>
277
398
 
278
399
  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.
@@ -287,7 +408,7 @@ Choosing a delivery or pick-up slot in the AH app moves your shopping list into
287
408
 
288
409
  </details>
289
410
 
290
- <details open>
411
+ <details>
291
412
  <summary><b>Orders & receipts</b></summary>
292
413
 
293
414
  | Tool | Description |
@@ -321,12 +442,13 @@ Run it from the checkout with `node dist/index.js`, or use `/path/to/albert-heij
321
442
 
322
443
  | Path | Contents |
323
444
  |---|---|
324
- | [`src/index.ts`](src/index.ts), [`src/config.ts`](src/config.ts) | Entry point, flags and settings |
445
+ | [`src/index.ts`](src/index.ts), [`src/config.ts`](src/config.ts), [`src/loginCommand.ts`](src/loginCommand.ts) | Entry point, flags and settings, and the `login` command |
325
446
  | [`src/ahapi/`](src/ahapi) | Client for AH's REST and GraphQL API, on Node's built-in `fetch` |
326
- | [`src/auth/`](src/auth) | Login code exchange, token storage and refresh |
447
+ | [`src/auth/`](src/auth) | Login window, login code exchange, token storage and refresh |
327
448
  | [`src/server/`](src/server) | Streamable HTTP transport and OAuth login |
328
449
  | [`src/tools/`](src/tools) | The MCP tools, one file per area |
329
450
  | [`deploy/`](deploy) | systemd unit, shipped in the package |
451
+ | [`manifest.json`](manifest.json), [`.mcpbignore`](.mcpbignore) | Manifest of the `.mcpb` bundle, and the files it leaves out |
330
452
  | [`listing/`](listing) | Name, descriptions and icon to use in connector settings and app directories ([how](listing/README.md)) |
331
453
  | [`.github/`](.github) | CI, release workflow, Dependabot and the pinned `mcp-publisher` install |
332
454
  | [`assets/`](assets) | Logo for this README and the server icon shown by MCP clients |
@@ -341,69 +463,7 @@ npx @modelcontextprotocol/inspector node dist/index.js
341
463
 
342
464
  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.
343
465
 
344
- To release, set the new version with `npm version 1.2.3 --no-git-tag-version` and in both places in [`server.json`](server.json), merge it to `main`, and push a tag: `git tag v1.2.3 && git push origin v1.2.3`. Only repository admins can create `v*` tags. The [release workflow](.github/workflows/release.yml) 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](https://docs.npmjs.com/trusted-publishers), 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](https://registry.modelcontextprotocol.io) entry. The release starts without notes; write them on GitHub.
345
-
346
- ## Troubleshooting
347
-
348
- <details>
349
- <summary><b>Login fails with "exchange code"</b></summary>
350
-
351
- Codes work once and expire quickly. Ask to log in again and paste the new link straight away.
352
- </details>
353
-
354
- <details>
355
- <summary><b>No "Failed to launch" line after logging in</b></summary>
356
-
357
- 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.
358
- </details>
359
-
360
- <details>
361
- <summary><b>"Not logged in", or the session seems broken</b></summary>
362
-
363
- Log out and back in through the assistant, or delete `tokens.json` from the [token location](#logging-in) and log in again.
364
- </details>
365
-
366
- <details>
367
- <summary><b>"There is no active delivery order to change"</b></summary>
368
-
369
- AH accepts order changes only once an order exists. Choose a delivery slot in the AH app or on ah.nl first.
370
- </details>
371
-
372
- <details>
373
- <summary><b>"The shopping list is not available while a delivery order is active"</b></summary>
374
-
375
- 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.
376
- </details>
377
-
378
- <details>
379
- <summary><b>"Already connected as …" when pasting a login code</b></summary>
380
-
381
- A code never replaces a working login, so a code from someone else's account can't switch you over. To switch accounts, ask to log out first, then log in again.
382
- </details>
383
-
384
- <details>
385
- <summary><b>The HTTP server doesn't start: "needs AH_MCP_TOKEN of at least 32 characters"</b></summary>
386
-
387
- Set `AH_MCP_TOKEN` to a long random value, e.g. the output of `openssl rand -hex 32`, and restart. Changing it logs out every client; reconnect them once.
388
- </details>
389
-
390
- <details>
391
- <summary><b>OAuth login shows "This login link is not valid"</b></summary>
392
-
393
- Start connecting again from the client. If it keeps happening right after you enter the token, check that `AH_MCP_BASE_URL` is exactly the address in your browser, including `https://`: the login form is only accepted from that address.
394
- </details>
395
-
396
- <details>
397
- <summary><b>OAuth login opens at localhost, or the client can't reach it</b></summary>
398
-
399
- Set `AH_MCP_BASE_URL` to the server's public `https://` URL and restart it. Clients are sent there to log in.
400
- </details>
401
-
402
- <details>
403
- <summary><b>Port 3000 is in use</b></summary>
404
-
405
- Set `AH_MCP_PORT` to another port, in the environment or `.env`.
406
- </details>
466
+ To release, set the new version with `npm version 1.2.3 --no-git-tag-version` and in both places in [`server.json`](server.json) and in [`manifest.json`](manifest.json), merge it to `main`, and push a tag: `git tag v1.2.3 && git push origin v1.2.3`. Only repository admins can create `v*` tags. The [release workflow](.github/workflows/release.yml) checks that the versions match, builds the package, attaches it to the GitHub release as `albert-heijn-mcp.tgz` together with the `albert-heijn-mcp.mcpb` bundle, and stages the package on npm through [trusted publishing](https://docs.npmjs.com/trusted-publishers), 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](https://registry.modelcontextprotocol.io) entry. The release starts without notes; write them on GitHub.
407
467
 
408
468
  ## License
409
469
 
@@ -35,6 +35,14 @@ export class AhApiError extends Error {
35
35
  export function hasStatus(err, status) {
36
36
  return err instanceof AhApiError && err.status === status;
37
37
  }
38
+ /** Reports whether err, or any error in its cause chain, is an HTTP 401 from AH. */
39
+ export function isUnauthorized(err) {
40
+ for (let e = err; e instanceof Error; e = e.cause) {
41
+ if (hasStatus(e, 401))
42
+ return true;
43
+ }
44
+ return false;
45
+ }
38
46
  /** An error with our own context in front of its cause's message. */
39
47
  export class ContextError extends Error {
40
48
  /** Our text, without the cause's (which may quote AH). */
@@ -1 +1 @@
1
- {"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/ahapi/client.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAEhF,OAAO,EAAE,aAAa,EAAgB,MAAM,WAAW,CAAC;AAExD,yEAAyE;AACzE,sEAAsE;AACtE,MAAM,CAAC,MAAM,WAAW,GAAG,WAAW,CAAC;AACvC,MAAM,cAAc,GAAG,MAAM,CAAC;AAC9B,MAAM,UAAU,GAAG,4DAA4D,CAAC;AAChF,MAAM,QAAQ,GAAG,mBAAmB,CAAC;AACrC,MAAM,UAAU,GAAG,MAAM,CAAC;AAE1B;;;GAGG;AACH,SAAS,SAAS,CAAC,IAAY;IAC7B,IAAI,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;IAC/B,8DAA8D;IAC9D,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;QAAE,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC,cAAc,EAAE,GAAG,CAAC,CAAC;IACjE,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC;AAED,8BAA8B;AAC9B,MAAM,OAAO,UAAW,SAAQ,KAAK;IAC1B,MAAM,CAAS;IAExB,uCAAuC;IACvC,YAAY,MAAc,EAAE,IAAY;QACtC,KAAK,CAAC,gBAAgB,MAAM,KAAK,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACpD,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB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 /** "First Last", as AH shows it. */
2
+ export function fullName(m) {
3
+ return `${m.firstName} ${m.lastName}`.trim();
4
+ }
1
5
  export async function getMember(c) {
2
6
  const query = `query Member {
3
7
  member {
@@ -1 +1 @@
1
- {"version":3,"file":"member.js","sourceRoot":"","sources":["../../src/ahapi/member.ts"],"names":[],"mappings":"AAsBA,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,CAAW;IACzC,MAAM,KAAK,GAAG;;;;;;;EAOd,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,CAAC,EAAE,GAAG,MAAM,CAAC,CAAC,OAAO,CAOlC,KAAK,CAAC,CAAC;IACV,OAAO;QACL,SAAS,EAAE,CAAC,CAAC,IAAI,EAAE,KAAK,IAAI,EAAE;QAC9B,QAAQ,EAAE,CAAC,CAAC,IAAI,EAAE,IAAI,IAAI,EAAE;QAC5B,KAAK,EAAE,CAAC,CAAC,YAAY,IAAI,EAAE;QAC3B,UAAU,EAAE,CAAC,CAAC,OAAO,EAAE,UAAU,IAAI,EAAE;QACvC,eAAe,EAAE,CAAC,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE;QACrC,OAAO,EAAE,UAAU,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,SAAS;KACvD,CAAC;AACJ,CAAC;AAED,SAAS,UAAU,CAAC,CAA4C;IAC9D,OAAO,OAAO,CAAC,CAAC,EAAE,MAAM,IAAI,CAAC,CAAC,WAAW,IAAI,CAAC,CAAC,UAAU,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,WAAW,CAAC,CAAC;AACxF,CAAC"}
1
+ {"version":3,"file":"member.js","sourceRoot":"","sources":["../../src/ahapi/member.ts"],"names":[],"mappings":"AAsBA,oCAAoC;AACpC,MAAM,UAAU,QAAQ,CAAC,CAAS;IAChC,OAAO,GAAG,CAAC,CAAC,SAAS,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,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