Skip to main content
Glama
MCP Node Fetch

MCP Node Fetch

by mcollina

MCP 节点获取

一个 MCP 服务器,可使用 Node.js undici库来获取 Web 内容。

特征

  • 使用各种 HTTP 方法从任意 URL 获取内容

  • 支持标头和请求正文

  • 以各种格式返回内容(文本、JSON、二进制、HTML 片段)

  • 优雅地处理错误

  • 配置超时和重定向行为

Related MCP server: MCP Server Fetch Python

MCP 工具

该服务器提供以下 MCP 工具:

fetch-url

从 URL 获取内容并返回。

参数:

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

  • method (字符串,可选):HTTP 方法(默认值:“GET”)

  • headers (对象,可选):要包含的 HTTP 标头

  • body (字符串,可选):POST/PUT 请求的请求正文

  • timeout (数字,可选):请求超时(以毫秒为单位)

  • responseType (字符串,可选):如何解析响应(“文本”,“json”,“二进制”,“html片段”)

  • fragmentSelector (字符串,可选):CSS 选择器用于提取特定的 HTML 片段(当 requestType 为“html-fragment”时)

  • followRedirects (布尔值,可选):是否遵循重定向(默认值:true)

extract-html-fragment

使用 CSS 选择器从网页中提取特定的 HTML 内容,并选择性地导航到锚点。

参数:

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

  • selector (字符串,必需):要提取的 HTML 片段的 CSS 选择器

  • anchorId (字符串,可选):用于定位特定片段的可选锚点 ID

  • method (字符串,可选):HTTP 方法(默认值:“GET”)

  • headers (对象,可选):要包含的 HTTP 标头

  • body (字符串,可选):POST 请求的请求正文

  • timeout (数字,可选):请求超时(以毫秒为单位)

  • followRedirects (布尔值,可选):是否遵循重定向(默认值:true)

check-status

检查 URL 是否可以访问而无需下载完整内容。

参数:

  • url (字符串,必需):要检查的 URL

  • timeout (数字,可选):请求超时(以毫秒为单位)

Claude 用于桌面配置

要与 Claude for Desktop 一起使用,请将其添加到您的claude_desktop_config.json中:

{
  "mcpServers": {
    "node-fetch": {
      "command": "node",
      "args": ["dist/index.js"]
    }
  }
}

执照

麻省理工学院

Available Tools

3 tools
check-statusB

Check if a URL is accessible (HEAD request)

Inputs: url (required), timeout.

extract-html-fragmentC

Extract a specific HTML fragment from a webpage using CSS selectors

Inputs: url (required), selector (required), anchorId, method, +5 more.

fetch-urlC

Fetch content from a URL

Inputs: url (required), method, headers, body, +3 more.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.4/5.0

    Scored across 3 tools

    Disambiguation5/5

    Each tool has a clearly distinct purpose: check-status performs a HEAD request to verify accessibility, extract-html-fragment parses HTML content with CSS selectors, and fetch-url retrieves full content. There is no overlap in functionality, making tool selection straightforward for an agent.

    Naming Consistency4/5

    The tools follow a consistent verb-noun pattern (check-status, extract-html-fragment, fetch-url), with all names using kebab-case. The minor deviation is that 'fetch-url' uses a verb-noun structure while the others are verb-adjective-noun, but the pattern remains readable and predictable.

    Tool Count5/5

    With 3 tools, this server is well-scoped for its purpose of URL fetching and HTML processing. Each tool earns its place by covering distinct aspects: status checking, content fetching, and HTML extraction, without being overly sparse or bloated.

    Completeness4/5

    The tool set covers core workflows for URL interaction: checking accessibility, fetching content, and extracting specific data. A minor gap is the lack of tools for more advanced operations like POST requests or handling different content types, but agents can work around this for basic use cases.

    Related MCP Connectors

    Related MCP Servers