Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zcaceres/fetch-mcp
A flexible HTTP fetching Model Context Protocol server.
https://github.com/zcaceres/fetch-mcp
Last synced: 20 days 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 (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-19T23:30:29.000Z (about 1 month ago)
- Last Synced: 2024-12-20T00:26:45.191Z (about 1 month ago)
- Language: TypeScript
- Size: 38.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-mcp-servers - zcaceres/fetch-mcp - JSON、テキスト、HTMLデータを柔軟に取得するためのMCPサーバー (サーバー実装 / 💻 <a name="developer-tools"></a>開発者ツール)
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.