Skip to main content
Glama
ruandwrd

Web Fetch MCP Server

by ruandwrd

Web Fetch MCP Server

A Model Context Protocol (MCP) server that enables LLMs to fetch and process web page contents. This server provides tools for retrieving raw HTML, extracting clean text, and converting web pages to markdown format.

Features

  • fetch_webpage: Retrieves raw HTML content from any URL

  • fetch_webpage_text: Extracts clean text content without HTML tags

  • fetch_webpage_markdown: Converts web pages to markdown format

Related MCP server: Fetch MCP Server

Installation

  1. Install dependencies:

npm install
  1. Build the project:

npm run build

Usage with LM Studio

To use this MCP server with LM Studio, you need to configure it in your MCP settings.

Configuration

Add the following to your LM Studio MCP configuration file (typically located at ~/.lmstudio/mcp-settings.json or similar):

{
  "mcpServers": {
    "web-fetch": {
      "command": "node",
      "args": ["D:\\Projects\\web search mcp\\dist\\index.js"]
    }
  }
}

Adjust the path to match your actual installation directory.

Alternative: Global Installation

You can also install the server globally or use npx:

npm install -g .

Then configure LM Studio to use:

{
  "mcpServers": {
    "web-fetch": {
      "command": "web-fetch-mcp"
    }
  }
}

Available Tools

1. fetch_webpage

Fetches the raw HTML content of a webpage.

Input:

  • url (string, required): The URL of the webpage to fetch

Example:

{
  "url": "https://example.com"
}

2. fetch_webpage_text

Fetches a webpage and extracts clean text content without HTML tags, scripts, or styles.

Input:

  • url (string, required): The URL of the webpage to fetch

Example:

{
  "url": "https://example.com"
}

3. fetch_webpage_markdown

Fetches a webpage and converts it to markdown format, preserving structure like headings, links, and lists.

Input:

  • url (string, required): The URL of the webpage to fetch

Example:

{
  "url": "https://example.com"
}

Development

Build

npm run build

Watch mode (auto-rebuild on changes)

npm run dev

Run directly

npm start

Technical Details

  • Protocol: Model Context Protocol (MCP) via stdio transport

  • HTTP Client: Axios with 30-second timeout and automatic redirect handling

  • HTML Parsing: Cheerio for efficient HTML parsing

  • Markdown Conversion: Turndown for high-quality HTML to Markdown conversion

  • User Agent: Mimics modern browser to avoid bot detection

Error Handling

The server includes comprehensive error handling for:

  • Network failures

  • Invalid URLs

  • Timeout errors

  • HTTP errors (404, 500, etc.)

Errors are returned in a structured format with descriptive messages.

Security Notes

  • The server fetches content from any URL provided

  • Be cautious when fetching content from untrusted sources

  • Consider implementing URL allowlists for production use

  • The server respects redirects (max 5)

License

MIT

Available Tools

3 tools
fetch_webpageA

Fetches the raw HTML content of a webpage from the given URL

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the webpage to fetch

TDQS

A3.5/5.0
Behavior2/5

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

No annotations are provided, so the description bears full responsibility for behavioral disclosure. It merely states the basic function and does not mention potential side effects, redirects, timeouts, response format details, or error behavior. For a network operation, this lack of context is a significant gap.

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?

A single, front-loaded sentence with no wasted words. It immediately identifies the action and the object, making it highly scannable.

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?

For a simple one-parameter tool, the description is adequate but not complete. It does not describe return values (though 'raw HTML content' implies them), error conditions, or how this tool compares to the sibling tools. The presence of siblings and lack of an output schema mean additional context would improve completeness.

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 baseline is 3. The description adds the meaning that the result is raw HTML, which is somewhat beyond the schema's simple 'URL of the webpage', but it does not provide extra detail about location constraints or formatting of the URL parameter.

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

Purpose5/5

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

The description clearly states the action ('Fetches'), the resource ('raw HTML content of a webpage'), and the source ('from the given URL'). The phrase 'raw HTML' explicitly distinguishes this tool from siblings fetch_webpage_text and fetch_webpage_markdown, making the purpose unambiguous.

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

Usage Guidelines3/5

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

The description implies usage for situations needing raw HTML, as opposed to text or markdown, but it does not explicitly mention alternatives or provide exclusion criteria. Since sibling tools exist, this is a missed opportunity to guide selection.

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

fetch_webpage_markdownA

Fetches a webpage and converts it to markdown format

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the webpage to fetch

TDQS

A3.7/5.0
Behavior3/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. It discloses that the tool converts the fetched webpage to markdown, which is a key transformation, and implies a read-only operation. However, it does not mention error behavior, return format details, or any edge-case limitations, leaving some transparency gaps.

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 clear sentence with no filler. It is front-loaded with the primary action and can be understood at a glance.

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?

The tool is simple with one parameter and no output schema. The description explains the core function but omits usage guidance and return value specifics. While adequate for a minimal tool, the lack of annotations and explicit alternative references makes it only partially complete.

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 full coverage for the 'url' parameter with a clear description. The tool description does not add additional parameter-level meaning beyond what the schema already provides, so the baseline score of 3 is appropriate.

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

Purpose5/5

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

The description clearly states the tool fetches a webpage and converts it to markdown, using a specific verb and resource. This distinguishes it from sibling tools fetch_webpage and fetch_webpage_text, which likely return raw HTML and plain text respectively.

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

Usage Guidelines3/5

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

The description implies the tool should be used when the user needs a webpage in markdown format, but it does not explicitly mention alternatives or when not to use it. Sibling tools exist but are not referenced, leaving the agent to infer the choice based on the tool name.

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

fetch_webpage_textA

Fetches a webpage and extracts clean text content without HTML tags

ParametersJSON Schema
NameRequiredDescriptionDefault
urlYesThe URL of the webpage to fetch

TDQS

A3.5/5.0
Behavior2/5

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

With no annotations provided, the description carries the full burden of behavioral disclosure. It discloses that HTML tags are removed, but omits other important behaviors such as error handling, redirects, content limits, or network requirements, leaving significant gaps for a network-fetching tool.

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, concise sentence that immediately conveys the core function without any wasted words. It is well-structured and front-loaded.

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?

The description adequately covers the primary function and output for a simple one-parameter tool. However, without an output schema or annotations, and with sibling tools present but not differentiated, it lacks context about failure modes and decision criteria, making it only minimally complete.

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 coverage is 100% for the single 'url' parameter, which is fully described in the schema. The description adds no additional parameter semantics beyond what the schema already provides, so baseline 3 applies.

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

Purpose5/5

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

The description clearly identifies the tool's function: fetching a webpage and extracting clean text. It differentiates from siblings by specifying 'without HTML tags', which distinguishes it from raw HTML or markdown formats.

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

Usage Guidelines3/5

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

The description implies use for obtaining clean text content but does not explicitly state when to use this tool over siblings like fetch_webpage or fetch_webpage_markdown. No exclusions or alternative guidance is provided.

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 updatesv1.0.0
    • First observedfetch_webpage
    • First observedfetch_webpage_markdown
    • First observedfetch_webpage_text

TDQS

A4/5.0

Scored across 3 tools

Disambiguation5/5

Each tool targets a distinct output format (raw HTML, plain text, markdown), so there is no ambiguity about which tool to use. The descriptions clearly differentiate the three fetch modes.

Naming Consistency5/5

All tools follow a consistent pattern: fetch_webpage for raw HTML, fetch_webpage_text for text, and fetch_webpage_markdown for markdown. The suffix clearly indicates the output format, making the naming predictable.

Tool Count5/5

Three tools is well-scoped for a web fetching server, covering the three most common content formats without unnecessary redundancy. This is within the ideal range for a focused utility.

Completeness5/5

For the stated purpose of fetching webpages, the server covers raw HTML, clean text, and markdown, which are the primary output formats needed. There are no obvious missing operations for basic web content retrieval.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • A
    license
    B
    quality
    D
    maintenance
    Enables LLMs to retrieve and process web content by fetching URLs and converting HTML to markdown format. Supports chunked reading of large pages and can access both public websites and local networks.
    1
    MIT
  • A
    license
    C
    quality
    D
    maintenance
    Enables LLMs to retrieve and process web content by fetching URLs and converting HTML to markdown, with support for chunked reading and customizable user-agents.
    1
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables LLMs to fetch and process web content by converting HTML into markdown for easier consumption. It supports chunked reading via pagination and provides configuration options for robots.txt compliance and proxy usage.
    1
    MIT