mcp-server-requests

mcp-server-requests

Web Content Retrieval (full webpage, filtered content, or Markdown-converted), Custom User-Agent, Multi-HTTP Method Support (GET/POST/PUT/DELETE/PATCH), LLM-Controlled Request Headers, LLM-Accessible Response Headers, and more.

Category
Visit Server

README

中文


mcp-server-requests

An MCP server that provides HTTP request capabilities, enabling LLMs to fetch and process web content.

Features

  • Supports converting web content to Markdown format
  • Supports filtering out content useless for LLMs
  • Supports custom User-Agent headers
  • Supports random User-Agent headers
  • Supports custom request headers in HTTP requests
  • Supports full HTTP methods (GET, POST, PUT, DELETE, PATCH)
  • LLMs can access complete HTTP response header information

Installation

git clone https://github.com/coucya/mcp-server-requests.git
cd mcp-server-requests
pip install .

Usage

MCP Server Configuration

{
    "mcpServers": {
        "mcp-server-requests": {
            "command": "python",
            "args": [
                "-m",
                "mcp_server_requests"
            ]
        }
    }
}

Command Line

0. Start MCP Server

Start the MCP server directly:

python -m mcp_server_requests

Options

  • --user-agent TEXT: Specify custom User-Agent string
  • --random-user-agent [browser=xxx;os=xxx]: Use randomly generated User-Agent
  • --force-user-agent: Force using command line specified User-Agent, ignoring LLM provided UA
  • --list-os-and-browser: List available browsers and OS for random User-Agent generation

Option Details

  • --user-agent and --random-user-agent are mutually exclusive and cannot be used together

  • User-Agent setup methods:

    • Custom string: --user-agent "Mozilla/5.0 (...)"
    • Fully random: --random-user-agent
    • Conditional random generation:
      • Specify browser type: --random-user-agent browser=chrome
      • Specify OS: --random-user-agent os=windows
      • Both browser and OS: --random-user-agent browser=chrome;os=windows
      • Note: Browser and OS parameters are case insensitive
  • Use --list-os-and-browser to view available browsers and OS for --random-user-agent.

  • --force-user-agent controls User-Agent priority:

    • When enabled: Prioritize command line specified User-Agent (via --user-agent or --random-user-agent), ignoring LLM provided UA
    • When disabled:
      • If LLM provides User-Agent, use that
      • Otherwise use command line specified User-Agent

1. fetch - Fetch Web Content

The fetch subcommand is equivalent to the fetch tool functionality, demonstrating fetch capabilities.

python -m mcp_server_requests fetch <URL> [--return-content {raw,basic_clean,strict_clean,markdown}]

Options:

  • --return-content: Return content type (default: markdown)
    • raw: Return raw unprocessed HTML content
    • basic_clean: Basic cleanup, removing non-display tags like script, style
    • strict_clean: Strict cleanup, removing non-display tags and most HTML attributes
    • markdown: Convert HTML to clean Markdown format

Example:

python -m mcp_server_requests fetch https://example.com

2. get - Execute HTTP GET Request

The get subcommand is equivalent to the http_get tool functionality, demonstrating http_get capabilities.

python -m mcp_server_requests get <URL> [--headers HEADERS]

Options:

  • --headers: Custom request headers (format: "key1=value1;key2=value2")

3. post - Execute HTTP POST Request

The post subcommand is equivalent to the http_post tool functionality, demonstrating http_post capabilities.

python -m mcp_server_requests post <URL> [--headers HEADERS] [--data TEXT]

Options:

  • --headers: Custom request headers
  • --data: Request body data

4. put - Execute HTTP PUT Request

The put subcommand is equivalent to the http_put tool functionality, demonstrating http_put capabilities.

python -m mcp_server_requests put <URL> [--headers HEADERS] [--data TEXT]

Options: Same as POST method


5. delete - Execute HTTP DELETE Request

The delete subcommand is equivalent to the http_delete tool functionality, demonstrating http_delete capabilities.

python -m mcp_server_requests delete <URL> [--headers HEADERS] [--data TEXT]

Options: Same as POST method


Functionality

Available Tools

  1. fetch - Fetch web content

    • Parameters:
      • url (required): Target URL
      • return_content (optional): Return content type ('raw', 'basic_clean', 'strict_clean', 'markdown')
        • raw: Return raw HTML content
        • basic_clean: Return filtered HTML content, removing non-display tags like script, style
        • strict_clean: Return filtered HTML content, removing non-display tags and most useless HTML attributes
        • markdown: Return HTML converted to Markdown
  2. http_get - Execute HTTP GET request

    • Parameters:
      • url (required): Target URL
      • query (optional): Query parameter key-value pairs
      • headers (optional): Custom request headers
        • LLM may specify User-Agent in headers, whether to use it is controlled by --force-user-agent (same applies to other tools)
  3. http_post - Execute HTTP POST request

    • Parameters:
      • url (required): Target URL
      • query (optional): Query parameter key-value pairs
      • headers (optional): Custom request headers
      • data (optional): Request body data (text)
      • json (optional): Request body data (JSON)
      • data and json cannot be used together
  4. http_put - Execute HTTP PUT request

    • Parameters: Same as http_post
  5. http_patch - Execute HTTP PATCH request

    • Parameters: Same as http_post
  6. http_delete - Execute HTTP DELETE request

    • Parameters: Same as http_post

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