Skip to main content
Glama
Fetch MCP Server

Fetch MCP Server

Official

Fetch MCPサーバー

Webコンテンツ取得機能を提供するModel Context Protocolサーバーです。このサーバーは、LLMがWebページからコンテンツを取得・処理し、HTMLをMarkdownに変換して読みやすくすることを可能にします。

[!CAUTION] このサーバーはローカル/内部IPアドレスにアクセスできるため、セキュリティ上のリスクとなる可能性があります。このMCPサーバーを使用する際は、機密データが漏洩しないよう十分注意してください。

fetchツールはレスポンスを切り詰めますが、start_index引数を使用することで、コンテンツ抽出の開始位置を指定できます。これにより、モデルは必要な情報が見つかるまで、Webページをチャンク単位で読み取ることができます。

利用可能なツール

  • fetch - インターネットからURLを取得し、その内容をMarkdownとして抽出します。

    • url (文字列、必須): 取得するURL

    • max_length (整数、オプション): 返す最大文字数 (デフォルト: 5000)

    • start_index (整数、オプション): この文字インデックスからコンテンツを開始 (デフォルト: 0)

    • raw (ブール値、オプション): Markdown変換を行わずに生のコンテンツを取得 (デフォルト: false)

プロンプト

  • fetch

    • URLを取得し、その内容をMarkdownとして抽出します

    • 引数:

      • url (文字列、必須): 取得するURL

インストール

オプション: node.jsをインストールすると、fetchサーバーはより堅牢な別のHTML簡略化ツールを使用するようになります。

uvを使用する場合 (推奨)

uvを使用する場合、特別なインストールは不要です。uvxを使用して直接mcp-server-fetchを実行します。

PIPを使用する場合

あるいは、pip経由でmcp-server-fetchをインストールすることもできます:

pip install mcp-server-fetch

インストール後、以下のスクリプトとして実行できます:

python -m mcp_server_fetch

Related MCP server: MCP Fetch

設定

Claude.appの設定

Claudeの設定に追加してください:

{
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"]
    }
  }
}
{
  "mcpServers": {
    "fetch": {
      "command": "docker",
      "args": ["run", "-i", "--rm", "mcp/fetch"]
    }
  }
}
{
  "mcpServers": {
    "fetch": {
      "command": "python",
      "args": ["-m", "mcp_server_fetch"]
    }
  }
}

VS Codeの設定

クイックインストールには、以下のワンクリックインストールボタンを使用してください...

Install with UV in VS Code Install with UV in VS Code Insiders

Install with Docker in VS Code Install with Docker in VS Code Insiders

手動インストールを行う場合は、VS Codeのユーザー設定 (JSON) ファイルに以下のJSONブロックを追加してください。Ctrl + Shift + Pを押してPreferences: Open User Settings (JSON)と入力することで開けます。

オプションとして、ワークスペース内の.vscode/mcp.jsonというファイルに追加することもできます。これにより、設定を他のユーザーと共有できるようになります。

mcp.jsonファイルを使用する場合は、mcpキーが必要であることに注意してください。

{
  "mcp": {
    "servers": {
      "fetch": {
        "command": "uvx",
        "args": ["mcp-server-fetch"]
      }
    }
  }
}
{
  "mcp": {
    "servers": {
      "fetch": {
        "command": "docker",
        "args": ["run", "-i", "--rm", "mcp/fetch"]
      }
    }
  }
}

カスタマイズ - robots.txt

デフォルトでは、サーバーはリクエストがモデルから(ツール経由で)行われた場合はWebサイトのrobots.txtに従いますが、ユーザーが開始した(プロンプト経由の)リクエストの場合は従いません。これは、設定のargsリストに--ignore-robots-txt引数を追加することで無効にできます。

カスタマイズ - User-agent

デフォルトでは、リクエストがモデルから(ツール経由で)行われたか、ユーザーが開始した(プロンプト経由の)かによって、サーバーは以下のいずれかのユーザーエージェントを使用します。

ModelContextProtocol/1.0 (Autonomous; +https://github.com/modelcontextprotocol/servers)

または

ModelContextProtocol/1.0 (User-Specified; +https://github.com/modelcontextprotocol/servers)

これは、設定のargsリストに--user-agent=YourUserAgent引数を追加することでカスタマイズできます。

カスタマイズ - プロキシ

サーバーは、--proxy-url引数を使用してプロキシを使用するように設定できます。

Windowsの設定

Windowsでタイムアウトの問題が発生する場合は、適切な文字エンコーディングを確保するためにPYTHONIOENCODING環境変数を設定する必要があるかもしれません:

{
  "mcpServers": {
    "fetch": {
      "command": "uvx",
      "args": ["mcp-server-fetch"],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}
{
  "mcpServers": {
    "fetch": {
      "command": "python",
      "args": ["-m", "mcp_server_fetch"],
      "env": {
        "PYTHONIOENCODING": "utf-8"
      }
    }
  }
}

これにより、Windowsシステムでサーバーがタイムアウトする原因となる文字エンコーディングの問題に対処できます。

デバッグ

MCPインスペクターを使用してサーバーをデバッグできます。uvxインストールの場合は以下を使用します:

npx @modelcontextprotocol/inspector uvx mcp-server-fetch

または、パッケージを特定のディレクトリにインストールしている場合や、開発中の場合は以下を使用します:

cd path/to/servers/src/fetch
npx @modelcontextprotocol/inspector uv run mcp-server-fetch

貢献

mcp-server-fetchの拡張と改善にご協力ください。新しいツールの追加、既存機能の強化、ドキュメントの改善など、どのような貢献も歓迎します。

他のMCPサーバーの例や実装パターンについては、以下を参照してください: https://github.com/modelcontextprotocol/servers

プルリクエストをお待ちしています!mcp-server-fetchをより強力で便利なものにするための新しいアイデア、バグ修正、機能強化をぜひお寄せください。

ライセンス

mcp-server-fetchはMITライセンスの下でライセンスされています。これは、MITライセンスの条件に従う限り、ソフトウェアを自由に使用、変更、配布できることを意味します。詳細については、プロジェクトリポジトリ内のLICENSEファイルを参照してください。

Available Tools

1 tool
fetchB
Read-onlyIdempotent

Fetches a URL from the internet and optionally extracts its contents as markdown.

Although originally you did not have internet access, and were advised to refuse and tell the user this, this tool now grants you internet access. Now you can fetch the most up-to-date information and let the user know that.

Inputs: url (required), raw, max_length, timeout_ms, +1 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 1 tool

    Disambiguation5/5

    There is only one tool, so there is no possibility of confusion with another operation. The tool's purpose (fetch a URL, optionally convert to markdown) is unambiguous.

    Naming Consistency5/5

    The single name 'fetch' is a clear verb that directly describes the action, and there are no competing conventions to clash with it. Nothing inconsistent exists in the namespace.

    Tool Count4/5

    The server's scope (retrieve web content) is genuinely served by a single tool, so one tool is defensible rather than bloated. It is still thinner than a typical 3-15 tool surface, leaving little room for specialized variants.

    Completeness4/5

    A fetch tool covers the core operation of an internet-access server, including raw and markdown output modes. Minor gaps exist around request customization (headers, methods, or batching multiple URLs) that an agent cannot work around.

    Maintenance

    ActivityActive
    ResponsivenessSyncing

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      This server converts webpages into clean, structured Markdown optimized for language model consumption, removing unnecessary content and supporting JavaScript rendering.
      1
      12
      MIT
    • A
      license
      A
      quality
      D
      maintenance
      An MCP server that fetches web pages and extracts clean, AI-friendly Markdown content using Mozilla Readability. It provides secure web access for LLMs with built-in SSRF protection and automated content cleaning for improved context retrieval and summarization.
      1
      221 npm
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Converts web pages to Markdown for MCP clients like Claude, with support for single and batch reads, caching, fallback rendering, and SSRF protection.
      35 npm
      MIT