by zcaceres
fetch-mcp is a flexible HTTP fetching server designed to retrieve web content in various formats. It acts as a server that can fetch HTML, JSON, Markdown, or plaintext from specified URLs, enabling on-demand fetching and transformation of web content.
fetch-mcp is a flexible HTTP fetching Model Context Protocol (MCP) server designed to retrieve web content in various formats. It acts as a server that can fetch HTML, JSON, Markdown, or plaintext from specified URLs.
To use fetch-mcp, you first need to clone the repository, install dependencies (npm install
), and build the server (npm run build
). You can then run the server directly using npm start
. For integration with a desktop application, you can configure it by adding a JSON snippet to your app's server configuration, specifying the command and arguments to run the dist/index.js
file.
fetch-mcp offers the following key features:
fetch_html
, fetch_json
, fetch_txt
, and fetch_markdown
for targeted content retrieval.fetch-mcp is ideal for scenarios requiring on-demand fetching and transformation of web content. Potential use cases include:
Q: What types of content can fetch-mcp retrieve? A: fetch-mcp can retrieve HTML, JSON, plain text, and Markdown content.
Q: Does fetch-mcp support custom headers for requests? A: Yes, you can include custom headers in your fetch requests.
Q: How does fetch-mcp handle HTML parsing? A: It uses JSDOM for efficient HTML parsing and text extraction.
Q: Can fetch-mcp convert HTML to Markdown? A: Yes, it uses TurndownService to convert HTML content to Markdown format.
Q: Does fetch-mcp store any persistent resources? A: No, fetch-mcp is designed to fetch and transform web content on demand and does not provide any persistent resources.
This MCP server provides functionality to fetch web content in various formats, including HTML, JSON, plain text, and Markdown.
fetch_html
url
(string, required): URL of the website to fetchheaders
(object, optional): Custom headers to include in the requestfetch_json
url
(string, required): URL of the JSON to fetchheaders
(object, optional): Custom headers to include in the requestfetch_txt
url
(string, required): URL of the website to fetchheaders
(object, optional): Custom headers to include in the requestfetch_markdown
url
(string, required): URL of the website to fetchheaders
(object, optional): Custom headers to include in the requestThis server does not provide any persistent resources. It's designed to fetch and transform web content on demand.
npm install
npm run build
To use the server, you can run it directly:
npm start
This will start the Fetch MCP Server running on stdio.
To integrate this server with a desktop app, add the following to your app's server configuration:
{
"mcpServers": {
"fetch": {
"command": "node",
"args": [
"{ABSOLUTE PATH TO FILE HERE}/dist/index.js"
]
}
}
}
npm run dev
to start the TypeScript compiler in watch modenpm test
to run the test suiteThis project is licensed under the MIT License.
Reviews feature coming soon
Stay tuned for community discussions and feedback