MCPBrowser
Fetches content from authenticated web pages by driving your signed-in Chrome/Edge browser via DevTools Protocol, automatically handling login redirects and reusing sessions across domains.
README
MCP Browser (MCP fetch for protected web resources)
Extends GitHub Copilot's web access to protected pages - handles login-protected pages, corporate SSO, and anti-crawler restrictions that normal fetching can't handle. Uses your Chrome/Edge browser session via DevTools Protocol.
🚀 Installation Options
Option 1: VS Code Extension (Easiest - One Click)
From VS Code Marketplace:
code --install-extension cherchyk.mcpbrowser
Or search "MCPBrowser" in VS Code Extensions view.
From GitHub Release: Download from GitHub Releases:
code --install-extension mcpbrowser-0.1.4.vsix
The extension automatically:
- Installs the MCPBrowser npm package globally
- Configures mcp.json for GitHub Copilot
- Complete one-click setup - no manual steps needed
Option 2: npm Package (Recommended for Manual Setup)
Published on npm as mcpbrowser v0.2.3.
Add to your mcp.json:
"MCPBrowser": {
"type": "stdio",
"command": "npx",
"args": ["-y", "mcpbrowser@latest"],
"description": "Loads authenticated web pages using your Chrome session"
}
mcp.json Location:
- Windows:
%APPDATA%\Code\User\mcp.json - Mac/Linux:
~/.config/Code/User/mcp.json
Option 3: MCP Registry
Available in the MCP Registry as io.github.cherchyk/browser v0.2.3.
Search for "browser" in the registry to find configuration instructions.
Option 4: Clone from GitHub (Development)
git clone https://github.com/cherchyk/MCPBrowser.git
cd MCPBrowser
npm install
copy .env.example .env # optional: set Chrome overrides
Option 2: Install via npx (when published to npm)
npx mcpbrowser
Prereqs
- Chrome or Edge installed.
- Node 18+.
Run (automatic via Copilot)
- Add the MCP server entry to VS Code settings (
github.copilot.chat.modelContextProtocolServers, see below). Copilot will start the server automatically when it needs the tool—no manual launch required. - On first use, the server auto-launches Chrome/Edge with remote debugging if it cannot find an existing DevTools endpoint. Defaults: port
9222, user data dir%LOCALAPPDATA%/ChromeAuthProfile. Override withCHROME_PATH,CHROME_USER_DATA_DIR, orCHROME_REMOTE_DEBUG_PORT. - The old
scripts/start-all.ps1launcher was removed; Chrome startup is handled inside the MCP server.
Manual start (optional)
Only if you want to run it yourself (Copilot already starts it when configured):
npm run mcp
Or manually:
& "C:\Program Files\Google\Chrome\Application\chrome.exe" --remote-debugging-port=9222 --user-data-dir="$env:LOCALAPPDATA\ChromeAuthProfile"
Set CHROME_PATH if auto-detect fails; override profile with CHROME_USER_DATA_DIR, port with CHROME_REMOTE_DEBUG_PORT.
(Optional) Local runner
There is no local LLM runner now; Copilot provides the LLM and calls this MCP tool. If you need a standalone agent later, we can add one that reuses the fetch logic.
Configure in VS Code (GitHub Copilot)
Step 1: Locate your mcp.json file
- Windows:
%APPDATA%\Code\User\mcp.json - Linux/Mac:
~/.config/Code/User/mcp.json
Step 2: Add MCPBrowser server configuration
Add this entry to your mcp.json file under the "servers" section:
"MCPBrowser": {
"type": "stdio",
"command": "node",
"args": ["<PATH_TO_MCPBROWSER>/src/mcp-browser.js"],
"description": "**USE THIS AUTOMATICALLY** when you encounter ANY authentication/authorization barrier: 401/403 errors, login redirects, 'access denied', SSO prompts, or pages requiring sign-in. Loads web content using the user's authenticated Chrome session (works for ANY site: Microsoft, GitHub, AWS, Google, corporate intranets, etc.). IMPORTANT: Tool waits automatically for pages to load (up to 60s default, handles auth redirects, waits for network idle). Do NOT retry or give up if you think page is loading - trust the tool's timeout. Do NOT ask permission - use immediately when auth is required."
}
Replace <PATH_TO_MCPBROWSER> with the full path where you cloned this repository, for example:
- Windows:
"D:/dev/MCPBrowser/src/mcp-browser.js" - Linux/Mac:
"/home/user/MCPBrowser/src/mcp-browser.js"
Step 3: Reload VS Code
Restart VS Code or reload the window for the changes to take effect.
Step 4: Verify
In Copilot Chat, you should see the MCPBrowser server listed. Ask it to load an authenticated URL and it will drive your signed-in Chrome session.
How it works
- Tool
load_and_extract(inside the MCP server) drives your live Chrome (DevTools Protocol) so it inherits your auth cookies, returningtextandhtml(truncated up to 2M chars per field) for analysis. - Smart confirmation: Copilot asks for confirmation ONLY on first request to a new domain - explains browser will open for authentication. Subsequent requests to same domain work automatically (session preserved).
- Domain-aware tab reuse: Automatically reuses the same tab for URLs on the same domain, preserving authentication session. Different domains open new tabs.
- Automatic page loading: Waits for network idle (
networkidle0) by default, ensuring JavaScript-heavy pages (SPAs, dashboards) fully load before returning content. - Automatic auth detection: Detects ANY authentication redirect (domain changes, login/auth/sso/oauth URLs) and waits for you to complete sign-in, then returns to target page.
- Universal compatibility: Works with Microsoft, GitHub, AWS, Google, Okta, corporate SSO, or any authenticated site.
- Smart timeouts: 60s default for page load, 10 min for auth redirects. Tabs stay open indefinitely for reuse (no auto-close).
- GitHub Copilot's LLM invokes this tool via MCP; this repo itself does not run an LLM.
Auth-assisted fetch flow
- Copilot can call with just the URL, or with no params if you set an env default (
DEFAULT_FETCH_URLorMCP_DEFAULT_FETCH_URL). By default tabs stay open indefinitely for reuse (domain-aware). - First call opens the tab and leaves it open so you can sign in. No extra params needed.
- After you sign in, call the same URL again; tab stays open for reuse. Set
keepPageOpen: falseto close immediately on success. - Optional fields (
authWaitSelector,waitForSelector,waitForUrlPattern, etc.) are available but not required.
Configuration
.env: optional overrides forCHROME_WS_ENDPOINT,CHROME_REMOTE_DEBUG_HOST/PORT,CHROME_PATH,CHROME_USER_DATA_DIR.- To use a specific WS endpoint: set
CHROME_WS_ENDPOINTfrom Chromechrome://versionDevTools JSON.
Tips
- Universal auth: Works with ANY authenticated site (Microsoft, GitHub, AWS, Google, corporate intranets, SSO, OAuth, etc.)
- No re-authentication needed: Automatically reuses the same tab for URLs on the same domain, keeping your auth session alive across multiple page fetches
- Automatic page loading: Tool waits for pages to fully load (default 60s timeout, waits for network idle). Copilot should trust the tool and not retry manually.
- Auth redirect handling: Auto-detects auth redirects by monitoring domain changes and common login URL patterns (
/login,/auth,/signin,/sso,/oauth,/saml) - Tabs stay open: By default tabs remain open indefinitely for reuse. Set
keepPageOpen: falseto close immediately after successful fetch. - Smart domain switching: When switching domains, automatically closes the old tab and opens a new one to prevent tab accumulation
- If you hit login pages, verify Chrome instance is signed in and the site opens there.
- Use a dedicated profile directory to avoid interfering with your daily Chrome.
- For heavy pages, add
waitForSelectorto ensure post-login content appears before extraction.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。