网页内容抓取工具

一个强大的MCP服务器,用于轻松抓取和转换网页内容为多种格式(HTML、JSON、Markdown、纯文本)。

  • by tokenizin-agency
  • TypeScript
  • 本地部署
  • 43 星标
  • 更新于
在 GitHub 查看 tokenizin-agency/mcp-npx-fetch

使用说明

MCP NPX获取

一个强大的MCP服务器,用于轻松获取和转换web内容为各种格式(HTML、JSON、Markdown、纯文本)。

安装 • 特性 • 用法 • 文档 • 贡献


🚀 特性

  • 🌐 通用内容获取:支持HTML、JSON、纯文本和Markdown格式
  • 🔒 自定义标头支持:在请求中添加身份验证和自定义标头
  • 🛠 内置转换:格式之间的自动转换
  • ⚡ 高性能:采用现代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;     // 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-fetch

Claude桌面集成

  1. 找到您的Claude Desktop配置文件:

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
    • 窗户: %APPDATA%/Claude/claude_desktop_config.json
    • Linux: ~/.config/Claude/claude_desktop_config.json
  2. 将以下配置添加到您的 mcpServers 对象:

{
  "mcpServers": {
    "fetch": {
      "command": "npx",
      "args": ["-y", "@tokenizin/mcp-npx-fetch"],
      "env": {}
    }
  }
}

💻 地方发展

  1. 克隆存储库:
git clone https://github.com/tokenizin-agency/mcp-npx-fetch.git
cd mcp-npx-fetch
  1. 安装依赖项:
npm install
  1. 启动开发模式:
npm run dev
  1. 运行测试:
npm test

🛠 技术栈

🤝 贡献

欢迎投稿!请随时提交拉取请求。对于重大更改,请先打开一个问题来讨论您想要更改的内容。

  1. 分叉存储库
  2. 创建功能分支(git checkout -b feature/AmazingFeature)
  3. 提交您的更改(git commit -m 'Add some AmazingFeature')
  4. 推到分支(git push origin feature/AmazingFeature)
  5. 打开拉取请求

📄 许可证

此项目根据MIT许可证获得许可-请参阅 许可证 文件以获取详细信息。


Made with ❤️ by PT Tokenizin Technology Agency