MCP NPX Fetch
MCP NPX 获取
强大的 MCP 服务器,可轻松获取 Web 内容并将其转换为各种格式(HTML、JSON、Markdown、纯文本)。
🚀 功能
🌐通用内容获取:支持 HTML、JSON、纯文本和 Markdown 格式
🔒自定义标头支持:向您的请求添加身份验证和自定义标头
🛠内置转换:格式之间的自动转换
⚡高性能:采用现代 JavaScript 功能构建并针对速度进行了优化
🔌 MCP 兼容:与 Claude Desktop 和其他 MCP 客户端无缝集成
🎯类型安全:用 TypeScript 编写,具有完整的类型定义
Related MCP server: webfetch-camouflage
📦安装
NPM 全局安装
npm install -g @tokenizin/mcp-npx-fetch
直接使用 NPX
npx @tokenizin/mcp-npx-fetch📚 文档
可用工具
fetch_html
从任何 URL 获取并返回原始 HTML 内容。
{
url: string; // Required: Target URL
headers?: { // Optional: Custom request headers
[key: string]: string;
};
}fetch_json
从任何 URL 获取并解析 JSON 数据。
{
url: string; // Required: Target URL
headers?: { // Optional: Custom request headers
[key: string]: string;
};
}fetch_txt
获取并返回干净的纯文本内容,删除 HTML 标签和脚本。
{
url: string; // Required: Target URL
headers?: { // Optional: Custom request headers
[key: string]: string;
};
}fetch_markdown
获取内容并将其转换为格式良好的 Markdown。
{
url: string; // Required: Target URL
headers?: { // Optional: Custom request headers
[key: string]: string;
};
}🔧 使用方法
CLI 使用
直接启动 MCP 服务器:
mcp-npx-fetch或者通过 npx:
npx @tokenizin/mcp-npx-fetchClaude 桌面集成
找到您的 Claude Desktop 配置文件:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
将以下配置添加到您的
mcpServers对象:
{
"mcpServers": {
"fetch": {
"command": "npx",
"args": ["-y", "@tokenizin/mcp-npx-fetch"],
"env": {}
}
}
}💻 本地开发
克隆存储库:
git clone https://github.com/tokenizin-agency/mcp-npx-fetch.git
cd mcp-npx-fetch安装依赖项:
npm install启动开发模式:
npm run dev运行测试:
npm test🛠 技术栈
模型上下文协议 SDK - 核心 MCP 功能
JSDOM ——HTML 解析和操作
Turndown - HTML 到 Markdown 的转换
TypeScript - 类型安全和现代 JavaScript 功能
Zod - 运行时类型验证
🤝 贡献
欢迎贡献代码!欢迎提交 Pull 请求。对于重大变更,请先提交一个 issue 来讨论您想要修改的内容。
分叉存储库
创建你的功能分支(
git checkout -b feature/AmazingFeature)提交您的更改(
git commit -m 'Add some AmazingFeature')推送到分支(
git push origin feature/AmazingFeature)打开拉取请求
📄 许可证
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅LICENSE文件。
Available Tools
4 toolsfetch_htmlC
Fetch a website and return the content as HTML
Inputs: url (required), headers.
fetch_jsonC
Fetch a JSON file from a URL
Inputs: url (required), headers.
fetch_markdownC
Fetch a website and return the content as Markdown
Inputs: url (required), headers.
fetch_txtA
Fetch a website, return the content as plain text (no HTML)
Inputs: url (required), headers.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose based on the output format (HTML, JSON, Markdown, plain text), with no overlap in functionality. The descriptions explicitly differentiate them by content type, making tool selection straightforward for an agent.
All tools follow a consistent verb_noun pattern with 'fetch_' prefix and suffix indicating the output format (e.g., fetch_html, fetch_json). The naming is perfectly uniform and predictable across all four tools.
With 4 tools, this server is well-scoped for fetching content in different formats. Each tool earns its place by covering a distinct output type, and the count is neither too thin nor excessive for the domain of URL-based content retrieval.
The toolset covers the core fetching operations for common content types (HTML, JSON, Markdown, plain text), with no dead ends. A minor gap exists in not handling other formats like XML or binary data, but agents can work around this for most use cases.
Maintenance
Related MCP Connectors
Web scraping MCP server: any URL to Markdown or JSON, with JavaScript rendering and batch jobs.
A remote MCP server to convert HTML documents (URL or raw source) to PDF or screenshots
Free remote MCP server for fetching public web pages through a rotating proxy pool.
Web scraping MCP server — scrape, extract structured data, screenshot any site with anti-bot bypass.
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server for fetching and transforming web content into various formats.450 PyPI9MIT
- AlicenseAqualityDmaintenanceMCP server for fetching web content with browser fingerprint camouflage, converting HTML to clean Markdown to bypass bot detection.11MIT
- AlicenseAqualityDmaintenanceA dedicated web content fetching and conversion MCP server that provides tools for fetching, converting, and extracting data from web pages.11MIT
- AlicenseNot gradedqualityCmaintenanceMCP server that fetches remote or local HTML resources and converts them to Markdown, enabling AI clients to summarize or process web content.5 npmMIT