note-mcp 1.1.1 → 1.1.2

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 (3) hide show
  1. package/README.md +69 -11
  2. package/dist/index.js +13 -9
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -5,16 +5,62 @@ Unofficial stdio MCP server for note.com. It uses cookie-based access to note.co
5
5
  > [!WARNING]
6
6
  > This project is unofficial and not affiliated with note.com. Internal APIs can change without notice. Keep cookies local and never commit them to GitHub, npm, logs, or issue reports.
7
7
 
8
- ## Install / run
8
+ ## Quick start
9
+
10
+ ### Local/desktop agents
11
+
12
+ Use browser login first:
9
13
 
10
14
  ```bash
11
- npx note-mcp
15
+ npx note-mcp auth
16
+ ```
17
+
18
+ After you log in to note.com in the opened browser, `note-mcp` saves the cookie locally and prints the saved file path:
19
+
20
+ ```json
21
+ {
22
+ "authenticated": true,
23
+ "saved": true,
24
+ "configPath": "/Users/you/.config/note-mcp/config.json",
25
+ "cookiePreview": "fp=b…5948",
26
+ "message": "note.com authentication configured from browser login. Cookie saved to /Users/you/.config/note-mcp/config.json."
27
+ }
28
+ ```
29
+
30
+ Then configure your MCP client without putting cookies in the config:
31
+
32
+ ```json
33
+ {
34
+ "mcpServers": {
35
+ "note": {
36
+ "command": "npx",
37
+ "args": ["-y", "note-mcp"]
38
+ }
39
+ }
40
+ }
12
41
  ```
13
42
 
14
- For advanced/server setups, you can still provide a Cookie header through the environment:
43
+ ### Servers, containers, and CI
44
+
45
+ Do not rely on browser login in headless/container environments. Provide a cookie through env or a mounted config file instead:
46
+
47
+ ```bash
48
+ NOTE_COOKIE='your note.com Cookie header' npx note-mcp
49
+ ```
50
+
51
+ Or mount a config file and point `NOTE_MCP_CONFIG` at it:
15
52
 
16
53
  ```bash
17
- NOTE_COOKIE='your note.com cookie string' npx note-mcp
54
+ docker run \
55
+ -v ~/.config/note-mcp/config.json:/run/secrets/note-mcp-config.json:ro \
56
+ -e NOTE_MCP_CONFIG=/run/secrets/note-mcp-config.json \
57
+ your-agent-image
58
+ ```
59
+
60
+ ## Install / run
61
+
62
+ ```bash
63
+ npx note-mcp
18
64
  ```
19
65
 
20
66
  For local development:
@@ -27,7 +73,7 @@ node dist/index.js
27
73
 
28
74
  ## MCP client configuration
29
75
 
30
- Desktop/local browser-login friendly setup:
76
+ Recommended desktop setup after `npx note-mcp auth`:
31
77
 
32
78
  ```json
33
79
  {
@@ -49,7 +95,7 @@ Advanced env-based setup:
49
95
  "command": "npx",
50
96
  "args": ["-y", "note-mcp"],
51
97
  "env": {
52
- "NOTE_COOKIE": "your note.com cookie string"
98
+ "NOTE_COOKIE": "your note.com Cookie header"
53
99
  }
54
100
  }
55
101
  }
@@ -78,6 +124,8 @@ This opens a browser, lets you log in to note.com normally, then stores note.com
78
124
  ~/.config/note-mcp/config.json
79
125
  ```
80
126
 
127
+ The CLI and MCP tool response include the actual `configPath` used.
128
+
81
129
  If the browser executable is not installed yet, install Playwright's Chromium once on the same machine/user account, then retry:
82
130
 
83
131
  ```bash
@@ -92,8 +140,6 @@ npx -p playwright playwright install chromium
92
140
 
93
141
  For remote servers, containers, or CI, prefer the secret/env/config-file path below instead of browser login.
94
142
 
95
- The config file is written with `0600` permissions where supported.
96
-
97
143
  Useful CLI commands:
98
144
 
99
145
  ```bash
@@ -105,7 +151,7 @@ npx note-mcp auth --headed
105
151
 
106
152
  ### 2. Advanced/server/CI: secret, env, or config file
107
153
 
108
- For remote agents, servers, CI, and secret managers, provide a Cookie header via:
154
+ For remote agents, servers, containers, CI, and secret managers, provide a Cookie header via:
109
155
 
110
156
  - `NOTE_COOKIE`
111
157
  - `NOTE_SESSION_COOKIE`
@@ -127,12 +173,24 @@ Cookie lookup priority:
127
173
  2. `NOTE_SESSION_COOKIE`
128
174
  3. config file cookie
129
175
 
176
+ Default config path:
177
+
178
+ ```text
179
+ ~/.config/note-mcp/config.json
180
+ ```
181
+
182
+ Override config path:
183
+
184
+ ```bash
185
+ NOTE_MCP_CONFIG=/path/to/config.json npx note-mcp
186
+ ```
187
+
130
188
  ## Tools
131
189
 
132
190
  Authentication/setup tools:
133
191
 
134
- - `note_auth_status` — inspect whether auth is configured
135
- - `note_auth_login` — open a browser login flow and save cookies locally
192
+ - `note_auth_status` — inspect whether auth is configured and which config path is used
193
+ - `note_auth_login` — open a browser login flow and save cookies locally; response includes `configPath`
136
194
  - `note_set_cookie` — save a Cookie header to the local config file, optionally verifying it first
137
195
  - `note_clear_cookie` — delete the stored config-file cookie
138
196
  - `note_login_help` — explain supported setup paths
package/dist/index.js CHANGED
@@ -222,15 +222,9 @@ async function runBrowserLogin(options = {}) {
222
222
  const client = new NoteClient({ cookie });
223
223
  try {
224
224
  await client.authCheck();
225
- if (options.save ?? true) {
226
- await saveCookie(cookie);
227
- }
228
- return {
229
- authenticated: true,
230
- saved: options.save ?? true,
231
- cookiePreview: previewCookie2(cookie),
232
- message: "note.com authentication configured from browser login."
233
- };
225
+ const shouldSave = options.save ?? true;
226
+ const saveStatus = shouldSave ? await saveCookie(cookie) : void 0;
227
+ return buildBrowserLoginResult(cookie, shouldSave, saveStatus);
234
228
  } catch {
235
229
  }
236
230
  }
@@ -250,6 +244,16 @@ async function importPlaywright() {
250
244
  );
251
245
  }
252
246
  }
247
+ function buildBrowserLoginResult(cookie, saved, saveStatus) {
248
+ const configPath = saveStatus?.configPath;
249
+ return {
250
+ authenticated: true,
251
+ saved,
252
+ ...configPath ? { configPath } : {},
253
+ cookiePreview: saveStatus?.cookiePreview ?? previewCookie2(cookie),
254
+ message: configPath ? `note.com authentication configured from browser login. Cookie saved to ${configPath}.` : "note.com authentication configured from browser login."
255
+ };
256
+ }
253
257
  function toBrowserLoginError(error) {
254
258
  const message = error instanceof Error ? error.message : String(error);
255
259
  if (message.includes("Executable doesn't exist") || message.includes("Please run the following command to download new browsers") || message.includes("playwright install")) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "note-mcp",
3
- "version": "1.1.1",
3
+ "version": "1.1.2",
4
4
  "description": "Unofficial stdio MCP server for note.com using cookie-based internal APIs.",
5
5
  "type": "module",
6
6
  "bin": {