Sponsored by Deepsite.site

Mcp Browser

Created By
cherchyka month ago
Browser automation for web scraping when standard HTTP requests fail. Use ONLY when pages require: (1) Authentication - login forms, SSO, 401/403 errors, corporate intranets, (2) Anti-bot protection - CAPTCHA, Cloudflare challenges, rate limiting, (3) JavaScript rendering - SPAs, dynamic content loaded after page load. Can fetch pages, click elements, fill forms, and extract content. Opens real browser for user authentication, then automates interactions and extraction. DO NOT use for simple HTML pages that work with regular HTTP GET requests.
Content

MCPBrowser

VS Code Marketplace npm version Claude Desktop License: MIT

MCPBrowser gives your AI assistant the ability to browse web pages like a human. Lets AI assistants (Claude, Copilot) access any website — especially those protected by authentication, CAPTCHAs, anti-bot restrictions, or requiring JavaScript rendering. Uses your real Chrome/Edge browser session, so you log in once, and your AI can navigate, click buttons, fill forms, and extract content from sites that block automated requests.

Built on the Model Context Protocol (MCP), MCPBrowser works seamlessly with Claude Desktop, Claude Code (CLI), GitHub Copilot, and any MCP-compatible AI assistant. It handles corporate SSO, CAPTCHAs, Cloudflare protection, SPAs, dashboards, and any site that blocks automated requests. Your AI gets the same access you have — no special APIs, no headless browser detection, just your authenticated browser session.

Example workflow for AI assistant to use MCPBrowser

1. fetch_webpage    → Load the login page
2. type_text        → Enter username
3. type_text        → Enter password
4. click_element    → Click "Sign In"
5. get_current_html → Extract the content after login

Contents

Requirements

  • Chrome or Edge browser
  • Node.js 18+

Installation

#PlatformDifficulty
1VS Code ExtensionOne Click
2Claude CodeOne Command
3Claude DesktopManual
4npm PackageManual

Option 1: VS Code Extension

Install from VS Code Marketplace or run:

code --install-extension cherchyk.mcpbrowser

The extension automatically installs and configures everything for GitHub Copilot.

Option 2: Claude Code

claude mcp add mcpbrowser --scope user -- npx -y mcpbrowser@latest

Verify it's working:

claude mcp list

You should see:

mcpbrowser: npx -y mcpbrowser@latest - ✓ Connected

That's it! Ask Claude to fetch any protected page:

"Fetch https://portal.azure.com using mcpbrowser"

Option 3: Claude Desktop

Add to your config file:

Windows: %APPDATA%\Claude\claude_desktop_config.json Mac: ~/Library/Application Support/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "MCPBrowser": {
      "command": "npx",
      "args": ["-y", "mcpbrowser@latest"]
    }
  }
}

Restart Claude Desktop after saving.

Option 4: npm Package

For VS Code (GitHub Copilot) manual setup, add to your mcp.json:

Windows: %APPDATA%\Code\User\mcp.json Mac/Linux: ~/.config/Code/User/mcp.json

{
  "servers": {
    "MCPBrowser": {
      "type": "stdio",
      "command": "npx",
      "args": ["-y", "mcpbrowser@latest"]
    }
  }
}

MCP Tools

fetch_webpage

Fetches web pages using your Chrome/Edge browser. Handles authentication, CAPTCHA, SSO, anti-bot protection, and JavaScript-heavy sites. Opens the URL in a browser tab (reuses existing tab for same domain) and waits for the page to fully load before returning content.

Parameters:

  • url (string, required) - The URL to fetch
  • removeUnnecessaryHTML (boolean, optional, default: true) - Remove unnecessary HTML for size reduction by ~90%
  • postLoadWait (number, optional, default: 1000) - Milliseconds to wait after page load for SPAs to render dynamic content

Examples:

// Basic fetch
{ url: "https://example.com" }

// Fetch with custom wait time for slow SPAs
{ url: "https://dashboard.example.com", postLoadWait: 2000 }

// Keep full HTML without cleanup
{ url: "https://example.com", removeUnnecessaryHTML: false }

click_element

Clicks on any clickable element (buttons, links, divs with onclick handlers, etc.). Can target by CSS selector or visible text content. Automatically scrolls element into view and waits for page stability after clicking.

⚠️ Note: Page must be already loaded via fetch_webpage first.

Parameters:

  • url (string, required) - The URL of the page (must match a previously fetched page)
  • selector (string, optional) - CSS selector for the element (e.g., #submit-btn, .login-button)
  • text (string, optional) - Text content to search for if selector not provided (e.g., "Sign In", "Submit")
  • returnHtml (boolean, optional, default: true) - Whether to wait for stability and return HTML after clicking. Set to false for fast form interactions (checkboxes, radio buttons)
  • removeUnnecessaryHTML (boolean, optional, default: true) - Remove unnecessary HTML for size reduction. Only used when returnHtml is true
  • postClickWait (number, optional, default: 1000) - Milliseconds to wait after click for SPAs to render dynamic content
  • waitForElementTimeout (number, optional, default: 1000) - Maximum time to wait for element in milliseconds

Examples:

// Click by text content
{ url: "https://example.com", text: "Sign In" }

// Click by CSS selector
{ url: "https://example.com", selector: "#login-button" }

// Click without waiting for HTML (fast checkbox toggle)
{ url: "https://example.com", selector: "#agree-checkbox", returnHtml: false }

// Click with custom wait time
{ url: "https://example.com", text: "Load More", postClickWait: 2000 }

type_text

Types text into an input field, textarea, or other editable element. Simulates human-like typing with configurable delay between keystrokes. Automatically clears existing text by default.

⚠️ Note: Page must be already loaded via fetch_webpage first.

Parameters:

  • url (string, required) - The URL of the page (must match a previously fetched page)
  • selector (string, required) - CSS selector for the input element (e.g., #username, input[name="email"])
  • text (string, required) - Text to type into the field
  • clear (boolean, optional, default: true) - Whether to clear existing text first
  • typeDelay (number, optional, default: 50) - Delay between keystrokes in milliseconds (simulates human typing)
  • returnHtml (boolean, optional, default: true) - Whether to wait for stability and return HTML after typing
  • removeUnnecessaryHTML (boolean, optional, default: true) - Remove unnecessary HTML for size reduction. Only used when returnHtml is true
  • postTypeWait (number, optional, default: 1000) - Milliseconds to wait after typing for SPAs to render dynamic content
  • waitForElementTimeout (number, optional, default: 5000) - Maximum time to wait for element in milliseconds

Examples:

// Basic text input
{ url: "https://example.com", selector: "#email", text: "user@example.com" }

// Append text without clearing
{ url: "https://example.com", selector: "#search", text: " advanced", clear: false }

// Fast typing without human simulation
{ url: "https://example.com", selector: "#username", text: "john", typeDelay: 0 }

// Type without waiting for HTML return (faster)
{ url: "https://example.com", selector: "#field", text: "value", returnHtml: false }

get_current_html

Gets the current HTML from an already-loaded page WITHOUT navigating or reloading. Much faster than fetch_webpage since it only extracts the current DOM state. Use this after interactions (click, type) to get the updated page content efficiently.

⚠️ Note: Page must be already loaded via fetch_webpage first.

Parameters:

  • url (string, required) - The URL of the page (must match a previously fetched page)
  • removeUnnecessaryHTML (boolean, optional, default: true) - Remove unnecessary HTML for size reduction by ~90%

Examples:

// Get current HTML after interactions
{ url: "https://example.com" }

// Get full HTML without cleanup
{ url: "https://example.com", removeUnnecessaryHTML: false }

Performance comparison:

  • fetch_webpage: 2-5 seconds (full page reload)
  • get_current_html: 0.1-0.3 seconds (just extracts HTML) ✅

close_tab

Closes the browser tab for the given URL's hostname. Removes the page from the tab pool and forces a fresh session on the next visit to that hostname. Useful for clearing authentication state, managing memory, or starting fresh with a domain.

⚠️ Note: Uses exact hostname match (www.example.com and example.com are treated as different tabs).

Parameters:

  • url (string, required) - The URL whose hostname tab should be closed

Examples:

// Close tab for a domain
{ url: "https://example.com" }

// This will close the tab for portal.azure.com
{ url: "https://portal.azure.com/dashboard" }

Use cases:

  • Clear authentication/session state
  • Free up browser memory
  • Reset to fresh state before new login

Configuration (Optional)

Environment variables for advanced setup:

VariableDescriptionDefault
CHROME_PATHPath to Chrome/EdgeAuto-detect
CHROME_USER_DATA_DIRBrowser profile directory%LOCALAPPDATA%/ChromeAuthProfile
CHROME_REMOTE_DEBUG_PORTDevTools port9222

Troubleshooting

Browser doesn't open?

  • Make sure Chrome or Edge is installed
  • Try setting CHROME_PATH explicitly

Can't connect to browser?

  • Close all Chrome instances and try again
  • Check if port 9222 is in use

Authentication not preserved?

  • Keep the browser tab open (default behavior)
  • Use the same domain for related requests

For Developers

For Developers

Clone and setup:

git clone https://github.com/cherchyk/MCPBrowser.git
cd MCPBrowser
npm run install:all  # Installs dependencies for all workspace packages

Run tests:

# Test everything
npm test

# Test MCP server only
npm run test:mcp

# Test extension only
npm run test:extension

License

MIT

Server Config

{
  "mcpServers": {
    "MCPBrowser": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "mcpbrowser@latest"
      ],
      "description": "Browser automation for web scraping when standard HTTP requests fail. Use ONLY when pages require: (1) Authentication - login forms, SSO, 401/403 errors, corporate intranets, (2) Anti-bot protection - CAPTCHA, Cloudflare challenges, rate limiting, (3) JavaScript rendering - SPAs, dynamic content loaded after page load. Can fetch pages, click elements, fill forms, and extract content. Opens real browser for user authentication, then automates interactions and extraction. DO NOT use for simple HTML pages that work with regular HTTP GET requests."
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Serper MCP ServerA Serper MCP Server
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
CursorThe AI Code Editor
WindsurfThe new purpose-built IDE to harness magic
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright McpPlaywright MCP server
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
Amap Maps高德地图官方 MCP Server
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
Tavily Mcp
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
ChatWiseThe second fastest AI chatbot™
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.