mcpbrowser 0.2.10 → 0.2.12

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 CHANGED
@@ -19,7 +19,7 @@ Or search "MCPBrowser" in VS Code Extensions view.
19
19
  **From GitHub Release:**
20
20
  Download from [GitHub Releases](https://github.com/cherchyk/MCPBrowser/releases):
21
21
  ```bash
22
- code --install-extension mcpbrowser-0.1.4.vsix
22
+ code --install-extension mcpbrowser-0.2.12.vsix
23
23
  ```
24
24
 
25
25
  The extension automatically:
@@ -30,7 +30,7 @@ The extension automatically:
30
30
  📦 [View on Marketplace](https://marketplace.visualstudio.com/items?itemName=cherchyk.mcpbrowser)
31
31
 
32
32
  ### Option 2: npm Package (Recommended for Manual Setup)
33
- Published on npm as [mcpbrowser](https://www.npmjs.com/package/mcpbrowser) v0.2.3.
33
+ Published on npm as [mcpbrowser](https://www.npmjs.com/package/mcpbrowser) v0.2.12.
34
34
 
35
35
  Add to your `mcp.json`:
36
36
  ```jsonc
@@ -47,7 +47,7 @@ Add to your `mcp.json`:
47
47
  - Mac/Linux: `~/.config/Code/User/mcp.json`
48
48
 
49
49
  ### Option 3: MCP Registry
50
- Available in the [MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.cherchyk/browser` v0.2.3.
50
+ Available in the [MCP Registry](https://registry.modelcontextprotocol.io/) as `io.github.cherchyk/browser` v0.2.12.
51
51
 
52
52
  Search for "browser" in the registry to find configuration instructions.
53
53
 
@@ -2,7 +2,7 @@
2
2
  "name": "mcpbrowser",
3
3
  "displayName": "MCP Browser",
4
4
  "description": "Extends Copilot's web access to protected pages - handles login, SSO, and anti-crawler restrictions",
5
- "version": "0.2.9",
5
+ "version": "0.2.12",
6
6
  "publisher": "cherchyk",
7
7
  "icon": "icon.png",
8
8
  "engines": {
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  { "name": "mcpbrowser",
2
- "version": "0.2.10",
2
+ "version": "0.2.12",
3
3
  "mcpName": "io.github.cherchyk/browser",
4
4
  "type": "module",
5
5
  "description": "MCP server that loads authenticated web pages using Chrome DevTools Protocol",
@@ -20,12 +20,13 @@ function getDefaultUserDataDir() {
20
20
  const platform = os.platform();
21
21
  const home = os.homedir();
22
22
 
23
+ // Use a dedicated debugging profile directory
23
24
  if (platform === "win32") {
24
- return path.join(home, "AppData/Local/Google/Chrome/User Data");
25
+ return path.join(home, "AppData/Local/MCPBrowser/ChromeDebug");
25
26
  } else if (platform === "darwin") {
26
- return path.join(home, "Library/Application Support/Google/Chrome");
27
+ return path.join(home, "Library/Application Support/MCPBrowser/ChromeDebug");
27
28
  } else {
28
- return path.join(home, ".config/google-chrome");
29
+ return path.join(home, ".config/MCPBrowser/ChromeDebug");
29
30
  }
30
31
  }
31
32
 
@@ -104,7 +105,10 @@ async function launchChromeIfNeeded() {
104
105
  const args = [
105
106
  `--remote-debugging-port=${chromePort}`,
106
107
  `--user-data-dir=${userDataDir}`,
107
- 'about:blank' // Open with a blank page
108
+ '--no-first-run', // Skip first run experience
109
+ '--no-default-browser-check', // Skip default browser check
110
+ '--disable-sync', // Disable Chrome sync prompts
111
+ 'about:blank' // Open with a blank page
108
112
  ];
109
113
  const child = spawn(chromePath, args, { detached: true, stdio: "ignore" });
110
114
  child.unref();
@@ -197,36 +201,37 @@ async function fetchPage({
197
201
  }
198
202
  }
199
203
 
200
- // Try to reuse existing pages first (when Chrome opened with profile)
204
+ // Create new tab if no reuse
201
205
  if (!page) {
202
- const pages = await browser.pages();
203
- // Filter out pages that might not be controllable
204
- const controllablePages = [];
205
- for (const p of pages) {
206
- try {
207
- const url = p.url();
208
- // Skip chrome:// pages and other internal pages
209
- if (!url.startsWith('chrome://') && !url.startsWith('chrome-extension://')) {
210
- controllablePages.push(p);
206
+ try {
207
+ page = await browser.newPage();
208
+ } catch (error) {
209
+ // If newPage() fails (can happen with some profiles), try to reuse existing page
210
+ const pages = await browser.pages();
211
+ for (const p of pages) {
212
+ try {
213
+ const pageUrl = p.url();
214
+ // Skip chrome:// pages and other internal pages
215
+ if (!pageUrl.startsWith('chrome://') && !pageUrl.startsWith('chrome-extension://')) {
216
+ page = p;
217
+ break;
218
+ }
219
+ } catch {
220
+ // Skip pages we can't access
211
221
  }
212
- } catch {
213
- // Skip pages we can't access
214
222
  }
215
- }
216
-
217
- // Use first controllable page or create new one
218
- if (controllablePages.length > 0) {
219
- page = controllablePages[0];
220
- } else {
221
- // Create new tab if no controllable pages
222
- page = await browser.newPage();
223
+ if (!page) {
224
+ throw new Error('Unable to create or find a controllable page');
225
+ }
223
226
  }
224
227
  }
225
228
 
226
229
  let shouldKeepOpen = keepPageOpen || page === lastKeptPage;
227
230
  let wasSuccess = false;
228
231
  try {
232
+ console.error(`[MCPBrowser] Navigating to: ${url}`);
229
233
  await page.goto(url, { waitUntil, timeout: timeoutMs });
234
+ console.error(`[MCPBrowser] Navigation completed: ${page.url()}`);
230
235
 
231
236
  // Extract content
232
237
  const text = await page.evaluate(() => document.body?.innerText || "");