fetch-mcp

This repository provides an MCP server to fetch web content in various formats, including HTML, JSON, plain text, and Markdown, enabling easy integration with desktop applications. This repository provides an

307
25

Fetch MCP Server

fetch mcp logo

This MCP server fetches web content in HTML, JSON, plain text, and Markdown formats.

Components

Tools

  • fetch_html: Fetches a website and returns its HTML content. Requires a url (string) and accepts optional headers (object).
  • fetch_json: Fetches a JSON file from a URL. Requires a url (string) and accepts optional headers (object). Returns parsed JSON.
  • fetch_txt: Fetches a website and returns plain text, stripping HTML tags, scripts, and styles. Requires a url (string) and accepts optional headers (object).
  • fetch_markdown: Fetches a website and converts its content to Markdown format. Requires a url (string) and accepts optional headers (object).

Resources

The server fetches and transforms web content on demand without persistent resources.

Getting started

  1. Clone the repository.
  2. Install dependencies: npm install.
  3. Build the server: npm run build.

Usage

Run the server: npm start. This starts the Fetch MCP Server on stdio.

Usage with Desktop App

Integrate with a desktop app using the provided JSON configuration, specifying the path to dist/index.js.

Features

  • Uses the fetch API.
  • Supports custom headers.
  • Provides content in HTML, JSON, plain text, and Markdown.
  • Uses JSDOM for HTML parsing and text extraction.
  • Uses TurndownService for HTML to Markdown conversion.

Development

  • npm run dev: Starts the TypeScript compiler in watch mode.
  • npm test: Runs the test suite.

License

This project is licensed under the MIT License.

Repository

ZC
zcaceres

zcaceres/fetch-mcp

Created

December 18, 2024

Updated

March 28, 2025

Language

TypeScript

Category

Developer Tools