Labsco
coucya logo

HTTP Requests

β˜… 7

from coucya

An MCP server for making HTTP requests, enabling LLMs to fetch and process web content.

πŸ”₯πŸ”₯πŸ”₯βœ“ VerifiedFreeQuick setup

δΈ­ζ–‡


mcp-server-requests

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

Features

  • fetch: Web content fetching tool
    • Supports converting web content to Markdown format
    • Supports filtering web content (non-visual elements like script, style, meta)
    • Feeds into LLM context, reducing token consumption through Markdown conversion or filtering non-visual elements
  • fetch_to_file: Web content saving tool
    • Web content is not fed into LLM context, avoiding excessive token consumption
  • http_request: Generic HTTP request tool
    • Full HTTP method support (GET, POST, PUT, PATCH, DELETE)
    • Supports custom request headers
    • Supports text and JSON request bodies
    • Returns complete HTTP response information (status, headers, body) for LLMs
  • Supports custom User-Agent
  • Supports random User-Agent generation
  • Supports using MCP Root capability, controlled by --use-root, usable with MCP Clients that have root capability

Functionality

MCP Tool Details

1. fetch - Fetch Web Content

Fetch content from the specified URL and return it in the specified format.

Parameters:

  • url (required, string): Target URL, supports HTTP/HTTPS protocols
  • return_content (optional, enum): Content processing format, defaults to "markdown"
    • "raw": Return raw HTML content with complete HTTP response headers
    • "basic_clean": Basic cleanup, removing non-display tags (script, style, meta, etc.) while preserving HTML structure
    • "strict_clean": Strict cleanup, removing non-display tags and most HTML attributes, keeping only essential structure
    • "markdown": Convert HTML content to clean Markdown format

Returns: Content processed according to the specified format


2. fetch_to_file - Fetch Web Content and Save to File

Fetch content from the specified URL and save it to a file.

Parameters:

  • url (required, string): Target URL
  • file_path (required, string): File save path
    • When --use-root is enabled: Must be a relative path (relative to workspace root)
    • When --use-root is disabled: Must be an absolute path
  • return_content (optional, enum): Content processing format, defaults to "markdown", same options as fetch tool

Features:

  • Automatically creates parent directories for nested paths
  • All files saved with UTF-8 encoding
  • When --use-root is enabled, can work with --allow-external-file-access to control file access scope

Returns: Operation result or error message


3. http_request - Generic HTTP Request Tool

Send HTTP requests using any method and get complete responses.

Parameters:

  • url (required, string): Target URL
  • method (optional, enum): HTTP method, defaults to "GET"
    • "GET", "POST", "PUT", "PATCH", "DELETE"
  • query (optional, object): URL query parameters as key-value pairs, automatically URL-encoded
  • headers (optional, object): Custom HTTP request headers
  • data (optional, string): Text format request body data, mutually exclusive with json parameter
  • json (optional, any type): JSON format request body data, mutually exclusive with data parameter

Parameter Constraints:

  • data and json parameters cannot be used together
  • When using json parameter, Content-Type: application/json is automatically set
  • When using data parameter, it's recommended to manually set appropriate Content-Type

Returns: Complete HTTP response (status line, response headers, and response body)


Note: Individual HTTP method tools (http_get, http_post, http_put, http_patch, http_delete) have been removed and replaced by the unified http_request tool.