MCP Browser Fetch
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP Browser Fetch
A Model Context Protocol (MCP) server for browser-like web fetching that bypasses bot detection.
Features
Auto-updating Chrome User-Agent: Calculates current Chrome version based on release schedule
Full browser headers: Includes Accept, Accept-Language, Sec-Fetch-*, and other headers real browsers send
Brotli decompression: Automatically handles Brotli-compressed responses
Session management: Uses requests.Session() for proper cookie handling
Related MCP server: openmcp
Why?
The default mcp-server-fetch identifies itself as a bot in the User-Agent, causing many sites to block it with 403 Forbidden errors. This implementation mimics a real Chrome browser to avoid detection.
Installation
# Clone the repository
git clone git@github.com:kevin-hi/fetch-mcp.git
cd fetch-mcp
# Create virtual environment and install dependencies
python3 -m venv .venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
pip install -e .
# For development (includes test dependencies)
pip install -e ".[dev]"Configuration
Claude Code
Add to ~/.claude/.mcp.json:
{
"mcpServers": {
"fetch": {
"command": "/path/to/fetch-mcp/.venv/bin/python",
"args": ["/path/to/fetch-mcp/server.py"]
}
}
}Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or equivalent:
{
"mcpServers": {
"fetch": {
"command": "/path/to/fetch-mcp/.venv/bin/python",
"args": ["/path/to/fetch-mcp/server.py"]
}
}
}Ensuring Claude Uses This Tool
To ensure Claude always uses mcp__fetch__fetch instead of built-in WebFetch:
Install the skill (teaches Claude to prefer this tool):
mkdir -p ~/.claude/skills/web-fetch # Copy SKILL.md from this repo to ~/.claude/skills/web-fetch/Optional: Add warning hook to catch WebFetch attempts:
mkdir -p ~/.claude/hooks # Copy hooks.json from this repo to ~/.claude/hooks/Restart Claude to load the new configuration
Usage
The tool exposes a single fetch function that works like the standard MCP fetch but with browser-like headers:
fetch(
url: str, # URL to fetch
max_length: int = 5000, # Max characters to return
start_index: int = 0, # Start index for pagination
raw: bool = False # Return raw HTML instead of markdown
)Development
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run all tests
pytest
# Run with coverage
pytest --cov=server --cov-report=html
# Run specific test class
pytest test_server.py::TestChromeVersion
# Run specific test
pytest test_server.py::TestChromeVersion::test_version_calculation_current_dateTest Coverage
The test suite covers:
Chrome version calculation and bounds
Platform detection (macOS, Windows, Linux, ARM, Intel)
Session management and reuse
Browser header generation
URL validation (http/https only, rejects file://, javascript:, data:, ftp:)
Response size limits (50MB cap)
Error handling (404, connection errors, timeouts)
HTML parsing and fallback
Pagination functionality
Manual Testing
Successfully tested against:
CamelCamelCamel (was 403 blocked with default MCP)
Reddit
Wired.com
Most other sites that block obvious bots
Technical Details
User-Agent Calculation
Chrome releases approximately every 4 weeks. Starting from Chrome 122 (Feb 2024), the code calculates the current version:
base_version = 122
base_date = date(2024, 2, 1)
days_since = (date.today() - base_date).days
versions_since = days_since // 28
current_version = base_version + versions_sinceBrowser Headers
Includes all headers that Chrome sends:
User-Agent: Auto-calculated Chrome versionAccept: Full content type preferencesAccept-Language,Accept-EncodingSec-Fetch-Dest,Sec-Fetch-Mode,Sec-Fetch-Site,Sec-Fetch-UserSec-Ch-Ua,Sec-Ch-Ua-Mobile,Sec-Ch-Ua-PlatformUpgrade-Insecure-Requests,Cache-Control
License
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Reliable web fetching for AI agents with retry, circuit breaker, caching, and anti-bot bypass
Reliable web access for AI agents: smart HTTP, rotating proxies, and full-browser rendering.
Stealth web browser for agents: search, fetch, click, download and type in persistent MCP sessions.
Let your AI agent operate any website through a real, logged-in browser session.
Related MCP Servers
- AlicenseAqualityBmaintenanceEnables AI agents to browse and extract content from JavaScript-rendered web pages via the Model Context Protocol, returning plain text, HTML, or Markdown.13MIT
- AlicenseNot gradedqualityDmaintenanceEnables AI agents to automate web tasks such as browsing, clicking, typing, and taking screenshots via the Model Context Protocol.1MIT
- AlicenseAqualityBmaintenanceEnables browser automation through the Model Context Protocol, allowing AI agents to control Chrome, Firefox, or Edge for tasks like navigation, clicking, typing, and screenshots.41105 npmMIT
- AlicenseNot gradedqualityDmaintenanceEnables browser automation via the Model Context Protocol, supporting headless Playwright and extension bridges for controlling existing Chrome and Firefox tabs.ISC