MCP Web Fetch Server
Enables fetching content from any URL with support for different HTTP methods, custom headers, and request bodies. Designed to work with ChatGPT and other AI assistants for web scraping and API interactions.
README
MCP Web Fetch Server
An MCP (Model Context Protocol) server that provides web fetching capabilities over HTTP/SSE. This server is designed to work with ChatGPT and other AI assistants that support MCP over HTTP.
Features
- Fetch content from any URL
- Support for different HTTP methods (GET, POST, PUT, DELETE, PATCH)
- Custom headers support
- Adaptive chunking for large responses to avoid MCP payload limits
- Request body support for POST/PUT/PATCH
- Dockerized for easy deployment
- External access via port 8080
Quick Start
Using Docker Compose (Recommended)
docker-compose up -d
Using Docker
# Build the image
docker build -t mcp-web-fetch .
# Run the container
docker run -d -p 8080:8080 --name mcp-web-fetch mcp-web-fetch
Local Development
# Install dependencies
npm install
# Start the server
npm start
Endpoints
ChatGPT Actions Endpoints
GET /openapi.json- OpenAPI 3.1 schema for ChatGPT ActionsPOST /fetch- Fetch content from a URL (simplified endpoint for Actions)
MCP Protocol Endpoints
GET /.well-known/mcp.json- MCP manifestGET /tools/list- List available toolsPOST /tools/call- Execute a tool
Legacy SSE Endpoints
GET /sse- SSE endpoint for MCP communicationPOST /messages- Message endpoint for MCP
Utility Endpoints
GET /- Server informationGET /health- Health check endpoint
Using with ChatGPT
Option 1: ChatGPT Actions (Recommended)
To use this server with ChatGPT Actions:
- Deploy the server and ensure it's accessible externally on port 8080
- In ChatGPT, go to your GPT settings and create a new Action
- Import the OpenAPI schema:
- Click "Import from URL"
- Enter:
https://your-host:8080/openapi.json
- The
fetchUrlaction will now be available to ChatGPT
Option 2: MCP Protocol
To use this server with MCP-compatible clients:
- Deploy the server and ensure it's accessible externally on port 8080
- Configure your MCP client:
- Server URL:
https://your-host:8080 - The server will be auto-discovered via the
/.well-known/mcp.jsonmanifest
- Server URL:
Available Tools
fetch_url
Fetches content from a URL and returns the response.
Parameters:
url(required): The URL to fetchmethod(optional): HTTP method (GET, POST, PUT, DELETE, PATCH). Default: GETheaders(optional): Object containing HTTP headersbody(optional): Request body for POST/PUT/PATCH requests
Example:
{
"url": "https://api.example.com/data",
"method": "GET",
"headers": {
"Authorization": "Bearer token123"
}
}
When the fetched body exceeds the configured chunk size, MCP clients receive metadata plus additional chunk N/M text messages containing the body segments. The /fetch HTTP endpoint mirrors this behavior by returning bodyChunks, bodyChunkSize, and bodyChunkCount alongside the aggregate bodyLength.
Configuration
The server can be configured using environment variables:
PORT: Port to run the server on (default: 8080)SERVER_URL: Public HTTPS URL for your server (used in OpenAPI schema). Required for ChatGPT Actions. Example:https://mcp.36technology.comMCP_BODY_CHUNK_SIZE: Maximum number of characters per body chunk when returning large payloads (default: 60000)
Setting Environment Variables
For Docker deployment, create a .env file:
cp .env.example .env
# Edit .env and set SERVER_URL to your public HTTPS URL
Or set it directly in docker-compose:
SERVER_URL=https://your-domain.com docker-compose up -d
Health Check
Check if the server is running:
curl http://localhost:8080/health
Testing
Test ChatGPT Actions Endpoints
Get the OpenAPI schema:
curl http://localhost:8080/openapi.json
Test the fetch endpoint:
curl -X POST http://localhost:8080/fetch \
-H "Content-Type: application/json" \
-d '{
"url": "https://api.github.com/zen"
}'
Test MCP Protocol Endpoints
Test the MCP manifest:
curl http://localhost:8080/.well-known/mcp.json
List available tools:
curl http://localhost:8080/tools/list
Call the fetch_url tool:
curl -X POST http://localhost:8080/tools/call \
-H "Content-Type: application/json" \
-d '{
"name": "fetch_url",
"arguments": {
"url": "https://api.github.com/zen"
}
}'
Security Considerations
- This server can fetch any URL, so use appropriate network restrictions
- Consider adding authentication if exposing publicly
- Be mindful of rate limiting on external services
- Use HTTPS in production environments
License
MIT
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.