Skip to main content
Glama
mcp-server-requests

mcp-server-requests

by coucya

中国語


mcp-server-requests

HTTP リクエスト機能を提供し、LLM が Web コンテンツを取得して処理できるようにする MCP サーバー。

特徴

  • WebコンテンツをMarkdown形式に変換することをサポート

  • LLMに役立たないコンテンツのフィルタリングをサポート

  • カスタム User-Agent ヘッダーをサポート

  • ランダムなUser-Agentヘッダーをサポート

  • HTTPリクエストのカスタムリクエストヘッダーをサポート

  • 完全な HTTP メソッド (GET、POST、PUT、DELETE、PATCH) をサポート

  • LLMは完全なHTTPレスポンスヘッダー情報にアクセスできる

Related MCP server: cURL MCP Server

インストール

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

使用法

MCP サーバーの構成

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

コマンドライン

0. MCPサーバーを起動する

MCP サーバーを直接起動します。

python -m mcp_server_requests

オプション

  • --user-agent TEXT : カスタム User-Agent 文字列を指定する

  • --random-user-agent [browser=xxx;os=xxx] : ランダムに生成されたユーザーエージェントを使用する

  • --force-user-agent : コマンドラインで指定されたユーザーエージェントを強制的に使用し、LLM が提供する UA を無視します。

  • --list-os-and-browser : ランダムなユーザーエージェント生成に使用できるブラウザと OS を一覧表示します

オプションの詳細

  • --user-agentと--random-user-agentは相互に排他的であり、一緒に使用することはできません。

  • ユーザーエージェントの設定方法:

    • カスタム文字列: --user-agent "Mozilla/5.0 (...)"

    • 完全にランダム: --random-user-agent

    • 条件付きランダム生成:

      • ブラウザの種類を指定: --random-user-agent browser=chrome

      • OS を指定: --random-user-agent os=windows

      • ブラウザと OS の両方: --random-user-agent browser=chrome;os=windows

      • 注: ブラウザとOSのパラメータは大文字と小文字を区別しません

  • --random-user-agentで使用可能なブラウザーと OS を表示するには--list-os-and-browserを使用します。

  • --force-user-agent User-Agent の優先順位を制御します:

    • 有効にすると、コマンドラインで指定された User-Agent ( --user-agentまたは--random-user-agent経由) を優先し、LLM が提供する UA を無視します。

    • 無効にした場合:

      • LLMがUser-Agentを提供している場合はそれを使用する

      • それ以外の場合はコマンドラインで指定されたUser-Agentを使用する


1. fetch - Webコンテンツを取得する

fetch サブコマンドは fetch ツールの機能と同等であり、フェッチ機能を示します。

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

オプション:

  • --return-content : 返されるコンテンツタイプ (デフォルト: markdown)

    • raw : 未処理のHTMLコンテンツを返す

    • basic_clean : 基本的なクリーンアップ、スクリプト、スタイルなどの非表示タグの削除

    • strict_clean : 非表示タグとほとんどの HTML 属性を削除する厳密なクリーンアップ

    • markdown : HTML をきれいな Markdown 形式に変換する

例:

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

2. get - HTTP GETリクエストを実行する

get サブコマンドは http_get ツールの機能と同等であり、http_get 機能を示します。

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

オプション:

  • --headers : カスタムリクエストヘッダー (形式: "key1=value1;key2=value2")


3. post - HTTP POSTリクエストを実行する

post サブコマンドは http_post ツールの機能と同等であり、http_post 機能を示します。

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

オプション:

  • --headers : カスタムリクエストヘッダー

  • --data : リクエストボディデータ


4. put - HTTP PUTリクエストを実行する

put サブコマンドは http_put ツールの機能と同等であり、http_put 機能を示します。

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

オプション: POSTメソッドと同じ


5. delete - HTTP DELETEリクエストを実行する

delete サブコマンドは http_delete ツールの機能と同等であり、http_delete の機能を示します。

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

オプション: POSTメソッドと同じ


機能性

利用可能なツール

  1. fetch - ウェブコンテンツを取得する

    • パラメータ:

      • url (必須): ターゲットURL

      • return_content (オプション): 返されるコンテンツタイプ ('raw'、'basic_clean'、'strict_clean'、'markdown')

        • raw : 生のHTMLコンテンツを返す

        • basic_clean : スクリプトやスタイルなどの非表示タグを削除してフィルタリングされたHTMLコンテンツを返します。

        • strict_clean : 非表示タグとほとんどの不要なHTML属性を削除してフィルタリングされたHTMLコンテンツを返します。

        • markdown : HTMLをMarkdownに変換して返す

  2. http_get - HTTP GETリクエストを実行する

    • パラメータ:

      • url (必須): ターゲットURL

      • クエリ(オプション): クエリパラメータのキーと値のペア

      • ヘッダー(オプション): カスタムリクエストヘッダー

        • LLM はヘッダーに User-Agent を指定する場合があり、それを使用するかどうかは--force-user-agentによって制御されます (他のツールにも同様に適用されます)

  3. http_post - HTTP POSTリクエストを実行する

    • パラメータ:

      • url (必須): ターゲットURL

      • クエリ(オプション): クエリパラメータのキーと値のペア

      • ヘッダー(オプション): カスタムリクエストヘッダー

      • データ(オプション): リクエストボディデータ(テキスト)

      • json (オプション): リクエストボディデータ (JSON)

      • データとJSONは一緒に使用できません

  4. http_put - HTTP PUTリクエストを実行する

    • パラメータ: http_postと同じ

  5. http_patch - HTTP PATCHリクエストを実行する

    • パラメータ: http_postと同じ

  6. http_delete - HTTP DELETEリクエストを実行する

    • パラメータ: http_postと同じ

ライセンス

マサチューセッツ工科大学

Available Tools

3 tools
fetchA

Fetch web page content

Function/Features:

  • Retrieves web page content from any HTTP/HTTPS URL

Args: url (str): The URL to fetch content from. return_content ('raw' | 'basic_clean' | 'strict_clean' | 'markdown', optional): Processing format for HTML content. Defaults to "markdown". - "raw": Returns unmodified HTML content with full response headers - "basic_clean": Removes non-displaying tags (script, style, meta, etc.) while preserving structure - "strict_clean": Removes non-displaying tags and most HTML attributes, keeping only essential structure - "markdown": Converts HTML content to clean, readable Markdown format

Examples: // Returns content as markdown fetch({url: "https://example.com"})

// Returns raw HTML content
fetch({url: "https://api.example.com/data", return_content: "raw"})  

Inputs: url (required), return_content. Returns: result

fetch_to_fileA

Fetch web content and save it to a file in the workspace

Function/Features:

  • Retrieves web content from any HTTP/HTTPS URL and saves it to a file

  • Automatic directory creation for nested file paths

Notes:

  • Automatically creates parent directories if they don't exist

  • Uses UTF-8 encoding for all saved files

  • parameter file_path must be a absolute path

Args: url (str): The URL to fetch content from. file_path (str): File path where the content will be saved. return_content ('raw' | 'basic_clean' | 'strict_clean' | 'markdown'], optional): Processing format for HTML content. Defaults to "markdown". - "raw": Saves unmodified HTML content - "basic_clean": Saves HTML with non-displaying tags removed (script, style, etc.) while preserving structure - "strict_clean": Saves HTML with non-displaying tags and most HTML attributes removed, keeping only essential structure - "markdown": Converts HTML content to clean, readable Markdown format before saving

Examples: // Save web page as markdown fetch_to_file({url: "https://example.com", file_path: "/home/user/content/example.md"})

// Save raw HTML content
fetch_to_file({url: "https://api.example.com/data", file_path: "C:\data\response.html", return_content: "raw"})

// Save cleaned content
fetch_to_file({url: "https://example.com/docs", file_path: "/tmp/docs/cleaned.html", return_content: "strict_clean"})

Inputs: url (required), file_path (required), return_content. Returns: result

http_requestA

Execute an HTTP request with the specified method

Function/Features:

  • Sends HTTP requests using any standard method (GET, POST, PUT, PATCH, DELETE)

  • Allows custom HTTP headers

  • Returns complete HTTP response including status, headers, and body

Notes:

  • 'data' and 'json' parameters are mutually exclusive - use only one

  • When using 'json', the Content-Type header is automatically set to 'application/json'

  • When using 'data', you may need to set appropriate Content-Type header manually

  • Query parameters are URL-encoded automatically and appended to the URL

  • The response includes the full HTTP response with status line, all headers, and body

Args: url (str): Target URL for the HTTP request. method ('GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE'], optional): HTTP method to use. Defaults to "GET". query ({ [string]: string | number }, optional): Query parameters to append to the URL. Values are automatically converted to strings. Example: {'key1': 'value1', 'key2': 2}, becomes "key1=value1&key2=2" appended to the URL. headers ({ [string]: string }, optional): Custom HTTP request headers. data (str, optional): Text data to send in the request body. Cannot be used with 'json'. json (Any JSON, optional): Data to serialize as JSON and send in the request body. Cannot be used with 'data'.

Examples: // GET request (default method) http_request({url: "https://api.example.com/data"})

// GET request with query parameters
http_request({url: "https://api.example.com/search", query: {"q": "test", "limit": 10}})

// POST request with JSON data
http_request({url: "https://api.example.com/users", method: "POST", json: {"name": "John", "age": 30}})

// POST request with raw text data
http_request({url: "https://api.example.com/log", method: "POST", data: "This is a log message"})

// PUT request
http_request({url: "https://api.example.com/users/123", method: "PUT", json: {"name": "John Updated", "age": 31}})

// PATCH request
http_request({url: "https://api.example.com/users/123", method: "PATCH", json: {"age": 31, "email": "new@example.com"}})

// DELETE request
http_request({url: "https://api.example.com/users/123", method: "DELETE"})

// Request with custom headers
http_request({url: "https://api.example.com/secure", method: "POST", headers: {"Authorization": "Bearer token"}, json: {"key": "value"}})

Inputs: url (required), method (required), query (required), headers (required), +2 more. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    The three tools have clearly distinct purposes with no overlap. 'fetch' retrieves web content for immediate use, 'fetch_to_file' saves web content to a file, and 'http_request' handles general HTTP requests with full control over methods and parameters. Each tool serves a unique function in the web request workflow.

    Naming Consistency5/5

    All tools follow a consistent snake_case naming pattern with clear verb-action structure. 'fetch', 'fetch_to_file', and 'http_request' all use descriptive verbs that accurately reflect their functionality, maintaining excellent naming consistency throughout the toolset.

    Tool Count4/5

    Three tools is reasonable for a web requests server, though slightly minimal. The tools cover the core use cases well, but the count feels slightly lean for a server that could potentially benefit from additional specialized tools like websocket handling or streaming responses.

    Completeness5/5

    The toolset provides comprehensive coverage for web request operations. It includes content fetching with processing options, file-based fetching, and a full-featured HTTP client supporting all major methods, headers, and data formats. No obvious gaps exist for a general-purpose web requests server.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      C
      quality
      F
      maintenance
      Enables LLMs to retrieve and process web content by fetching URLs and converting HTML to markdown, with support for chunked reading and customizable user-agents.
      1
      MIT
    • A
      license
      A
      quality
      B
      maintenance
      Enables LLMs to make HTTP requests using structured cURL commands with support for multiple authentication methods, custom headers, and comprehensive request/response control.
      2
      8 npm
      4
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Enables LLMs to fetch and extract web content using browser automation, OCR, and multiple extraction methods, handling JavaScript rendering and anti-scraping techniques.
      17
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables LLMs to make HTTP requests with OAuth2, session cookies, retry logic, and cURL command generation, while providing security features like SSRF protection and TLS enforcement.
      1
      MIT