home / mcp / fetch mcp server

Fetch MCP Server

A flexible HTTP fetching Model Context Protocol server.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "zcaceres-fetch-mcp": {
      "command": "npx",
      "args": [
        "mcp-fetch-server"
      ],
      "env": {
        "DEFAULT_LIMIT": "50000"
      }
    }
  }
}

Fetch MCP Server provides on-demand content retrieval by fetching web content in HTML, JSON, plain text, or Markdown formats. It is useful when you need a lightweight, on-the-fly content transformer that you can control from an MCP client or a desktop app.

How to use

You run the Fetch MCP Server as a local process and connect to it from your MCP client or desktop app. The server exposes multiple fetch tools that fetch and convert content on demand. You can fetch raw HTML, parse JSON files, retrieve plain text, or convert HTML content into Markdown. Use the server to obtain content from URLs you specify, with an optional limit on how much data is fetched.

How to install

Prerequisites: you need Node.js and npm installed on your system.

Install dependencies for the Fetch MCP Server.

Build the server.

Start the server.

Configuration and usage notes

{
  "mcpServers": {
    "fetch": {
      "command": "npx",
      "args": [
        "mcp-fetch-server"
      ], 
      "env": {
        "DEFAULT_LIMIT": "50000" // optionally change default limit
      }
    }
  }
}

Notes on environment and startup

The server accepts an environment variable DEFAULT_LIMIT which sets the default fetch size limit (0 means no limit). The example above shows a value of 50000. You can adjust this to suit your needs.

To run the server locally, you can start it via the provided MCP command configuration. The recommended approach is to use an MCP client or desktop app configuration that launches the server with the npx command shown above.

Security and best practices

Limit the URLs you fetch to trusted sources when embedding this server in client applications. Use network-level access controls and keep the server up to date with security patches.

Troubleshooting

If the server fails to start, verify that Node.js and npm are installed, that dependencies can be installed, and that you are using the exact MCP command shown in the usage configuration. Check that DEFAULT_LIMIT is set to a reasonable value and that your environment allows outbound HTTP requests.

Available tools

fetch_html

Fetch a website and return content as HTML. Accepts url, optional headers, max_length, and start_index, returning the raw HTML content.

fetch_json

Fetch a JSON file from a URL. Accepts url, optional headers, max_length, and start_index, returning parsed JSON content.

fetch_txt

Fetch plain text content from a URL, stripping HTML, scripts, and styles, returning plain text.

fetch_markdown

Fetch a website and convert content to Markdown format using HTML-to-Markdown conversion.