https://github.com/zcaceres/fetch-mcp
A flexible HTTP fetching Model Context Protocol server.
https://github.com/zcaceres/fetch-mcp
Last synced: 2 months ago
JSON representation
A flexible HTTP fetching Model Context Protocol server.
- Host: GitHub
- URL: https://github.com/zcaceres/fetch-mcp
- Owner: zcaceres
- Created: 2024-12-18T01:05:17.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2025-01-18T19:22:23.000Z (5 months ago)
- Last Synced: 2025-04-03T03:09:02.341Z (2 months ago)
- Language: TypeScript
- Size: 1020 KB
- Stars: 212
- Watchers: 2
- Forks: 29
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mcp-servers - zcaceres/fetch-mcp - JSON、テキスト、HTMLデータを柔軟に取得するためのMCPサーバー (サーバー実装 / 💻 <a name="developer-tools"></a>開発者ツール)
- awesome-mcp-list - zcaceres/fetch-mcp - mcp?style=social)](https://github.com/zcaceres/fetch-mcp): Fetches JSON, text, and HTML data flexibly from URLs. (Uncategorized / Uncategorized)
- awesome-mcp-zh - zcaceres/fetch-mcp
- awesome-mcp-servers - zcaceres/fetch-mcp - An MCP server to flexibly fetch JSON, text, and HTML data (Legend / 💻 <a name="developer-tools"></a>Developer Tools)
- awesome-mcp-servers - zcaceres/fetch-mcp - An MCP server to flexibly fetch JSON, text, and HTML data (Legend / 💻 <a name="developer-tools"></a>Developer Tools)
- awesome-mcp-servers - FetchMCP - A flexible HTTP fetching Model Context Protocol server. (Table of Contents / Other Tools and Integrations)
- awesome-mcp-servers - FetchMCP - A flexible HTTP fetching Model Context Protocol server. (Table of Contents / Other Tools and Integrations)
README
# Fetch MCP Server

This MCP server provides functionality to fetch web content in various formats, including HTML, JSON, plain text, and Markdown.
## Components
### Tools
- **fetch_html**
- Fetch a website and return the content as HTML
- Input:
- `url` (string, required): URL of the website to fetch
- `headers` (object, optional): Custom headers to include in the request
- Returns the raw HTML content of the webpage- **fetch_json**
- Fetch a JSON file from a URL
- Input:
- `url` (string, required): URL of the JSON to fetch
- `headers` (object, optional): Custom headers to include in the request
- Returns the parsed JSON content- **fetch_txt**
- Fetch a website and return the content as plain text (no HTML)
- Input:
- `url` (string, required): URL of the website to fetch
- `headers` (object, optional): Custom headers to include in the request
- Returns the text content of the webpage with HTML tags, scripts, and styles removed- **fetch_markdown**
- Fetch a website and return the content as Markdown
- Input:
- `url` (string, required): URL of the website to fetch
- `headers` (object, optional): Custom headers to include in the request
- Returns the content of the webpage converted to Markdown format### Resources
This server does not provide any persistent resources. It's designed to fetch and transform web content on demand.
## Getting started
1. Clone the repository
2. Install dependencies: `npm install`
3. Build the server: `npm run build`### Usage
To use the server, you can run it directly:
```bash
npm start
```This will start the Fetch MCP Server running on stdio.
### Usage with Desktop App
To integrate this server with a desktop app, add the following to your app's server configuration:
```json
{
"mcpServers": {
"fetch": {
"command": "node",
"args": [
"{ABSOLUTE PATH TO FILE HERE}/dist/index.js"
]
}
}
}
```## Features
- Fetches web content using modern fetch API
- Supports custom headers for requests
- Provides content in multiple formats: HTML, JSON, plain text, and Markdown
- Uses JSDOM for HTML parsing and text extraction
- Uses TurndownService for HTML to Markdown conversion## Development
- Run `npm run dev` to start the TypeScript compiler in watch mode
- Use `npm test` to run the test suite## License
This project is licensed under the MIT License.