返回市场
网站下载器

网站下载器

作者:pskill9144 星标更新:2024-12-25

项目介绍

Website Downloader MCP Server

此MCP服务器提供了一个工具,可以使用wget下载整个网站,并保留网站结构,同时将链接转换为本地可用形式。

<a href="https://glama.ai/mcp/servers/egcwr79vu2"><img width="380" height="200" src="https://gips2.baidu.com/it/u=712997506,3862697896&fm=3081&app=3081&f=PNG?w=760&h=400" alt="Google Workspace Server MCP server" /></a>

预备条件

该服务器需要在您的系统上安装wget

安装wget

macOS

使用Homebrew:

brew install wget

Linux (Debian/Ubuntu)

sudo apt-get update
sudo apt-get install wget

Linux (Red Hat/Fedora)

sudo dnf install wget

Windows

  1. 使用Chocolatey
choco install wget
  1. 或从以下网址下载二进制文件:https://eternallybored.org/misc/wget/
    • 下载最新的wget.exe
    • 将其放置在PATH环境变量中的目录下(例如,C:\Windows\System32)

使用方法

该服务器提供了一个名为download_website的工具,具有以下参数:

  • url(必需):要下载的网站的URL
  • outputPath(可选):网站应下载到的目录,默认为当前目录。
  • depth(可选):递归下载的最大深度级别,默认为无限。设置为0仅下载指定页面,1下载直接链接等。

示例

{
  "url": "https://example.com",
  "outputPath": "/path/to/output",
  "depth": 2  // 可选:下载至多2级深度
}

功能

网站下载器:

  • 递归下载,深度无限
  • 包括所有页面需求(CSS、图像等)
  • 将链接转换为本地可用形式
  • 为文件添加适当的扩展名
  • 限制下载到同一域名
  • 保留网站结构

安装

  1. 构建服务器:
npm install
npm run build
  1. 添加到MCP设置:
{
  "mcpServers": {
    "website-downloader": {
      "command": "node",
      "args": ["/path/to/website-downloader/build/index.js"]
    }
  }
}