M

MCP Markdown爬虫服务器

@jmh108/md-webcrawl-mcp
1 Stars 1.0k 次浏览 jmh108 更新于 2026-08-23

一个基于Python的MCP服务器,它爬取网站以提取和保存内容为markdown文件,并具有映射网站结构和链接的功能。

该服务暂未提供标准配置,请参考 README 手动接入

服务介绍

MD MCP Webcrawler 项目

一个基于 Python 的 MCP(https://modelcontextprotocol.io/introduction)网络爬虫,用于提取和保存网站内容。

特性

  • 提取网站内容并保存为 markdown 文件
  • 映射网站结构和链接
  • 批量处理多个 URL
  • 可配置的输出目录

安装

  1. 克隆仓库:
git clone https://github.com/yourusername/webcrawler.git
cd webcrawler
  1. 安装依赖项:
pip install -r requirements.txt
  1. 可选:配置环境变量:
export OUTPUT_PATH=./output  # Set your preferred output directory

输出

抓取的内容以 markdown 格式保存在指定的输出目录中。

配置

可以通过环境变量配置服务器:

  • OUTPUT_PATH:文件保存的默认输出目录
  • MAX_CONCURRENT_REQUESTS:最大并行请求数(默认:5)
  • REQUEST_TIMEOUT:请求超时时间(秒)(默认:30)

Claude 设置

使用 FastMCP 安装
fastmcp install server.py

或使用自定义设置直接运行 fastmcp

"Crawl Server": {
      "command": "fastmcp",
      "args": [
        "run",
        "/Users/mm22/Dev_Projekte/servers-main/src/Webcrawler/server.py"
      ],
      "env": {
        "OUTPUT_PATH": "/Users/user/Webcrawl"
      }

开发

实时开发

fastmcp dev server.py --with-editable .

调试

使用 https://modelcontextprotocol.io/docs/tools/inspector 进行调试会有帮助

示例

示例 1:提取并保存内容

mcp call extract_content --url "https://example.com" --output_path "example.md"

示例 2:创建内容索引

mcp call scan_linked_content --url "https://example.com" | \
  mcp call create_index --content_map - --output_path "index.md"

贡献

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

许可证

本项目遵循 MIT 许可证。有关更多信息,请参阅 LICENSE

要求

  • Python 3.7+
  • FastMCP (uv pip install fastmcp)
  • requirements.txt 中列出的依赖项

相关 MCP 服务