Skip to main content
Glama
Fetch MCP Server

Fetch MCP Server

by tokenizin

获取 MCP 服务器

该 MCP 服务器提供获取各种格式的 Web 内容的功能,包括 HTML、JSON、纯文本和 Markdown。

成分

工具

  • fetch_html

    • 获取网站并以 HTML 格式返回内容

    • 输入:

      • url (字符串,必需):要获取的网站的 URL

      • headers (对象,可选):包含在请求中的自定义标头

    • 返回网页的原始 HTML 内容

  • fetch_json

    • 从 URL 获取 JSON 文件

    • 输入:

      • url (字符串,必需):要获取的 JSON 的 URL

      • headers (对象,可选):包含在请求中的自定义标头

    • 返回解析后的 JSON 内容

  • 获取文本

    • 获取网站并以纯文本形式返回内容(无 HTML)

    • 输入:

      • url (字符串,必需):要获取的网站的 URL

      • headers (对象,可选):包含在请求中的自定义标头

    • 返回删除了 HTML 标签、脚本和样式的网页文本内容

  • fetch_markdown

    • 获取网站并以 Markdown 格式返回内容

    • 输入:

      • url (字符串,必需):要获取的网站的 URL

      • headers (对象,可选):包含在请求中的自定义标头

    • 返回转换为Markdown格式的网页内容

资源

此服务器不提供任何持久性资源。其设计旨在按需获取和转换 Web 内容。

Related MCP server: Fetch MCP Server

入门

  1. 克隆存储库

  2. 安装依赖项: npm install

  3. 构建服务器: npm run build

用法

要使用服务器,您可以直接运行它:

npm start

这将启动在 stdio 上运行的 Fetch MCP 服务器。

与桌面应用程序一起使用

要将此服务器与桌面应用程序集成,请将以下内容添加到应用程序的服务器配置中:

{
  "mcpServers": {
    "fetch": {
      "command": "node",
      "args": [
        "{ABSOLUTE PATH TO FILE HERE}/dist/index.js"
      ]
    }
  }
}

特征

  • 使用现代 fetch API 获取网页内容

  • 支持自定义请求头

  • 提供多种格式的内容:HTML、JSON、纯文本和Markdown

  • 使用 JSDOM 进行 HTML 解析和文本提取

  • 使用 TurndownService 将 HTML 转换为 Markdown

发展

  • 运行npm run dev以监视模式启动 TypeScript 编译器

  • 使用npm test运行测试套件

执照

该项目已获得 MIT 许可。

Available Tools

4 tools
fetch_htmlC

Fetch a website and return the content as HTML

Inputs: url (required), headers.

fetch_jsonC

Fetch a JSON file from a URL

Inputs: url (required), headers.

fetch_markdownC

Fetch a website and return the content as Markdown

Inputs: url (required), headers.

fetch_txtA

Fetch a website, return the content as plain text (no HTML)

Inputs: url (required), headers.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 4 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: fetch_html returns HTML, fetch_json fetches JSON files, fetch_markdown converts to Markdown, and fetch_txt provides plain text. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with 'fetch_' as the prefix, followed by the content type (html, json, markdown, txt). This predictable naming scheme enhances readability and usability.

    Tool Count5/5

    With 4 tools, the server is well-scoped for fetching different content types from URLs. Each tool earns its place by covering a specific format, avoiding bloat while providing comprehensive coverage for the domain.

    Completeness5/5

    The tool set offers complete coverage for fetching content in various formats (HTML, JSON, Markdown, plain text), with no obvious gaps. Agents can handle a wide range of fetching tasks without encountering dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      D
      maintenance
      Provides functionality to fetch web content in various formats, including HTML, JSON, plain text, and Markdown with support for custom headers.
      4
      3
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      Provides functionality to fetch and transform web content in various formats (HTML, JSON, plain text, and Markdown) through simple API calls.
      117,041 npm
      1
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables fetching and converting web content into various formats including HTML, JSON, plain text, and Markdown. It supports custom request headers and provides specialized tools for on-demand web data retrieval and transformation.
      MIT