Intelligent web page fetching with automatic cookie support and CSS selector extraction.
- Chrome Extension: Save cookies from logged-in websites
- MCP Server: Intelligent page fetching with HTTP → SPA fallback and CSS selector support
- 🤖 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
Option A: Install from npm (Recommended)
npm install -g mcp-fetchpage
Option B: Install from source
cd ~/Downloads/mcp-fetchpage
npm install
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
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.
- 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")
// 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")
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
# 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
-
url
(required): The URL to fetch -
waitFor
(optional): CSS selector to extract specific content -
forceMethod
(optional): Force "http" or "spa" method -
skipCookies
(optional): Skip loading cookies -
headless
(optional): Run browser in headless mode (default: true) -
timeout
(optional): Timeout in milliseconds (default: 30000)
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
- 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! 🍪