MCP Web Fetch Server

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.

Category
Visit Server

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 Actions
  • POST /fetch - Fetch content from a URL (simplified endpoint for Actions)

MCP Protocol Endpoints

  • GET /.well-known/mcp.json - MCP manifest
  • GET /tools/list - List available tools
  • POST /tools/call - Execute a tool

Legacy SSE Endpoints

  • GET /sse - SSE endpoint for MCP communication
  • POST /messages - Message endpoint for MCP

Utility Endpoints

  • GET / - Server information
  • GET /health - Health check endpoint

Using with ChatGPT

Option 1: ChatGPT Actions (Recommended)

To use this server with ChatGPT Actions:

  1. Deploy the server and ensure it's accessible externally on port 8080
  2. In ChatGPT, go to your GPT settings and create a new Action
  3. Import the OpenAPI schema:
    • Click "Import from URL"
    • Enter: https://your-host:8080/openapi.json
  4. The fetchUrl action will now be available to ChatGPT

Option 2: MCP Protocol

To use this server with MCP-compatible clients:

  1. Deploy the server and ensure it's accessible externally on port 8080
  2. Configure your MCP client:
    • Server URL: https://your-host:8080
    • The server will be auto-discovered via the /.well-known/mcp.json manifest

Available Tools

fetch_url

Fetches content from a URL and returns the response.

Parameters:

  • url (required): The URL to fetch
  • method (optional): HTTP method (GET, POST, PUT, DELETE, PATCH). Default: GET
  • headers (optional): Object containing HTTP headers
  • body (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.com
  • MCP_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

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured