mcpbrowser 0.2.30 → 0.2.32
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/.github/workflows/test.yml +2 -2
- package/README.md +14 -8
- package/extension/package.json +1 -1
- package/package.json +1 -43
- package/server.json +2 -2
- package/src/mcp-browser.js +6 -4
- package/test-mcp.js +0 -63
|
@@ -29,5 +29,5 @@ jobs:
|
|
|
29
29
|
- name: Run MCP server tests
|
|
30
30
|
run: npm run test:mcp
|
|
31
31
|
|
|
32
|
-
- name: Run
|
|
33
|
-
run:
|
|
32
|
+
- name: Run unit tests (excluding integration tests)
|
|
33
|
+
run: node --test tests/auth-flow.test.js tests/domain-tab-pooling.test.js tests/mcp-server.test.js tests/prepare-html.test.js tests/redirect-detection.test.js
|
package/README.md
CHANGED
|
@@ -20,7 +20,7 @@ Or search "MCPBrowser" in VS Code Extensions view.
|
|
|
20
20
|
**From GitHub Release:**
|
|
21
21
|
Download from [GitHub Releases](https://github.com/cherchyk/MCPBrowser/releases):
|
|
22
22
|
```bash
|
|
23
|
-
code --install-extension mcpbrowser-0.2.
|
|
23
|
+
code --install-extension mcpbrowser-0.2.32.vsix
|
|
24
24
|
```
|
|
25
25
|
|
|
26
26
|
The extension automatically:
|
|
@@ -31,7 +31,7 @@ The extension automatically:
|
|
|
31
31
|
📦 [View on Marketplace](https://marketplace.visualstudio.com/items?itemName=cherchyk.mcpbrowser)
|
|
32
32
|
|
|
33
33
|
### Option 2: npm Package (Recommended for Manual Setup)
|
|
34
|
-
Published on npm as [mcpbrowser](https://www.npmjs.com/package/mcpbrowser) v0.2.
|
|
34
|
+
Published on npm as [mcpbrowser](https://www.npmjs.com/package/mcpbrowser) v0.2.32.
|
|
35
35
|
|
|
36
36
|
Add to your `mcp.json`:
|
|
37
37
|
```jsonc
|
|
@@ -39,7 +39,7 @@ Add to your `mcp.json`:
|
|
|
39
39
|
"type": "stdio",
|
|
40
40
|
"command": "npx",
|
|
41
41
|
"args": ["-y", "mcpbrowser@latest"],
|
|
42
|
-
"description": "
|
|
42
|
+
"description": "Web page fetching via browser for sites requiring authentication, anti-bot protection, or JavaScript rendering. Use when standard HTTP requests fail for: (1) auth-required pages (401/403, SSO, corporate intranets), (2) anti-bot verification (CAPTCHA, Cloudflare), (3) JavaScript-heavy sites (SPAs, dynamic content). Opens a browser where the user can authenticate, then automatically extracts content."
|
|
43
43
|
}
|
|
44
44
|
```
|
|
45
45
|
|
|
@@ -48,7 +48,7 @@ Add to your `mcp.json`:
|
|
|
48
48
|
- Mac/Linux: `~/.config/Code/User/mcp.json`
|
|
49
49
|
|
|
50
50
|
### Option 3: MCP Registry
|
|
51
|
-
Available in the [MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.cherchyk/browser` v0.2.
|
|
51
|
+
Available in the [MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.cherchyk/browser` v0.2.32.
|
|
52
52
|
|
|
53
53
|
Search for "browser" in the registry to find configuration instructions.
|
|
54
54
|
|
|
@@ -77,7 +77,6 @@ Restart Claude Desktop after configuration.
|
|
|
77
77
|
git clone https://github.com/cherchyk/MCPBrowser.git
|
|
78
78
|
cd MCPBrowser
|
|
79
79
|
npm install
|
|
80
|
-
copy .env.example .env # optional: set Chrome overrides
|
|
81
80
|
```
|
|
82
81
|
|
|
83
82
|
## Prereqs
|
|
@@ -118,7 +117,7 @@ Add this entry to your `mcp.json` file under the `"servers"` section:
|
|
|
118
117
|
"type": "stdio",
|
|
119
118
|
"command": "node",
|
|
120
119
|
"args": ["<PATH_TO_MCPBROWSER>/src/mcp-browser.js"],
|
|
121
|
-
"description": "
|
|
120
|
+
"description": "Web page fetching via browser for sites requiring authentication, anti-bot protection, or JavaScript rendering. Use when standard HTTP requests fail for: (1) auth-required pages (401/403, SSO, corporate intranets), (2) anti-bot verification (CAPTCHA, Cloudflare), (3) JavaScript-heavy sites (SPAs, dynamic content). Opens a browser where the user can authenticate, then automatically extracts content."
|
|
122
121
|
}
|
|
123
122
|
```
|
|
124
123
|
|
|
@@ -149,8 +148,15 @@ In Claude Code or Copilot Chat, you should see the `MCPBrowser` server listed. A
|
|
|
149
148
|
- Optional fields (`authWaitSelector`, `waitForSelector`, `waitForUrlPattern`, etc.) are available but not required.
|
|
150
149
|
|
|
151
150
|
## Configuration
|
|
152
|
-
|
|
153
|
-
-
|
|
151
|
+
Optional environment variables for advanced configuration:
|
|
152
|
+
- `CHROME_PATH`: Custom path to Chrome/Edge executable
|
|
153
|
+
- `CHROME_USER_DATA_DIR`: Custom browser profile directory
|
|
154
|
+
- `CHROME_REMOTE_DEBUG_HOST`: DevTools host (default: `127.0.0.1`)
|
|
155
|
+
- `CHROME_REMOTE_DEBUG_PORT`: DevTools port (default: `9222`)
|
|
156
|
+
- `CHROME_WS_ENDPOINT`: Explicit WebSocket endpoint URL
|
|
157
|
+
- `DEFAULT_FETCH_URL` or `MCP_DEFAULT_FETCH_URL`: Default URL when called without params
|
|
158
|
+
|
|
159
|
+
Set these in your shell or system environment before running the MCP server.
|
|
154
160
|
|
|
155
161
|
## Tips
|
|
156
162
|
- **Universal auth**: Works with ANY authenticated site - corporate intranets, SSO, OAuth, SAML, login pages, CAPTCHA, human verification, etc.
|
package/extension/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "mcpbrowser",
|
|
3
3
|
"displayName": "MCP Browser",
|
|
4
4
|
"description": "Lightweight MCP server-extension for in-browser web page fetching - handles login, SSO, and anti-crawler restrictions. Should be used when standard fetch_webpage fails",
|
|
5
|
-
"version": "0.2.
|
|
5
|
+
"version": "0.2.32",
|
|
6
6
|
"publisher": "cherchyk",
|
|
7
7
|
"icon": "icon.png",
|
|
8
8
|
"engines": {
|
package/package.json
CHANGED
|
@@ -1,43 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": "0.2.30",
|
|
3
|
-
"mcpName": "io.github.cherchyk/browser",
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "MCP server for in-browser web page fetching using Chrome DevTools Protocol",
|
|
6
|
-
"main": "src/mcp-browser.js",
|
|
7
|
-
"bin": {
|
|
8
|
-
"mcpbrowser": "src/mcp-browser.js"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"mcp": "node src/mcp-browser.js",
|
|
12
|
-
"test": "node --test tests/*.test.js",
|
|
13
|
-
"test:mcp": "node --test tests/mcp-server.test.js"
|
|
14
|
-
},
|
|
15
|
-
"keywords": [
|
|
16
|
-
"mcp",
|
|
17
|
-
"mcp-server",
|
|
18
|
-
"model-context-protocol",
|
|
19
|
-
"chrome",
|
|
20
|
-
"puppeteer",
|
|
21
|
-
"authentication",
|
|
22
|
-
"web-scraping",
|
|
23
|
-
"github-copilot"
|
|
24
|
-
],
|
|
25
|
-
"author": "cherchyk",
|
|
26
|
-
"license": "MIT",
|
|
27
|
-
"repository": {
|
|
28
|
-
"type": "git",
|
|
29
|
-
"url": "git+https://github.com/cherchyk/MCPBrowser.git"
|
|
30
|
-
},
|
|
31
|
-
"bugs": {
|
|
32
|
-
"url": "https://github.com/cherchyk/MCPBrowser/issues"
|
|
33
|
-
},
|
|
34
|
-
"homepage": "https://github.com/cherchyk/MCPBrowser#readme",
|
|
35
|
-
"dependencies": {
|
|
36
|
-
"@modelcontextprotocol/sdk": "^1.25.1",
|
|
37
|
-
"dotenv": "^16.4.5",
|
|
38
|
-
"puppeteer-core": "^23.4.1"
|
|
39
|
-
},
|
|
40
|
-
"engines": {
|
|
41
|
-
"node": ">=18.0.0"
|
|
42
|
-
}
|
|
43
|
-
}
|
|
1
|
+
{"name":"mcpbrowser","version":"0.2.32","mcpName":"io.github.cherchyk/browser","type":"module","description":"MCP server for in-browser web page fetching using Chrome DevTools Protocol","main":"src/mcp-browser.js","bin":{"mcpbrowser":"src/mcp-browser.js"},"scripts":{"mcp":"node src/mcp-browser.js","test":"node --test tests/*.test.js","test:mcp":"node --test tests/mcp-server.test.js"},"keywords":["mcp","mcp-server","model-context-protocol","chrome","puppeteer","authentication","web-scraping","github-copilot"],"author":"cherchyk","license":"MIT","repository":{"type":"git","url":"git+https://github.com/cherchyk/MCPBrowser.git"},"bugs":{"url":"https://github.com/cherchyk/MCPBrowser/issues"},"homepage":"https://github.com/cherchyk/MCPBrowser#readme","dependencies":{"@modelcontextprotocol/sdk":"^1.25.1","puppeteer-core":"^23.4.1"},"engines":{"node":">=18.0.0"}}
|
package/server.json
CHANGED
|
@@ -6,12 +6,12 @@
|
|
|
6
6
|
"url": "https://github.com/cherchyk/MCPBrowser",
|
|
7
7
|
"source": "github"
|
|
8
8
|
},
|
|
9
|
-
"version": "0.2.
|
|
9
|
+
"version": "0.2.32",
|
|
10
10
|
"packages": [
|
|
11
11
|
{
|
|
12
12
|
"registryType": "npm",
|
|
13
13
|
"identifier": "mcpbrowser",
|
|
14
|
-
"version": "0.2.
|
|
14
|
+
"version": "0.2.32",
|
|
15
15
|
"transport": {
|
|
16
16
|
"type": "stdio"
|
|
17
17
|
}
|
package/src/mcp-browser.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import dotenv from "dotenv";
|
|
3
2
|
import puppeteer from "puppeteer-core";
|
|
4
3
|
import { existsSync } from "fs";
|
|
5
4
|
import os from "os";
|
|
@@ -9,8 +8,6 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
|
|
|
9
8
|
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
10
9
|
import { ListToolsRequestSchema, CallToolRequestSchema } from "@modelcontextprotocol/sdk/types.js";
|
|
11
10
|
|
|
12
|
-
dotenv.config();
|
|
13
|
-
|
|
14
11
|
const chromeHost = process.env.CHROME_REMOTE_DEBUG_HOST || "127.0.0.1";
|
|
15
12
|
const chromePort = Number(process.env.CHROME_REMOTE_DEBUG_PORT || 9222);
|
|
16
13
|
const explicitWSEndpoint = process.env.CHROME_WS_ENDPOINT;
|
|
@@ -49,6 +46,7 @@ function getDefaultChromePaths() {
|
|
|
49
46
|
"C:/Program Files/Google/Chrome/Application/chrome.exe",
|
|
50
47
|
"C:/Program Files (x86)/Google/Chrome/Application/chrome.exe",
|
|
51
48
|
"C:/Program Files/Microsoft/Edge/Application/msedge.exe",
|
|
49
|
+
"C:/Program Files (x86)/Microsoft/Edge/Application/msedge.exe",
|
|
52
50
|
];
|
|
53
51
|
} else if (platform === "darwin") {
|
|
54
52
|
return [
|
|
@@ -61,6 +59,8 @@ function getDefaultChromePaths() {
|
|
|
61
59
|
"/usr/bin/google-chrome",
|
|
62
60
|
"/usr/bin/chromium-browser",
|
|
63
61
|
"/usr/bin/chromium",
|
|
62
|
+
"/usr/bin/microsoft-edge",
|
|
63
|
+
"/opt/microsoft/msedge/msedge",
|
|
64
64
|
];
|
|
65
65
|
}
|
|
66
66
|
}
|
|
@@ -884,7 +884,9 @@ export {
|
|
|
884
884
|
};
|
|
885
885
|
|
|
886
886
|
// Run the MCP server only if this is the main module (not imported for testing)
|
|
887
|
-
|
|
887
|
+
import { fileURLToPath } from 'url';
|
|
888
|
+
if (import.meta.url === new URL(process.argv[1], 'file://').href ||
|
|
889
|
+
fileURLToPath(import.meta.url) === process.argv[1]) {
|
|
888
890
|
main().catch((err) => {
|
|
889
891
|
console.error(err);
|
|
890
892
|
process.exit(1);
|
package/test-mcp.js
DELETED
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
import { spawn } from 'child_process';
|
|
3
|
-
|
|
4
|
-
const mcpProcess = spawn('node', ['src/mcp-browser.js'], {
|
|
5
|
-
cwd: process.cwd(),
|
|
6
|
-
stdio: ['pipe', 'pipe', 'inherit']
|
|
7
|
-
});
|
|
8
|
-
|
|
9
|
-
// Send initialize request
|
|
10
|
-
const initRequest = {
|
|
11
|
-
jsonrpc: '2.0',
|
|
12
|
-
id: 1,
|
|
13
|
-
method: 'initialize',
|
|
14
|
-
params: {
|
|
15
|
-
protocolVersion: '2024-11-05',
|
|
16
|
-
capabilities: {},
|
|
17
|
-
clientInfo: { name: 'test', version: '1.0' }
|
|
18
|
-
}
|
|
19
|
-
};
|
|
20
|
-
|
|
21
|
-
console.log('Sending initialize request...');
|
|
22
|
-
mcpProcess.stdin.write(JSON.stringify(initRequest) + '\n');
|
|
23
|
-
|
|
24
|
-
// Send list tools request
|
|
25
|
-
const listToolsRequest = {
|
|
26
|
-
jsonrpc: '2.0',
|
|
27
|
-
id: 2,
|
|
28
|
-
method: 'tools/list',
|
|
29
|
-
params: {}
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
setTimeout(() => {
|
|
33
|
-
console.log('Sending tools/list request...');
|
|
34
|
-
mcpProcess.stdin.write(JSON.stringify(listToolsRequest) + '\n');
|
|
35
|
-
}, 1000);
|
|
36
|
-
|
|
37
|
-
let responseBuffer = '';
|
|
38
|
-
mcpProcess.stdout.on('data', (data) => {
|
|
39
|
-
responseBuffer += data.toString();
|
|
40
|
-
const lines = responseBuffer.split('\n');
|
|
41
|
-
responseBuffer = lines.pop() || '';
|
|
42
|
-
|
|
43
|
-
lines.forEach(line => {
|
|
44
|
-
if (line.trim()) {
|
|
45
|
-
try {
|
|
46
|
-
const response = JSON.parse(line);
|
|
47
|
-
console.log('Response:', JSON.stringify(response, null, 2));
|
|
48
|
-
} catch (e) {
|
|
49
|
-
console.log('Raw output:', line);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
});
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
mcpProcess.on('error', (err) => {
|
|
56
|
-
console.error('Error:', err);
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
setTimeout(() => {
|
|
60
|
-
console.log('Closing...');
|
|
61
|
-
mcpProcess.kill();
|
|
62
|
-
process.exit(0);
|
|
63
|
-
}, 3000);
|