返回市场
MCP-NPX-获取工具

MCP-NPX-获取工具

作者:tokenizin-agency36 星标更新:2024-12-26

项目介绍

MCP NPX Fetch

<div align="center">

npm 版本 许可证: MIT TypeScript 模型上下文协议

一个强大的MCP服务器,可以轻松地抓取和转换网络内容到各种格式(HTML、JSON、Markdown、纯文本)。

安装特性用法文档贡献

</div>

<a href="https://glama.ai/mcp/servers/m2a0ue08n2"><img width="380" height="200" src="https://gips2.baidu.com/it/u=3056115124,1443470986&fm=3081&app=3081&f=PNG?w=760&h=400" alt="NPX Fetch MCP服务器" /></a>


🚀 特性

  • 🌐 通用内容抓取:支持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;     // 必需:目标URL
  headers?: {      // 可选:自定义请求头部
    [key: string]: string;
  };
}

fetch_json

从任何URL抓取并解析JSON数据。

{
  url: string;     // 必需:目标URL
  headers?: {      // 可选:自定义请求头部
    [key: string]: string;
  };
}

fetch_txt

从任何URL抓取并返回干净的纯文本内容,移除HTML标签和脚本。

{
  url: string;     // 必需:目标URL
  headers?: {      // 可选:自定义请求头部
    [key: string]: string;
  };
}

fetch_markdown

从任何URL抓取内容并转换为格式良好的Markdown。

{
  url: string;     // 必需:目标URL
  headers?: {      // 可选:自定义请求头部
    [key: string]: string;
  };
}

🔧 使用

命令行使用

直接启动MCP服务器:

mcp-npx-fetch

或者通过NPX:

npx @tokenizin/mcp-npx-fetch

Claude Desktop集成

  1. 找到你的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
  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

🛠 技术栈

🤝 贡献

欢迎贡献!请随意提交Pull Request。对于重大更改,请先打开一个问题来讨论您想要更改的内容。

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

📄 许可证

此项目采用MIT许可证 - 查看LICENSE文件以获取详细信息。


<div align="center"> 由 <a href="https://github.com/tokenizin-agency">PT Tokenizin Technology Agency</a> 制作 ❤️ </div>