@charlie.act7/gemini-notebook-mcp 2.1.3 → 2.3.1

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.
Files changed (85) hide show
  1. package/README.md +467 -434
  2. package/dist/auth/auth-manager.d.ts +2 -2
  3. package/dist/auth/auth-manager.d.ts.map +1 -1
  4. package/dist/auth/auth-manager.js +27 -26
  5. package/dist/auth/auth-manager.js.map +1 -1
  6. package/dist/errors.d.ts +10 -1
  7. package/dist/errors.d.ts.map +1 -1
  8. package/dist/errors.js +19 -0
  9. package/dist/errors.js.map +1 -1
  10. package/dist/index.js +53 -17
  11. package/dist/index.js.map +1 -1
  12. package/dist/library/notebook-library.d.ts +7 -3
  13. package/dist/library/notebook-library.d.ts.map +1 -1
  14. package/dist/library/notebook-library.js +162 -14
  15. package/dist/library/notebook-library.js.map +1 -1
  16. package/dist/library/types.d.ts +18 -0
  17. package/dist/library/types.d.ts.map +1 -1
  18. package/dist/notebooklm/artifact-store.d.ts +26 -0
  19. package/dist/notebooklm/artifact-store.d.ts.map +1 -0
  20. package/dist/notebooklm/artifact-store.js +102 -0
  21. package/dist/notebooklm/artifact-store.js.map +1 -0
  22. package/dist/notebooklm/audio.d.ts.map +1 -1
  23. package/dist/notebooklm/audio.js +13 -37
  24. package/dist/notebooklm/audio.js.map +1 -1
  25. package/dist/notebooklm/chat.d.ts.map +1 -1
  26. package/dist/notebooklm/chat.js +22 -14
  27. package/dist/notebooklm/chat.js.map +1 -1
  28. package/dist/notebooklm/citations.d.ts +17 -22
  29. package/dist/notebooklm/citations.d.ts.map +1 -1
  30. package/dist/notebooklm/citations.js +148 -115
  31. package/dist/notebooklm/citations.js.map +1 -1
  32. package/dist/notebooklm/selectors.d.ts +56 -2
  33. package/dist/notebooklm/selectors.d.ts.map +1 -1
  34. package/dist/notebooklm/selectors.js +120 -2
  35. package/dist/notebooklm/selectors.js.map +1 -1
  36. package/dist/notebooklm/sources.d.ts +16 -1
  37. package/dist/notebooklm/sources.d.ts.map +1 -1
  38. package/dist/notebooklm/sources.js +123 -27
  39. package/dist/notebooklm/sources.js.map +1 -1
  40. package/dist/session/browser-session.d.ts +15 -9
  41. package/dist/session/browser-session.d.ts.map +1 -1
  42. package/dist/session/browser-session.js +123 -154
  43. package/dist/session/browser-session.js.map +1 -1
  44. package/dist/session/session-manager.d.ts +1 -1
  45. package/dist/session/session-manager.d.ts.map +1 -1
  46. package/dist/session/session-manager.js +55 -37
  47. package/dist/session/session-manager.js.map +1 -1
  48. package/dist/tools/definitions/notebook-management.d.ts.map +1 -1
  49. package/dist/tools/definitions/notebook-management.js +43 -0
  50. package/dist/tools/definitions/notebook-management.js.map +1 -1
  51. package/dist/tools/definitions/sources.d.ts +8 -0
  52. package/dist/tools/definitions/sources.d.ts.map +1 -1
  53. package/dist/tools/definitions/sources.js +144 -8
  54. package/dist/tools/definitions/sources.js.map +1 -1
  55. package/dist/tools/handlers.d.ts +94 -13
  56. package/dist/tools/handlers.d.ts.map +1 -1
  57. package/dist/tools/handlers.js +222 -19
  58. package/dist/tools/handlers.js.map +1 -1
  59. package/dist/tools/validation.d.ts.map +1 -1
  60. package/dist/tools/validation.js +108 -1
  61. package/dist/tools/validation.js.map +1 -1
  62. package/dist/transport/http.d.ts +2 -0
  63. package/dist/transport/http.d.ts.map +1 -1
  64. package/dist/transport/http.js +4 -0
  65. package/dist/transport/http.js.map +1 -1
  66. package/dist/types.d.ts +11 -0
  67. package/dist/types.d.ts.map +1 -1
  68. package/dist/utils/live-smoke.d.ts +18 -0
  69. package/dist/utils/live-smoke.d.ts.map +1 -0
  70. package/dist/utils/live-smoke.js +36 -0
  71. package/dist/utils/live-smoke.js.map +1 -0
  72. package/dist/utils/operation.d.ts +8 -0
  73. package/dist/utils/operation.d.ts.map +1 -0
  74. package/dist/utils/operation.js +42 -0
  75. package/dist/utils/operation.js.map +1 -0
  76. package/dist/utils/page-utils.d.ts.map +1 -1
  77. package/dist/utils/page-utils.js +3 -3
  78. package/dist/utils/page-utils.js.map +1 -1
  79. package/docs/configuration.md +184 -182
  80. package/docs/implementation-plan.md +50 -2
  81. package/docs/project-status.md +159 -0
  82. package/docs/tools.md +469 -410
  83. package/docs/troubleshooting.md +176 -176
  84. package/docs/usage-guide.md +285 -285
  85. package/package.json +76 -69
@@ -1,287 +1,287 @@
1
- # Usage Guide
2
-
1
+ # Usage Guide
2
+
3
3
  Practical end-to-end walkthroughs for the current 2.x release. Each section is a self-contained recipe with the exact tool calls / curl commands.
4
-
5
- - [First-time setup](#first-time-setup)
6
- - [Multi-turn session pattern](#multi-turn-session-pattern)
7
- - [Citations workflow](#citations-workflow)
8
- - [Audio Overview generation + download](#audio-overview-generation--download)
9
- - [Multi-account switching](#multi-account-switching)
10
- - [HTTP transport for n8n / Zapier](#http-transport-for-n8n--zapier)
11
-
12
- ---
13
-
14
- ## First-time setup
15
-
16
- ### 1. Install and start
17
-
18
- ```bash
19
- npx notebooklm-mcp@latest
20
- ```
21
-
22
- Wire it into your MCP client of choice (see the [README](../README.md#connect-to-claude-code)).
23
-
24
- ### 2. Authenticate
25
-
26
- Call `setup_auth`. A Chrome window opens. Log in to the Google account that owns the NotebookLM notebooks you want to query. Close the browser when done.
27
-
28
- ```json
29
- { "name": "setup_auth", "arguments": {} }
30
- ```
31
-
32
- Inspect the saved-state backup:
33
-
34
- ```json
35
- { "name": "get_health", "arguments": {} }
36
- ```
37
-
38
- Expect `"auth_state_present": true`. `get_health` deliberately returns
39
- `"authenticated": null` because only a real NotebookLM navigation can verify
40
- whether Google still accepts the session. The next NotebookLM operation performs
41
- that live check and refreshes the saved cookies after the interface loads.
42
-
43
- ### 3. Add a notebook to the local library
44
-
45
- Get a NotebookLM share-URL: open the notebook in `notebook.google.com`, click _Share → Anyone with the link → Copy link_. Legacy `notebooklm.google.com` links are also accepted. Then:
46
-
47
- ```json
48
- {
49
- "name": "add_notebook",
50
- "arguments": {
51
- "url": "https://notebook.google.com/notebook/abcd-efgh",
52
- "name": "n8n Documentation",
53
- "description": "n8n core docs + builtin nodes",
54
- "topics": ["workflow automation", "n8n", "node configuration"],
55
- "use_cases": ["building n8n workflows", "debugging n8n executions"],
56
- "tags": ["docs", "n8n"]
57
- }
58
- }
59
- ```
60
-
61
- ### 4. Ask the first question
62
-
63
- ```json
64
- {
65
- "name": "ask_question",
66
- "arguments": {
67
- "question": "What is the recommended retry pattern for the HTTP Request node?"
68
- }
69
- }
70
- ```
71
-
72
- Capture `session_id` from the response — you will reuse it for follow-ups.
73
-
74
- ---
75
-
76
- ## Multi-turn session pattern
77
-
78
- Reusing `session_id` keeps NotebookLM's conversational context. The browser session also stays open, so each follow-up is faster.
79
-
80
- ```json
81
- // 1. Open broad — captures session_id
82
- { "name": "ask_question", "arguments": {
83
- "question": "Give me an overview of the n8n error handling architecture."
84
- }}
85
- // → response.session_id = "ses_abc123"
86
-
87
- // 2. Drill in
88
- { "name": "ask_question", "arguments": {
89
- "question": "What's the recommended retry/backoff pattern for HTTP nodes?",
90
- "session_id": "ses_abc123"
91
- }}
92
-
93
- // 3. Edge cases
94
- { "name": "ask_question", "arguments": {
95
- "question": "Common pitfalls when retrying webhook-triggered workflows?",
96
- "session_id": "ses_abc123"
97
- }}
98
-
99
- // 4. Production sample
100
- { "name": "ask_question", "arguments": {
101
- "question": "Show me a production example combining retry + circuit-breaker.",
102
- "session_id": "ses_abc123"
103
- }}
104
- ```
105
-
106
- When the task changes, either:
107
-
108
- - Reset the same session: `{ "name": "reset_session", "arguments": { "session_id": "ses_abc123" } }`
109
- - Close it: `{ "name": "close_session", "arguments": { "session_id": "ses_abc123" } }` — and start a new one with no `session_id`.
110
-
111
- Sessions auto-expire after `SESSION_TIMEOUT` seconds of inactivity (default `900` = 15 min).
112
-
113
- ---
114
-
115
- ## Citations workflow
116
-
117
- Set `source_format` on `ask_question`. Four modes:
118
-
119
- ### `none` (default)
120
-
121
- Raw answer. No `sources` field.
122
-
123
- ### `inline`
124
-
125
- ```json
126
- { "name": "ask_question", "arguments": {
127
- "question": "How does refresh-token rotation work?",
128
- "source_format": "inline"
129
- }}
130
- ```
131
-
132
- `[1]` markers in the answer text get replaced with `(source name — short excerpt)` inline.
133
-
134
- ### `footnotes`
135
-
136
- ```json
137
- { "name": "ask_question", "arguments": {
138
- "question": "How does refresh-token rotation work?",
139
- "source_format": "footnotes"
140
- }}
141
- ```
142
-
143
- Response (abridged):
144
-
145
- ```jsonc
146
- {
147
- "answer": "[AI-GENERATED ...] Refresh tokens are rotated on every refresh request [1]. The previous token is revoked server-side [2].\n\nSources:\n[1] auth-spec.pdf — \"Refresh tokens MUST be rotated…\"\n[2] auth-spec.pdf — \"On rotation, the previous token MUST be invalidated…\"",
148
- "sources": [
149
- { "index": 1, "title": "auth-spec.pdf", "excerpt": "Refresh tokens MUST be rotated…" },
150
- { "index": 2, "title": "auth-spec.pdf", "excerpt": "On rotation, the previous token MUST be invalidated…" }
151
- ],
152
- "source_format": "footnotes"
153
- }
154
- ```
155
-
156
- ### `json`
157
-
158
- Answer text is left untouched. Citations are returned only as a structured array on `sources`. Use this when you want to render citations yourself.
159
-
160
- ---
161
-
162
- ## Audio Overview generation + download
163
-
164
- Two-step workflow.
165
-
166
- ### 1. Generate
167
-
168
- ```json
169
- {
170
- "name": "generate_audio",
171
- "arguments": {
172
- "custom_prompt": "Focus on the migration steps and breaking changes",
173
- "timeout_ms": 900000
174
- }
175
- }
176
- ```
177
-
178
- Generation can take several minutes — keep `timeout_ms` generous. The default is 600 000 ms (10 min).
179
-
180
- ### 2. Download
181
-
182
- ```json
183
- {
184
- "name": "download_audio",
185
- "arguments": {
4
+
5
+ - [First-time setup](#first-time-setup)
6
+ - [Multi-turn session pattern](#multi-turn-session-pattern)
7
+ - [Citations workflow](#citations-workflow)
8
+ - [Audio Overview generation + download](#audio-overview-generation--download)
9
+ - [Multi-account switching](#multi-account-switching)
10
+ - [HTTP transport for n8n / Zapier](#http-transport-for-n8n--zapier)
11
+
12
+ ---
13
+
14
+ ## First-time setup
15
+
16
+ ### 1. Install and start
17
+
18
+ ```bash
19
+ npx notebooklm-mcp@latest
20
+ ```
21
+
22
+ Wire it into your MCP client of choice (see the [README](../README.md#connect-to-claude-code)).
23
+
24
+ ### 2. Authenticate
25
+
26
+ Call `setup_auth`. A Chrome window opens. Log in to the Google account that owns the NotebookLM notebooks you want to query. Close the browser when done.
27
+
28
+ ```json
29
+ { "name": "setup_auth", "arguments": {} }
30
+ ```
31
+
32
+ Inspect the saved-state backup:
33
+
34
+ ```json
35
+ { "name": "get_health", "arguments": {} }
36
+ ```
37
+
38
+ Expect `"auth_state_present": true`. `get_health` deliberately returns
39
+ `"authenticated": null` because only a real NotebookLM navigation can verify
40
+ whether Google still accepts the session. The next NotebookLM operation performs
41
+ that live check and refreshes the saved cookies after the interface loads.
42
+
43
+ ### 3. Add a notebook to the local library
44
+
45
+ Get a NotebookLM share-URL: open the notebook in `notebook.google.com`, click _Share → Anyone with the link → Copy link_. Legacy `notebooklm.google.com` links are also accepted. Then:
46
+
47
+ ```json
48
+ {
49
+ "name": "add_notebook",
50
+ "arguments": {
51
+ "url": "https://notebook.google.com/notebook/abcd-efgh",
52
+ "name": "n8n Documentation",
53
+ "description": "n8n core docs + builtin nodes",
54
+ "topics": ["workflow automation", "n8n", "node configuration"],
55
+ "use_cases": ["building n8n workflows", "debugging n8n executions"],
56
+ "tags": ["docs", "n8n"]
57
+ }
58
+ }
59
+ ```
60
+
61
+ ### 4. Ask the first question
62
+
63
+ ```json
64
+ {
65
+ "name": "ask_question",
66
+ "arguments": {
67
+ "question": "What is the recommended retry pattern for the HTTP Request node?"
68
+ }
69
+ }
70
+ ```
71
+
72
+ Capture `session_id` from the response — you will reuse it for follow-ups.
73
+
74
+ ---
75
+
76
+ ## Multi-turn session pattern
77
+
78
+ Reusing `session_id` keeps NotebookLM's conversational context. The browser session also stays open, so each follow-up is faster.
79
+
80
+ ```json
81
+ // 1. Open broad — captures session_id
82
+ { "name": "ask_question", "arguments": {
83
+ "question": "Give me an overview of the n8n error handling architecture."
84
+ }}
85
+ // → response.session_id = "ses_abc123"
86
+
87
+ // 2. Drill in
88
+ { "name": "ask_question", "arguments": {
89
+ "question": "What's the recommended retry/backoff pattern for HTTP nodes?",
90
+ "session_id": "ses_abc123"
91
+ }}
92
+
93
+ // 3. Edge cases
94
+ { "name": "ask_question", "arguments": {
95
+ "question": "Common pitfalls when retrying webhook-triggered workflows?",
96
+ "session_id": "ses_abc123"
97
+ }}
98
+
99
+ // 4. Production sample
100
+ { "name": "ask_question", "arguments": {
101
+ "question": "Show me a production example combining retry + circuit-breaker.",
102
+ "session_id": "ses_abc123"
103
+ }}
104
+ ```
105
+
106
+ When the task changes, either:
107
+
108
+ - Reset the same session: `{ "name": "reset_session", "arguments": { "session_id": "ses_abc123" } }`
109
+ - Close it: `{ "name": "close_session", "arguments": { "session_id": "ses_abc123" } }` — and start a new one with no `session_id`.
110
+
111
+ Sessions auto-expire after `SESSION_TIMEOUT` seconds of inactivity (default `900` = 15 min).
112
+
113
+ ---
114
+
115
+ ## Citations workflow
116
+
117
+ Set `source_format` on `ask_question`. Four modes:
118
+
119
+ ### `none` (default)
120
+
121
+ Raw answer. No `sources` field.
122
+
123
+ ### `inline`
124
+
125
+ ```json
126
+ { "name": "ask_question", "arguments": {
127
+ "question": "How does refresh-token rotation work?",
128
+ "source_format": "inline"
129
+ }}
130
+ ```
131
+
132
+ `[1]` markers in the answer text get replaced with `(source name — short excerpt)` inline.
133
+
134
+ ### `footnotes`
135
+
136
+ ```json
137
+ { "name": "ask_question", "arguments": {
138
+ "question": "How does refresh-token rotation work?",
139
+ "source_format": "footnotes"
140
+ }}
141
+ ```
142
+
143
+ Response (abridged):
144
+
145
+ ```jsonc
146
+ {
147
+ "answer": "[AI-GENERATED ...] Refresh tokens are rotated on every refresh request [1]. The previous token is revoked server-side [2].\n\nSources:\n[1] auth-spec.pdf — \"Refresh tokens MUST be rotated…\"\n[2] auth-spec.pdf — \"On rotation, the previous token MUST be invalidated…\"",
148
+ "sources": [
149
+ { "index": 1, "title": "auth-spec.pdf", "excerpt": "Refresh tokens MUST be rotated…" },
150
+ { "index": 2, "title": "auth-spec.pdf", "excerpt": "On rotation, the previous token MUST be invalidated…" }
151
+ ],
152
+ "source_format": "footnotes"
153
+ }
154
+ ```
155
+
156
+ ### `json`
157
+
158
+ Answer text is left untouched. Citations are returned only as a structured array on `sources`. Use this when you want to render citations yourself.
159
+
160
+ ---
161
+
162
+ ## Audio Overview generation + download
163
+
164
+ Two-step workflow.
165
+
166
+ ### 1. Generate
167
+
168
+ ```json
169
+ {
170
+ "name": "generate_audio",
171
+ "arguments": {
172
+ "custom_prompt": "Focus on the migration steps and breaking changes",
173
+ "timeout_ms": 900000
174
+ }
175
+ }
176
+ ```
177
+
178
+ Generation can take several minutes — keep `timeout_ms` generous. The default is 600 000 ms (10 min).
179
+
180
+ ### 2. Download
181
+
182
+ ```json
183
+ {
184
+ "name": "download_audio",
185
+ "arguments": {
186
186
  "destination_dir": "."
187
- }
188
- }
189
- ```
190
-
191
- Result includes the absolute `file_path` and size in bytes.
192
-
193
- If you call `download_audio` before any Audio Overview has been generated, the call returns an error pointing at `generate_audio`. Run them in order, in the same notebook.
194
-
195
- ---
196
-
197
- ## Multi-account switching
198
-
199
- Run two parallel installations against different Google accounts:
200
-
201
- ```bash
202
- # Terminal A: work account
203
- npx notebooklm-mcp@latest --account work
204
-
205
- # Terminal B: personal account
206
- npx notebooklm-mcp@latest --account personal
207
- ```
208
-
209
- Each account gets its own Chrome profile under `<dataDir>/accounts/<name>/`. The first run for a new account requires its own `setup_auth`. Switching is just a matter of starting the server with a different `--account` flag (or `NOTEBOOKLM_ACCOUNT` env).
210
-
211
- Use cases:
212
-
213
- - Working notebooks on a corporate Google account, side-projects on a personal one.
214
- - Rotating between two free-tier accounts to extend the daily quota.
215
-
216
- There is no shared library between accounts — each account has its own `library.json`. If you want the same library across accounts, copy `library.json` between the two `accounts/<name>/` directories manually.
217
-
218
- ---
219
-
220
- ## HTTP transport for n8n / Zapier
221
-
222
- Start the server in HTTP mode:
223
-
224
- ```bash
225
- npx notebooklm-mcp@latest --transport http --port 3000 --host 0.0.0.0
226
- ```
227
-
228
- The two operations:
229
-
230
- | Method | Path |
231
- |---|---|
232
- | `POST` | `/mcp` |
233
- | `GET` | `/healthz` |
234
-
235
- ### 1. Initialize a session
236
-
237
- ```bash
238
- curl -i -X POST http://localhost:3000/mcp \
239
- -H 'Content-Type: application/json' \
240
- -d '{
241
- "jsonrpc": "2.0",
242
- "id": 1,
243
- "method": "initialize",
244
- "params": {
245
- "protocolVersion": "2025-03-26",
246
- "capabilities": {},
247
- "clientInfo": { "name": "curl", "version": "0.0.1" }
248
- }
249
- }'
250
- ```
251
-
252
- Capture the `Mcp-Session-Id` response header. Pass it as a request header on every subsequent call.
253
-
254
- ### 2. Ask a question
255
-
256
- ```bash
257
- curl -X POST http://localhost:3000/mcp \
258
- -H 'Content-Type: application/json' \
259
- -H 'Mcp-Session-Id: <session-id-from-step-1>' \
260
- -d '{
261
- "jsonrpc": "2.0",
262
- "id": 2,
263
- "method": "tools/call",
264
- "params": {
265
- "name": "ask_question",
266
- "arguments": {
267
- "question": "What is the n8n Code node best for?",
268
- "source_format": "footnotes"
269
- }
270
- }
271
- }'
272
- ```
273
-
274
- The response is the standard MCP `tools/call` envelope. The actual tool output lives under `result.content[0].text` as a JSON string.
275
-
276
- ### Liveness probe
277
-
278
- ```bash
279
- curl http://localhost:3000/healthz
280
- # {"status":"ok","protocol":"mcp-streamable-http"}
281
- ```
282
-
283
- ### Notes
284
-
285
- - The default bind address is `127.0.0.1`. Bind to `0.0.0.0` only on a trusted network.
286
- - Sessions are kept in process memory; restarting the server invalidates all sessions.
287
- - For n8n, Zapier, and similar HTTP-only callers, an "HTTP Request" node configured with a per-execution session-id store is enough — initialize once at workflow start, reuse the session for the rest of the run, and let the `DELETE /mcp` route close it cleanly at the end.
187
+ }
188
+ }
189
+ ```
190
+
191
+ Result includes the absolute `file_path` and size in bytes.
192
+
193
+ If you call `download_audio` before any Audio Overview has been generated, the call returns an error pointing at `generate_audio`. Run them in order, in the same notebook.
194
+
195
+ ---
196
+
197
+ ## Multi-account switching
198
+
199
+ Run two parallel installations against different Google accounts:
200
+
201
+ ```bash
202
+ # Terminal A: work account
203
+ npx notebooklm-mcp@latest --account work
204
+
205
+ # Terminal B: personal account
206
+ npx notebooklm-mcp@latest --account personal
207
+ ```
208
+
209
+ Each account gets its own Chrome profile under `<dataDir>/accounts/<name>/`. The first run for a new account requires its own `setup_auth`. Switching is just a matter of starting the server with a different `--account` flag (or `NOTEBOOKLM_ACCOUNT` env).
210
+
211
+ Use cases:
212
+
213
+ - Working notebooks on a corporate Google account, side-projects on a personal one.
214
+ - Rotating between two free-tier accounts to extend the daily quota.
215
+
216
+ There is no shared library between accounts — each account has its own `library.json`. If you want the same library across accounts, copy `library.json` between the two `accounts/<name>/` directories manually.
217
+
218
+ ---
219
+
220
+ ## HTTP transport for n8n / Zapier
221
+
222
+ Start the server in HTTP mode:
223
+
224
+ ```bash
225
+ npx notebooklm-mcp@latest --transport http --port 3000 --host 0.0.0.0
226
+ ```
227
+
228
+ The two operations:
229
+
230
+ | Method | Path |
231
+ |---|---|
232
+ | `POST` | `/mcp` |
233
+ | `GET` | `/healthz` |
234
+
235
+ ### 1. Initialize a session
236
+
237
+ ```bash
238
+ curl -i -X POST http://localhost:3000/mcp \
239
+ -H 'Content-Type: application/json' \
240
+ -d '{
241
+ "jsonrpc": "2.0",
242
+ "id": 1,
243
+ "method": "initialize",
244
+ "params": {
245
+ "protocolVersion": "2025-03-26",
246
+ "capabilities": {},
247
+ "clientInfo": { "name": "curl", "version": "0.0.1" }
248
+ }
249
+ }'
250
+ ```
251
+
252
+ Capture the `Mcp-Session-Id` response header. Pass it as a request header on every subsequent call.
253
+
254
+ ### 2. Ask a question
255
+
256
+ ```bash
257
+ curl -X POST http://localhost:3000/mcp \
258
+ -H 'Content-Type: application/json' \
259
+ -H 'Mcp-Session-Id: <session-id-from-step-1>' \
260
+ -d '{
261
+ "jsonrpc": "2.0",
262
+ "id": 2,
263
+ "method": "tools/call",
264
+ "params": {
265
+ "name": "ask_question",
266
+ "arguments": {
267
+ "question": "What is the n8n Code node best for?",
268
+ "source_format": "footnotes"
269
+ }
270
+ }
271
+ }'
272
+ ```
273
+
274
+ The response is the standard MCP `tools/call` envelope. The actual tool output lives under `result.content[0].text` as a JSON string.
275
+
276
+ ### Liveness probe
277
+
278
+ ```bash
279
+ curl http://localhost:3000/healthz
280
+ # {"status":"ok","protocol":"mcp-streamable-http"}
281
+ ```
282
+
283
+ ### Notes
284
+
285
+ - The default bind address is `127.0.0.1`. Bind to `0.0.0.0` only on a trusted network.
286
+ - Sessions are kept in process memory; restarting the server invalidates all sessions.
287
+ - For n8n, Zapier, and similar HTTP-only callers, an "HTTP Request" node configured with a per-execution session-id store is enough — initialize once at workflow start, reuse the session for the rest of the run, and let the `DELETE /mcp` route close it cleanly at the end.