MCP FetchPage
Intelligent web page fetching with automatic cookie support and CSS selector extraction.
MCP FetchPage
Intelligent web page fetching with automatic cookie support and CSS selector extraction.
What it does
- Chrome Extension: Save cookies from logged-in websites
- MCP Server: Intelligent page fetching with HTTP ā SPA fallback and CSS selector support
Features
- š¤ Intelligent Fetching: Automatically chooses HTTP or browser method
- šŖ Smart Cookie Management: Uses actual cookie expiration times, not fixed 24-hour limit
- šÆ Advanced CSS Selector Support: Handles multiple nodes, filters nested elements automatically
- š Domain Presets: Built-in selectors for common websites (WeChat, Knowledge Planet, etc.)
- š± SPA Support: Full JavaScript rendering when needed
- š Progress Notifications: Real-time status updates
- š ļø Dual Debug Tools: Both standalone script and MCP Inspector support
Setup
1. Install MCP Server
Option A: Install from npm (Recommended)
npm install -g mcp-fetchpage
Option B: Install from source
cd ~/Downloads/mcp-fetchpage
npm install
2. Install Chrome Extension
If you installed from npm:
- Go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked"
- Select
/usr/local/lib/node_modules/mcp-fetchpage/chrome-extension
If you installed from source:
- Go to
chrome://extensions/
- Enable "Developer mode"
- Click "Load unpacked"
- Select
~/Downloads/mcp-fetchpage/chrome-extension
3. Configure Editor
Claude Desktop (~/Library/Application Support/Claude/claude_desktop_config.json
):
If installed globally via npm:
{
"mcpServers": {
"mcp-fetchpage": {
"command": "node",
"args": ["/usr/local/lib/node_modules/mcp-fetchpage/mcp-server/server.js"]
}
}
}
If installed locally or from source:
{
"mcpServers": {
"mcp-fetchpage": {
"command": "node",
"args": ["/path/to/mcp-fetchpage/mcp-server/server.js"]
}
}
}
Cursor (Settings > Cursor Settings > Tools & Integrations > MCP Tools):
{
"mcpServers": {
"mcp-fetchpage": {
"command": "node",
"args": ["node_modules/mcp-fetchpage/mcp-server/server.js"]
}
}
}
Restart your editor after configuration.
Usage
Basic Usage
- Login to a website in Chrome
- Click the "Fetch Page MCP Tools" extension icon
- Click "Save Cookies" button
- Use in Claude/Cursor:
fetchpage(url="https://example.com")
Advanced Usage
// Basic intelligent fetching
fetchpage(url="https://example.com")
// Force specific method
fetchpage(url="https://example.com", forceMethod="spa")
// Extract specific content with CSS selector
fetchpage(url="https://example.com", waitFor="#main-content")
// WeChat articles (automatic selector)
fetchpage(url="https://mp.weixin.qq.com/s/xxxxx")
Domain Presets
The system automatically uses optimized selectors for:
- mp.weixin.qq.com ā
.rich_media_wrp
(WeChat articles) - wx.zsxq.com ā
.content
(Knowledge Planet) - cnblogs.com ā
.post
(Blog Garden) - Add more in
mcp-server/domain-selectors.json
Debug Tools
# Standalone debug script (recommended for development)
cd mcp-server
node debug.js test-page "https://example.com"
node debug.js test-spa "https://example.com" "#content"
# MCP Inspector (for integration testing)
npx @modelcontextprotocol/inspector
# Then visit http://localhost:6274
Parameters
url
(required): The URL to fetchwaitFor
(optional): CSS selector to extract specific contentforceMethod
(optional): Force "http" or "spa" methodskipCookies
(optional): Skip loading cookiesheadless
(optional): Run browser in headless mode (default: true)timeout
(optional): Timeout in milliseconds (default: 30000)
File Structure
mcp-fetchpage/
āāā package.json # npm package config
āāā package-lock.json # npm lockfile
āāā node_modules/ # npm dependencies
āāā README.md # This file
āāā README-zh.md # Chinese version
āāā CLAUDE.md # Claude Code usage guide
āāā chrome-extension/ # Chrome extension
ā āāā manifest.json
ā āāā popup.js
ā āāā popup.html
ā āāā background.js
āāā mcp-server/ # MCP server
āāā server.js # Main server
āāā debug.js # Debug tools
āāā domain-selectors.json # Domain selector config
Troubleshooting
- Extension not working: Make sure you're on a normal website (not chrome:// pages)
- No cookies found: Try logging in again and saving cookies
- MCP not connecting: Check Node.js installation and restart your editor
- Path error: Make sure to use full path
/Users/YOUR_USERNAME/...
instead of~/...
- CSS selector not working: Verify the selector exists on the page
That's it! šŖ
Related Servers
Puppeteer Real Browser
Enables powerful, detection-resistant browser automation for AI assistants using puppeteer-real-browser.
MCP Web Research Server
A server for web research that brings real-time information into AI models and researches any topic.
CodingBaby Browser
A Node.js server that enables AI assistants to control the Chrome browser via WebSocket. Requires the CodingBaby Chrome Extension.
Playwright MCP Server
An MCP server using Playwright for browser automation and webscrapping
Outscraper
Access Outscraper's data extraction services for business intelligence, location data, reviews, and contact information from various online platforms.
yt-dlp-mcp
Download video and audio from various platforms like YouTube, Facebook, and TikTok using yt-dlp.
Kakuyomu MCP Server
An MCP server for the Kakuyomu novel posting site, enabling users to search for works, retrieve episode lists, and read content.
Oxylabs AI Studio
AI-powered tools for web scraping, crawling, and browser automation.
Career Site Jobs
A MCP server to retrieve up-to-date jobs from company career sites.
Query Table
A financial web table crawler using Playwright that queries data from multiple websites with fallback switching.