note-mcp 1.1.0 → 1.1.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.
- package/README.md +14 -0
- package/dist/index.js +22 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,6 +78,20 @@ This opens a browser, lets you log in to note.com normally, then stores note.com
|
|
|
78
78
|
~/.config/note-mcp/config.json
|
|
79
79
|
```
|
|
80
80
|
|
|
81
|
+
If the browser executable is not installed yet, install Playwright's Chromium once on the same machine/user account, then retry:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npx playwright install chromium
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
When using `note-mcp` only through `npx` and Playwright is not otherwise installed globally/in the project, this form is often more reliable:
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
npx -p playwright playwright install chromium
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
For remote servers, containers, or CI, prefer the secret/env/config-file path below instead of browser login.
|
|
94
|
+
|
|
81
95
|
The config file is written with `0600` permissions where supported.
|
|
82
96
|
|
|
83
97
|
Useful CLI commands:
|
package/dist/index.js
CHANGED
|
@@ -203,7 +203,12 @@ async function runBrowserLogin(options = {}) {
|
|
|
203
203
|
const timeoutMs = options.timeoutMs ?? 18e4;
|
|
204
204
|
const headless = options.headless ?? process.env.NOTE_MCP_HEADLESS === "true";
|
|
205
205
|
const { chromium } = await importPlaywright();
|
|
206
|
-
|
|
206
|
+
let browser;
|
|
207
|
+
try {
|
|
208
|
+
browser = await chromium.launch({ headless });
|
|
209
|
+
} catch (error) {
|
|
210
|
+
throw toBrowserLoginError(error);
|
|
211
|
+
}
|
|
207
212
|
try {
|
|
208
213
|
const context = await browser.newContext();
|
|
209
214
|
const page = await context.newPage();
|
|
@@ -245,6 +250,22 @@ async function importPlaywright() {
|
|
|
245
250
|
);
|
|
246
251
|
}
|
|
247
252
|
}
|
|
253
|
+
function toBrowserLoginError(error) {
|
|
254
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
255
|
+
if (message.includes("Executable doesn't exist") || message.includes("Please run the following command to download new browsers") || message.includes("playwright install")) {
|
|
256
|
+
return new Error(
|
|
257
|
+
[
|
|
258
|
+
"Playwright browser is not installed, so note-mcp cannot open the note.com browser login flow.",
|
|
259
|
+
"Run this once on the same machine/user account, then retry:",
|
|
260
|
+
" npx playwright install chromium",
|
|
261
|
+
"If you are running note-mcp through npx and Playwright is not otherwise installed, use:",
|
|
262
|
+
" npx -p playwright playwright install chromium",
|
|
263
|
+
"For remote servers, containers, or CI, prefer NOTE_COOKIE / NOTE_SESSION_COOKIE or NOTE_MCP_CONFIG instead of browser login."
|
|
264
|
+
].join("\n")
|
|
265
|
+
);
|
|
266
|
+
}
|
|
267
|
+
return error instanceof Error ? error : new Error(message);
|
|
268
|
+
}
|
|
248
269
|
function isNoteDomain(domain) {
|
|
249
270
|
const normalized = domain.replace(/^\./, "").toLowerCase();
|
|
250
271
|
return normalized === "note.com" || normalized.endsWith(".note.com");
|