Skip to main content

Enhanced MCP fetch server (fetch on steroids) that works through xfet.ch service. Unlocks access to websites blocked by Cloudflare and other protection systems that regular fetch can't handle.

Project description

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

Using uv (recommended)

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 docker
"mcpServers": {
  "xfetch": {
    "command": "docker",
    "args": ["run", "-i", "--rm", "mcp/xfetch"]
  }
}
Using pip installation
"mcpServers": {
  "xfetch": {
    "command": "python",
    "args": ["-m", "mcp_server_xfetch"]
  }
}

API Token

To use the XFetch service, you need an API token. The default token included in the package has rate limits. For production use:

  1. Visit xfet.ch to register
  2. Get your API token from the dashboard
  3. Set the token in your environment:
    export XFETCH_API_TOKEN=your_token_here
    
    Or pass it directly in the configuration:
    "args": ["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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mcp_server_xfetch-0.0.1.tar.gz (44.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mcp_server_xfetch-0.0.1-py3-none-any.whl (8.2 kB view details)

Uploaded Python 3

File details

Details for the file mcp_server_xfetch-0.0.1.tar.gz.

File metadata

  • Download URL: mcp_server_xfetch-0.0.1.tar.gz
  • Upload date:
  • Size: 44.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.16

File hashes

Hashes for mcp_server_xfetch-0.0.1.tar.gz
Algorithm Hash digest
SHA256 bfc14442a88c37cf520b6edf0dabb1667a62d1e0c421bb8623bcd236cdf69a7a
MD5 14ed14b13814cb6805b33a8864f2fb51
BLAKE2b-256 1ef587d914625350573eb487ac9b077989a07095cf021f9c04c504883eb24d4a

See more details on using hashes here.

File details

Details for the file mcp_server_xfetch-0.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for mcp_server_xfetch-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a6c4498645ed2d0f4333a1694faf799494e970a53d7b2c7dc68c4cadeae5e5c
MD5 f499a02f81e214a4de00f55d5a3a1d5f
BLAKE2b-256 fc3d7e36f19bf6d1a42b333ad93335e6a92a3bbb0fccc5b7048618d1b45cd4f0

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page