@imenam/simple-scraper 1.0.4 → 1.0.7
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 +11 -4
- package/dist/logger.js +2 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -35,8 +35,9 @@ simple-scraper
|
|
|
35
35
|
|----------|----------|---------|-------------|
|
|
36
36
|
| `PUPPETEER_HEADLESS` | No | `true` | Run Chromium in headless mode. Set to `false` to display the browser window. |
|
|
37
37
|
| `PUPPETEER_TIMEOUT` | No | `30000` | Default timeout in milliseconds for page navigation and waits. |
|
|
38
|
-
| `COOKIES_DIR` | No |
|
|
39
|
-
| `
|
|
38
|
+
| `COOKIES_DIR` | No | - | Absolute path to a folder containing Netscape-format `.txt` cookie files. All files are loaded and merged automatically before each request. |
|
|
39
|
+
| `MCP_LOG_DIR` | No | `.mcp-gui/logs` | Absolute path to the directory where log files are written. |
|
|
40
|
+
| `PROXY_URL` | No | - | Base URL of the [MCP HTTP Gateway](https://www.npmjs.com/package/@imenam/mcp-http-gateway). Required to enable the GUI. |
|
|
40
41
|
| `PROXY_APP_PATH` | No | `/simple-scraper-mcp` | URL path under which the GUI is registered on the proxy. |
|
|
41
42
|
| `PROXY_APP_NAME` | No | `Simple Scraper MCP` | Display name shown in the proxy's app list. |
|
|
42
43
|
|
|
@@ -61,7 +62,7 @@ PUPPETEER_TIMEOUT=30000
|
|
|
61
62
|
|
|
62
63
|
## Usage with Claude Desktop
|
|
63
64
|
|
|
64
|
-
Add the following to your `claude_desktop_config.json
|
|
65
|
+
Add the following to your `claude_desktop_config.json`. Full example with all available options:
|
|
65
66
|
|
|
66
67
|
```json
|
|
67
68
|
{
|
|
@@ -71,7 +72,12 @@ Add the following to your `claude_desktop_config.json`:
|
|
|
71
72
|
"args": ["@imenam/simple-scraper"],
|
|
72
73
|
"env": {
|
|
73
74
|
"PUPPETEER_HEADLESS": "true",
|
|
74
|
-
"PUPPETEER_TIMEOUT": "30000"
|
|
75
|
+
"PUPPETEER_TIMEOUT": "30000",
|
|
76
|
+
"COOKIES_DIR": "/path/to/your/cookies",
|
|
77
|
+
"MCP_LOG_DIR": "/path/to/your/logs",
|
|
78
|
+
"PROXY_URL": "http://localhost:4500",
|
|
79
|
+
"PROXY_APP_PATH": "/simple-scraper",
|
|
80
|
+
"PROXY_APP_NAME": "Simple Scraper"
|
|
75
81
|
}
|
|
76
82
|
}
|
|
77
83
|
}
|
|
@@ -109,6 +115,7 @@ In Cursor, MCP servers are configured in `.cursor/mcp.json`. You can pass enviro
|
|
|
109
115
|
"PUPPETEER_HEADLESS": "true",
|
|
110
116
|
"PUPPETEER_TIMEOUT": "30000",
|
|
111
117
|
"COOKIES_DIR": "/path/to/your/cookies",
|
|
118
|
+
"MCP_LOG_DIR": "/path/to/your/logs",
|
|
112
119
|
"PROXY_URL": "http://localhost:4500",
|
|
113
120
|
"PROXY_APP_PATH": "/simple-scraper",
|
|
114
121
|
"PROXY_APP_NAME": "Simple Scraper"
|
package/dist/logger.js
CHANGED
|
@@ -2,9 +2,10 @@ import fs from "fs";
|
|
|
2
2
|
import path from "path";
|
|
3
3
|
let currentPrefix = "";
|
|
4
4
|
export function logToFile(message, prefix = "") {
|
|
5
|
-
const
|
|
5
|
+
const defaultLogDir = process.platform === 'win32'
|
|
6
6
|
? 'C:\\var\\log\\simple-scraper-mcp'
|
|
7
7
|
: '/var/log/simple-scraper-mcp';
|
|
8
|
+
const logDir = process.env.MCP_LOG_DIR ?? defaultLogDir;
|
|
8
9
|
const logFile = path.join(logDir, 'server.log');
|
|
9
10
|
const now = new Date().toLocaleString('fr-FR', {
|
|
10
11
|
year: 'numeric',
|