Sponsored by Deepsite.site

XFetch Mcp

Created By
xfetchai10 months ago
Fetch on steroids. Allow to retrieve content from any web pages, including those protected by Cloudflare and other security systems.
Content

XFetch MCP Server

PyPI version Python Versions License: MIT

Enhanced Model Context Protocol server for web content fetching (fetch on steroids). This server enables LLMs to retrieve and process content from any web pages, including those protected by Cloudflare and other security systems that regular fetch can't handle.

Key Features

  • 🚀 Bypass Protection Systems: Access content from websites protected by Cloudflare and other security systems
  • 🌐 JavaScript Rendering: Fetch content from dynamic websites that require JavaScript execution
  • 🎯 CSS Selectors: Extract specific content from web pages using CSS selectors
  • ⏱️ Dynamic Content Loading: Wait for dynamic content to load before fetching
  • 📝 Markdown Conversion: Automatically converts HTML to markdown for easier LLM consumption
  • 🔄 Chunked Reading: Read long pages in chunks using start_index parameter

Available Tools

  • xfetch - Enhanced web content fetching tool with advanced capabilities
    • url (string, required): URL to fetch
    • max_length (integer, optional): Maximum number of characters to return (default: 5000)
    • start_index (integer, optional): Start content from this character index (default: 0)
    • raw (boolean, optional): Get raw content without markdown conversion (default: false)
    • render (boolean, optional): Enable JavaScript rendering for dynamic content (default: false)
    • selector (string, optional): CSS selector to extract specific content
    • timeout (integer, optional): Wait time in seconds for dynamic content loading (1-10 seconds)

Prompts

  • xfetch
    • Fetch a URL and extract its contents as markdown
    • Arguments:
      • url (string, required): URL to fetch
      • render (boolean, optional): Enable JavaScript rendering
      • selector (string, optional): CSS selector for content extraction
      • timeout (integer, optional): Dynamic content loading timeout

Installation

Using pip

pip install mcp-server-xfetch

When using uv, no specific installation is needed:

uvx mcp-server-xfetch

Configuration

Configure for Claude.app

Add to your Claude settings:

Using uvx (recommended)
"mcpServers": {
  "xfetch": {
    "command": "uvx",
    "args": ["mcp-server-xfetch"]
  }
}
Using pip installation
"mcpServers": {
  "xfetch": {
    "command": "python",
    "args": ["-m", "mcp_server_xfetch"]
  }
}

API Token

XFetch service offers two usage tiers:

Free Tier

The package includes a default API token that allows limited free usage. This is great for:

  • Testing and evaluation
  • Personal projects
  • Small-scale non-commercial use

However, the free tier has rate limits and may have occasional stability issues.

Commercial/Production Use

For stable and reliable service, especially for:

  • Commercial projects
  • Production environments
  • High-volume requests
  • Guaranteed uptime and support

Visit xfetch.ai to:

  1. Register for a commercial account
  2. Get your dedicated API token
  3. Access premium features and support

Once you have your token, you can set it up in one of these ways:

# Option 1: Environment variable (recommended)
export XFETCH_API_TOKEN=your_token_here
# Option 2: Command line argument
python -m mcp_server_xfetch --api-token=your_token_here

Or in your Claude configuration:

"mcpServers": {
  "xfetch": {
    "command": "python",
    "args": ["-m", "mcp_server_xfetch", "--api-token=your_token_here"]
  }
}

Examples

Basic Usage

# Simple fetch with markdown conversion
{
    "url": "https://example.com"
}

JavaScript Rendering

# Fetch from a dynamic website
{
    "url": "https://dynamic-site.com",
    "render": true,
    "timeout": 5  # Wait up to 5 seconds for content to load
}

Content Extraction

# Extract specific content using CSS selector
{
    "url": "https://news-site.com",
    "selector": "article.main-content",
    "render": true
}

Reading Long Content

# First request
{
    "url": "https://long-article.com",
    "max_length": 5000
}

# Continue reading from where it left off
{
    "url": "https://long-article.com",
    "start_index": 5000,
    "max_length": 5000
}

Debugging

You can use the MCP inspector to debug the server:

npx @modelcontextprotocol/inspector uvx mcp-server-xfetch

Contributing

We welcome contributions! Whether you want to add new features, fix bugs, or improve documentation, your help is appreciated.

  1. Fork the repository
  2. Create your feature branch
  3. Commit your changes
  4. Push to the branch
  5. Create a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Serper MCP ServerA Serper MCP Server
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
Tavily Mcp
ChatWiseThe second fastest AI chatbot™
Amap Maps高德地图官方 MCP Server
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.
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.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
WindsurfThe new purpose-built IDE to harness magic
Playwright McpPlaywright MCP server
DeepChatYour AI Partner on Desktop
Y GuiA web-based graphical interface for AI chat interactions with support for multiple AI models and MCP (Model Context Protocol) servers.
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.
CursorThe AI Code Editor
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
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"