Skip to main content
Glama
mcollina

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)

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesURL to check
timeoutNoRequest timeout in milliseconds

TDQS

B3.1/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. It states the tool performs a HEAD request to check URL accessibility, which implies a read-only, non-destructive operation. However, it lacks details on error handling, response formats, rate limits, or authentication needs, which are important for an agent to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise and front-loaded, consisting of a single, clear sentence: 'Check if a URL is accessible (HEAD request)'. Every word earns its place by specifying the action, resource, and method without any unnecessary details or redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's low complexity (2 parameters, no output schema, no annotations), the description is minimally adequate. It covers the basic purpose and method but lacks context on when to use it, behavioral traits, or output details. For a simple tool, this might suffice, but it leaves gaps in usage and behavior that could hinder an agent's effectiveness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% description coverage, with clear documentation for 'url' and 'timeout' parameters. The description adds no additional semantic details beyond what the schema provides, such as URL format requirements or timeout implications. With high schema coverage, the baseline score of 3 is appropriate as the schema does the heavy lifting.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose: 'Check if a URL is accessible (HEAD request)'. It specifies the action ('Check'), resource ('URL'), and method ('HEAD request'), making it easy to understand what the tool does. However, it doesn't explicitly differentiate from sibling tools like 'fetch-url' or 'extract-html-fragment', which might also involve URL operations.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools or contexts where this tool is preferred, such as for quick accessibility checks without downloading content, leaving the agent to infer usage based on the name and description alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

extract-html-fragmentC

Extract a specific HTML fragment from a webpage using CSS selectors

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesURL to fetch
selectorYesCSS selector for the HTML fragment to extract
anchorIdNoOptional anchor ID to locate a specific fragment
methodNoHTTP methodGET
headersNoHTTP headers
bodyNoRequest body for POST requests
timeoutNoRequest timeout in milliseconds
followRedirectsNoWhether to follow redirects
fragmentSelectorNoCSS selector for the HTML fragment to extract (when responseType is html-fragment)

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. While 'extract' implies a read operation, it doesn't address important behaviors like error handling, rate limits, authentication needs, or what happens when selectors don't match. The description mentions CSS selectors but doesn't explain the extraction mechanism or output format.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that gets straight to the point with zero wasted words. It's appropriately sized for the tool's complexity and front-loads the core functionality without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a tool with 9 parameters, no annotations, and no output schema, the description is inadequate. It doesn't explain what the tool returns, how errors are handled, or provide context about the extraction process. The agent would need to guess about the output format and error conditions when using this tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, so the schema already documents all 9 parameters thoroughly. The description adds minimal value beyond what's in the schema - it mentions CSS selectors (which appears twice in the schema) but doesn't provide additional context about parameter interactions or usage patterns.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's purpose as extracting HTML fragments from webpages using CSS selectors, which is a specific verb+resource combination. However, it doesn't distinguish this tool from its sibling tools (check-status and fetch-url), which likely have different functions but could overlap in webpage interaction scenarios.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives like fetch-url or check-status. It doesn't mention prerequisites, limitations, or typical use cases, leaving the agent to infer usage context from the tool name and parameters alone.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

fetch-urlC

Fetch content from a URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesURL to fetch
methodNoHTTP methodGET
headersNoHTTP headers
bodyNoRequest body for POST/PUT/PATCH requests
timeoutNoRequest timeout in milliseconds
responseTypeNoHow to parse the responsetext
followRedirectsNoWhether to follow redirects

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Fetch content from a URL' implies a read operation, but it lacks details on error handling (e.g., timeouts, network failures), authentication needs, rate limits, or what 'content' entails (e.g., raw response, parsed data). For a tool with 7 parameters and no annotations, this is a significant gap in transparency.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence that front-loads the core purpose without unnecessary words. It avoids redundancy and wastes no space, making it easy for an AI agent to parse quickly. Every word earns its place by directly conveying the tool's function.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (7 parameters, no annotations, no output schema), the description is incomplete. It doesn't address behavioral aspects like error handling or response format, and with no output schema, it fails to explain what 'content' means in the return value. For a general-purpose HTTP client tool, more context is needed to guide effective usage.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100%, meaning all parameters are documented in the schema itself. The description adds no additional meaning beyond the schema, such as explaining parameter interactions (e.g., 'body' is only relevant for certain 'method' values) or usage tips. With high schema coverage, the baseline score of 3 is appropriate, as the description doesn't compensate but also doesn't detract.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description 'Fetch content from a URL' clearly states the verb ('fetch') and resource ('content from a URL'), making the purpose immediately understandable. It distinguishes from sibling tools like 'check-status' (which likely checks status without fetching content) and 'extract-html-fragment' (which processes HTML rather than fetching raw content). However, it doesn't specify the exact scope (e.g., HTTP/HTTPS only) or resource type (e.g., web pages, APIs), keeping it from a perfect score.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides no guidance on when to use this tool versus alternatives. It doesn't mention sibling tools like 'check-status' or 'extract-html-fragment', nor does it specify contexts such as fetching web pages versus API calls. Without this, an AI agent might struggle to choose between this tool and its siblings in appropriate scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updates
    • First observedcheck-status
    • First observedextract-html-fragment
    • First observedfetch-url

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.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers