Skip to main content
Glama
Fetch MCP Server

Fetch MCP Server

by zcaceres

获取 MCP 服务器

获取 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 its unmodified contents as HTML

Inputs: url (required), headers, max_length, start_index.

fetch_jsonC

Fetch a JSON file from a URL

Inputs: url (required), headers, max_length, start_index.

fetch_markdownC

Fetch a website and return its contents converted content to Markdown

Inputs: url (required), headers, max_length, start_index.

fetch_txtA

Fetch a website, convert the content to plain text (no HTML)

Inputs: url (required), headers, max_length, start_index.

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 raw HTML, fetch_json retrieves JSON files, fetch_markdown converts to Markdown, and fetch_txt extracts plain text. There is no ambiguity or overlap in functionality, making it easy for an agent to select the correct tool based on the desired output format.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern with 'fetch_' prefix and descriptive suffixes (html, json, markdown, txt). This predictable naming scheme enhances readability and usability, allowing agents to intuitively understand each tool's function without confusion.

    Tool Count5/5

    With 4 tools, the server is well-scoped for its purpose of fetching and converting web content. Each tool earns its place by covering distinct output formats (HTML, JSON, Markdown, plain text), avoiding bloat while providing comprehensive coverage for common web data retrieval needs.

    Completeness5/5

    The tool set provides complete coverage for the domain of fetching web content in various formats. It includes raw HTML, structured JSON, and converted formats (Markdown and plain text), leaving no obvious gaps. Agents can handle a wide range of web data retrieval scenarios without dead ends.

    Maintenance

    ActivityInactive
    ResponsivenessLimited data

    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