@ejazullah/browser-mcp 0.0.56 → 0.0.58
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 +2 -0
- package/cli.js +1 -18
- package/index.js +1 -1060
- package/lib/mcp/transport.js +10 -4
- package/package.json +5 -2
package/lib/mcp/transport.js
CHANGED
|
@@ -133,11 +133,17 @@ async function handleStreamable(serverBackendFactory, req, res, sessions) {
|
|
|
133
133
|
if (sessionId) {
|
|
134
134
|
const transport = sessions.get(sessionId);
|
|
135
135
|
if (!transport) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
if (req.method !== 'POST') {
|
|
137
|
+
res.statusCode = 404;
|
|
138
|
+
res.end('Session not found');
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
delete req.headers['mcp-session-id'];
|
|
142
|
+
testDebug(`stale http session id: ${sessionId}, creating a new session`);
|
|
143
|
+
}
|
|
144
|
+
else {
|
|
145
|
+
return await transport.handleRequest(req, res);
|
|
139
146
|
}
|
|
140
|
-
return await transport.handleRequest(req, res);
|
|
141
147
|
}
|
|
142
148
|
if (req.method === 'POST') {
|
|
143
149
|
const transport = new StreamableHTTPServerTransport({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ejazullah/browser-mcp",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
4
4
|
"description": "@ejazullah/browser-mcp - Enhanced Playwright Tools for MCP with CDP Support",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -18,7 +18,9 @@
|
|
|
18
18
|
},
|
|
19
19
|
"license": "Apache-2.0",
|
|
20
20
|
"scripts": {
|
|
21
|
-
"build": "
|
|
21
|
+
"build": "npm run build:plain",
|
|
22
|
+
"build:plain": "tsc",
|
|
23
|
+
"obfuscate": "node utils/obfuscate-build.js",
|
|
22
24
|
"start": "node cli.js --port 8931 --host 0.0.0.0",
|
|
23
25
|
"dev": "node cli.js --port 8931",
|
|
24
26
|
"deploy": "npm run build && npx vercel --prod",
|
|
@@ -83,6 +85,7 @@
|
|
|
83
85
|
"eslint": "^9.19.0",
|
|
84
86
|
"eslint-plugin-import": "^2.31.0",
|
|
85
87
|
"eslint-plugin-notice": "^1.0.0",
|
|
88
|
+
"javascript-obfuscator": "^5.3.0",
|
|
86
89
|
"openai": "^5.10.2",
|
|
87
90
|
"typescript": "^5.8.2"
|
|
88
91
|
},
|