Uses Pydantic for type validation of URL parameters and request configuration
URL Fetch MCP
A clean Model Context Protocol (MCP) implementation that enables Claude or any LLM to fetch content from URLs.
Features
Fetch content from any URL
Support for multiple content types (HTML, JSON, text, images)
Control over request parameters (headers, timeout)
Clean error handling
Works with both Claude Code and Claude Desktop
Repository Structure
Installation
Usage
Running the Server
Installing in Claude Desktop
There are three ways to install in Claude Desktop:
Method 1: Direct installation
The url_fetcher.py
file contains:
Method 2: Use the installer script
The scripts/install_desktop.py
script:
Method 3: Use CLI command
Core Implementation
The main MCP implementation is in src/url_fetch_mcp/main.py
:
Tool Capabilities
fetch_url
Fetches content from a URL and returns it as text.
Parameters:
url
(required): The URL to fetchheaders
(optional): Additional headers to send with the requesttimeout
(optional): Request timeout in seconds (default: 10)
fetch_image
Fetches an image from a URL and returns it as an image.
Parameters:
url
(required): The URL to fetch the image fromtimeout
(optional): Request timeout in seconds (default: 10)
fetch_json
Fetches JSON from a URL, parses it, and returns it formatted.
Parameters:
url
(required): The URL to fetch JSON fromheaders
(optional): Additional headers to send with the requesttimeout
(optional): Request timeout in seconds (default: 10)
Examples
The examples
directory contains example scripts:
quick_test.py
: Quick test of the MCP serversimple_usage.py
: Example of using the client APIinteractive_client.py
: Interactive CLI for testing
Testing
To test basic functionality:
License
MIT
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
A Model Context Protocol (MCP) server that enables Claude or other LLMs to fetch content from URLs, supporting HTML, JSON, text, and images with configurable request parameters.
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server for web research. Bring real-time info into Claude and easily research any topic.Last updated -315,704280MIT License
- AsecurityAlicenseAqualityModel Context Protocol server for fetching web content and processing images. This allows Claude Desktop (or any MCP client) to fetch web content and handle images appropriately.Last updated -15,34130MIT License
- AsecurityAlicenseAqualityModel Context Protocol server that enables Claude Desktop (or any MCP client) to fetch web content and process images appropriately.Last updated -1106MIT License
- AsecurityFlicenseAqualityA server that implements the Model Context Protocol (MCP) standard, enabling LLMs like Claude to interact with selected Postman API requests through generated JavaScript tools.Last updated -4