Powerful MCP server for fetching and transforming web content into HTML JSON Markdown or Plain Text
MCP NPX Fetch is a powerful, highly modular MCP server designed to fetch content from web URLs in various formats (HTML, JSON, Markdown, Plain Text) and transform those contents for the specific requirements of AI applications. By leveraging modern JavaScript and TypeScript, this server ensures high performance and flexibility while maintaining a seamless integration with widely used COPA clients such as Claude Desktop. This functionality is achieved by adhering to the Model Context Protocol (MCP), which allows for standardized data exchange between different tools and platforms.
MCP NPX Fetch supports fetching content from URLs in multiple formats, making it versatile enough to cater to a wide range of applications. Whether you need raw HTML, JSON-formatted data, clean plain text without HTML tags, or structured Markdown, this server has got you covered.
To enhance security and customizability, the server allows for the addition of custom headers in HTTP requests through an optional headers
configuration parameter. This feature supports scenarios where authentication is required, such as accessing private APIs or secured web resources.
One of MCP NPX Fetch’s key strengths lies in its ability to automatically convert content between different formats based on the user's request. For instance, it can fetch an HTML page and transform it into well-formatted Markdown with minimal effort. This built-in flexibility is achieved through integration with powerful libraries like JSDOM for parsing HTML and Turndown for converting HTML to Markdown.
MCP NPX Fetch is built using modern JavaScript features, ensuring efficient execution and quick response times. Optimal performance is further enhanced by TypeScript, a superset of JavaScript that provides robust type safety and development utilities.
Seamless integration with leading COPA clients like Claude Desktop ensures that MCP NPX Fetch functions as part of an extended AI application ecosystem. These clients are designed to connect with various tools via standardized protocols like MCP, allowing for fluid data exchange and expanded functionality in AI workflows.
The architecture of MCP NPX Fetch is centered around a modular design that allows easy extension and adaptation to new requirements or standards. Key components include:
The server receives requests from SCP clients or other sources, handles them using appropriate libraries (like Fetch for managing network requests), and forwards the processed data back.
Core functionality is handled by content parsers such as JSDOM, which parses HTML into a structured form, enabling easy manipulation. For conversions like HTML to Markdown, the Turndown library plays a crucial role in ensuring accurate transformations.
The integration with MCP ensures that requests and responses adhere to standardized protocols for data exchange. This involves handling protocol-specific headers, payload structures, and validation rules to ensure compatibility across different clients.
To install MCP NPX Fetch globally, run the following command:
npm install -g @tokenizin/mcp-npx-fetch
Alternatively, you can use npx
directly:
npx @tokenizin/mcp-npx-fetch
In chatbot applications, MCP NPX Fetch simplifies the process of fetching and transforming web content. For example, a bot might need to gather product descriptions from various e-commerce websites and present them as structured text or Markdown-formatted messages in its responses.
Coding assistants can leverage MCP NPX Fetch to fetch relevant code snippets from the web when developing applications. By fetching these snippets in their raw HTML format, they can then transform them into clean, syntax-highlighted text that is more suitable for integration within IDEs or development environments.
To integrate MCP NPX Fetch with Claude Desktop, follow the steps below:
Locate the Configuration File:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%/Claude/claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
Add MCP Server Configuration: Modify the configuration file to include an entry for MCP NPX Fetch:
{
"mcpServers": {
"fetch": {
"command": "npx",
"args": ["-y", "@tokenizin/mcp-npx-fetch"],
"env": {}
}
}
}
The compatibility of MCP NPX Fetch across different COPA clients is summarized in the table below:
MCP Client | Resources | Tools | Prompts | Status |
---|---|---|---|---|
Claude Desktop | ✅ | ✅ | ✅ | Full Support |
Continue | ✅ | ✅ | ❌ | Partially Supported |
Cursor | ❌ | ✅ | ❌ | Tools Only |
To secure your MCP NPX Fetch server, you can set up custom headers or authenticate requests. This is particularly useful when accessing sensitive APIs.
Here’s an example of how to configure environment variables:
{
"mcpServers": {
"fetch": {
"command": "npx",
"args": ["-y", "@tokenizin/mcp-npx-fetch"],
"env": {
"API_KEY": "your_api_key_here"
}
}
}
}
Q: How do I install MCP NPX Fetch?
A: You can install it globally using npm
or via npx
.
Q: Can I integrate this server with other COPA clients besides Claude Desktop? A: Yes, the compatibility matrix lists several COPA clients that can interface with this server.
Q: Is there a way to enhance the security of this server? A: You can add custom headers and set up environment variables for authentication purposes.
Q: What formats does MCP NPX Fetch support for content fetching and transformation? A: It supports HTML, JSON, Markdown, and plain text formats out-of-the-box.
Q: How do I configure the server to work with specific tools or APIs? A: You can customize the configuration file to set environment variables or add custom headers as needed.
git clone https://github.com/your-username/mcp-npx-fetch.git
cd mcp-npx-fetch
npm install
Start a development session with hot-reload for changes in source code via npm run dev
.
Implement the desired features or bug fixes.
Commit your changes: git add .
, git commit -m 'brief description'
.
Push to GitHub: git push origin main
.
Create a Pull Request from your forked repository's master branch.
For more resources and information about the Model Context Protocol and its ecosystem:
Made with ❤️ by PT Tokenizin Technology Agency
graph TD
A[AI Application] -->|MCP Client| B[MCP Protocol]
B --> C[MCP Server]
C --> D[Data Source/Tool]
style A fill:#e1f5fe
style C fill:#f3e5f5
style D fill:#e8f5e8
This diagram illustrates the data flow from an AI application through a COPA client, to an MCP server, and then to a specific data source or tool.
graph TD
subgraph CLI|COPA Clients
C1[Claude Desktop]
C2[Continue]
C3[Cursor]
end
subgraph Servers|MCP NPX Fetch Server
S1[MCP NPX Fetch]
end
C1 --> S1
C2 --> S1
C3 --> S1
style S1 fill:#f5f5f5
This diagram shows the compatibility matrix, highlighting which COPA clients can utilize MCP NPX Fetch.
RuinedFooocus is a local AI image generator and chatbot image server for seamless creative control
Learn to set up MCP Airflow Database server for efficient database interactions and querying airflow data
Simplify MySQL queries with Java-based MysqlMcpServer for easy standard input-output communication
Build stunning one-page websites track engagement create QR codes monetize content easily with Acalytica
Access NASA APIs for space data, images, asteroids, weather, and exoplanets via MCP integration
Explore CoRT MCP server for advanced self-arguing AI with multi-LLM inference and enhanced evaluation methods