MCP NPX Fetch
一个强大的 MCP 服务器,可以轻松地抓取网页内容并将其转换为各种格式(HTML、JSON、Markdown、纯文本)。
Tools
fetch_html
Fetch a website and return the content as HTML
fetch_markdown
Fetch a website and return the content as Markdown
fetch_txt
Fetch a website, return the content as plain text (no HTML)
fetch_json
Fetch a JSON file from a URL
README
MCP NPX Fetch
<div align="center">
一个强大的 MCP 服务器,可以轻松地获取和转换 Web 内容为各种格式(HTML、JSON、Markdown、纯文本)。
</div>
<a href="https://glama.ai/mcp/servers/m2a0ue08n2"><img width="380" height="200" src="https://glama.ai/mcp/servers/m2a0ue08n2/badge" alt="NPX Fetch MCP server" /></a>
🚀 特性
- 🌐 通用内容获取: 支持 HTML、JSON、纯文本和 Markdown 格式
- 🔒 自定义 Header 支持: 为您的请求添加身份验证和自定义 header
- 🛠 内置转换: 自动在格式之间转换
- ⚡ 高性能: 使用现代 JavaScript 功能构建并针对速度进行了优化
- 🔌 MCP 兼容: 与 Claude Desktop 和其他 MCP 客户端无缝集成
- 🎯 类型安全: 使用 TypeScript 编写,具有完整的类型定义
📦 安装
NPM 全局安装
npm install -g @tokenizin/mcp-npx-fetch
使用 NPX 直接运行
npx @tokenizin/mcp-npx-fetch
📚 文档
可用工具
fetch_html
从任何 URL 获取并返回原始 HTML 内容。
{
url: string; // 必需: 目标 URL
headers?: { // 可选: 自定义请求 header
[key: string]: string;
};
}
fetch_json
从任何 URL 获取并解析 JSON 数据。
{
url: string; // 必需: 目标 URL
headers?: { // 可选: 自定义请求 header
[key: string]: string;
};
}
fetch_txt
获取并返回干净的纯文本内容,删除 HTML 标签和脚本。
{
url: string; // 必需: 目标 URL
headers?: { // 可选: 自定义请求 header
[key: string]: string;
};
}
fetch_markdown
获取内容并将其转换为格式良好的 Markdown。
{
url: string; // 必需: 目标 URL
headers?: { // 可选: 自定义请求 header
[key: string]: string;
};
}
🔧 用法
CLI 用法
直接启动 MCP 服务器:
mcp-npx-fetch
或者通过 npx:
npx @tokenizin/mcp-npx-fetch
Claude Desktop 集成
-
找到您的 Claude Desktop 配置文件:
- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json - Windows:
%APPDATA%/Claude/claude_desktop_config.json - Linux:
~/.config/Claude/claude_desktop_config.json
- macOS:
-
将以下配置添加到您的
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
🛠 技术栈
- Model Context Protocol SDK - 核心 MCP 功能
- JSDOM - HTML 解析和操作
- Turndown - HTML 到 Markdown 转换
- TypeScript - 类型安全和现代 JavaScript 功能
- Zod - 运行时类型验证
🤝 贡献
欢迎贡献!请随时提交 Pull Request。对于重大更改,请先打开一个 issue 讨论您想要更改的内容。
- Fork 仓库
- 创建您的功能分支 (
git checkout -b feature/AmazingFeature) - 提交您的更改 (
git commit -m 'Add some AmazingFeature') - 推送到分支 (
git push origin feature/AmazingFeature) - 打开一个 Pull Request
📄 许可证
该项目根据 MIT 许可证获得许可 - 有关详细信息,请参阅 LICENSE 文件。
<div align="center"> 用 ❤️ 由 <a href="https://github.com/tokenizin-agency">PT Tokenizin Technology Agency</a> 制作 </div>
推荐服务器
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
mcp-server-qdrant
这个仓库展示了如何为向量搜索引擎 Qdrant 创建一个 MCP (Managed Control Plane) 服务器的示例。
mult-fetch-mcp-server
一个多功能的、符合 MCP 规范的网页内容抓取工具,支持多种模式(浏览器/Node)、格式(HTML/JSON/Markdown/文本)和智能代理检测,并提供双语界面(英语/中文)。
AIO-MCP Server
🚀 集成了 AI 搜索、RAG 和多服务(GitLab/Jira/Confluence/YouTube)的一体化 MCP 服务器,旨在增强 AI 驱动的开发工作流程。来自 Folk。
Knowledge Graph Memory Server
为 Claude 实现持久性记忆,使用本地知识图谱,允许 AI 记住用户的信息,并可在自定义位置存储,跨对话保持记忆。
Hyperbrowser
欢迎来到 Hyperbrowser,人工智能的互联网。Hyperbrowser 是下一代平台,旨在增强人工智能代理的能力,并实现轻松、可扩展的浏览器自动化。它专为人工智能开发者打造,消除了本地基础设施和性能瓶颈带来的麻烦,让您能够:
https://github.com/Streen9/react-mcp
react-mcp 与 Claude Desktop 集成,能够根据用户提示创建和修改 React 应用程序。
MCP Atlassian
适用于 Atlassian Cloud 产品(Confluence 和 Jira)的 Model Context Protocol (MCP) 服务器。此集成专为 Atlassian Cloud 实例设计,不支持 Atlassian Server 或 Data Center 部署。
any-chat-completions-mcp
将 Claude 与任何 OpenAI SDK 兼容的聊天完成 API 集成 - OpenAI、Perplexity、Groq、xAI、PyroPrompts 等。