@imenam/simple-scraper 1.0.22 → 1.0.23
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 +4 -0
- package/dist/gui.js +3 -2
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -389,6 +389,10 @@ Cookies are loaded from `.txt` files in [Netscape format](http://www.cookiecentr
|
|
|
389
389
|
|
|
390
390
|
When `PROXY_URL` is set, a cookie manager web interface is registered with the MCP proxy. It allows you to list, upload, and delete cookie files through a browser UI.
|
|
391
391
|
|
|
392
|
+
### Network exposure
|
|
393
|
+
|
|
394
|
+
The GUI listens on `127.0.0.1` only: other machines reach it through the proxy or the gateway manager. A request guard from [`@imenam/mcp-gui-interface`](https://www.npmjs.com/package/@imenam/mcp-gui-interface) answers `403` to any request whose `Host` header is not `localhost`, `127.0.0.1` or `::1` (DNS rebinding protection), and to modifying requests (`POST`, `DELETE`…) sent from another site (foreign `Sec-Fetch-Site` or `Origin`).
|
|
395
|
+
|
|
392
396
|
## License
|
|
393
397
|
|
|
394
398
|
ISC
|
package/dist/gui.js
CHANGED
|
@@ -3,7 +3,7 @@ import bodyParser from 'body-parser';
|
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import fs from 'fs';
|
|
5
5
|
import { fileURLToPath } from 'url';
|
|
6
|
-
import { setupLogging, ProxyClient, IpcHub } from '@imenam/mcp-gui-interface';
|
|
6
|
+
import { setupLogging, ProxyClient, IpcHub, GUI_LISTEN_HOST, expressGuiGuard } from '@imenam/mcp-gui-interface';
|
|
7
7
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
8
8
|
const ipc = new IpcHub(process);
|
|
9
9
|
async function callMaster(type, data, timeoutMs = 5000) {
|
|
@@ -70,6 +70,7 @@ const getCookiesDir = () => {
|
|
|
70
70
|
return cookiesDir;
|
|
71
71
|
};
|
|
72
72
|
const app = express();
|
|
73
|
+
app.use(expressGuiGuard());
|
|
73
74
|
app.use(bodyParser.json());
|
|
74
75
|
app.use(express.static(path.join(rootDir, 'public/dist')));
|
|
75
76
|
app.get(/^(?!\/api\/|\/proxy\/)/, (_req, res) => {
|
|
@@ -223,7 +224,7 @@ async function startServer() {
|
|
|
223
224
|
}
|
|
224
225
|
}, 500);
|
|
225
226
|
});
|
|
226
|
-
const serverListener = app.listen(port, () => {
|
|
227
|
+
const serverListener = app.listen(port, GUI_LISTEN_HOST, () => {
|
|
227
228
|
console.error(`[GUI] Server running at http://localhost:${port}`);
|
|
228
229
|
});
|
|
229
230
|
serverListener.on('error', (err) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imenam/simple-scraper",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.23",
|
|
4
4
|
"description": "MCP server for web scraping and JavaScript execution using Puppeteer",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"node": ">=18.0.0"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@imenam/mcp-gui-interface": "^1.0.
|
|
38
|
+
"@imenam/mcp-gui-interface": "^1.0.14",
|
|
39
39
|
"@modelcontextprotocol/sdk": "^1.28.0",
|
|
40
40
|
"body-parser": "^2.2.2",
|
|
41
41
|
"dotenv": "^17.3.1",
|