网页内容提取工具

一款基于Readability.js的网页内容提取工具,可获取网页主要内容并去除广告等干扰元素,适用于保存干净的网页文章到Obsidian笔记中。

  • by iemong
  • TypeScript
  • 本地部署
  • 更新于
在 GitHub 查看 iemong/mcp-web-extractor

使用说明

MCP Web提取器

使用Readability.js提取web内容的模型上下文协议(MCP)服务器。该工具可以获取网页并提取主要内容,非常适合将干净、可读的文章版本保存到黑曜石笔记中。

特性

  • 从任何URL提取可读内容
  • 删除广告、侧边栏和其他干扰
  • 返回干净的文本以及元数据(标题、摘录等)
  • 通过MCP与黑曜石轻松集成

安装

# Clone the repository
git clone https://github.com/iemong/mcp-web-extractor.git
cd mcp-web-extractor

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

服务器将于启动http://localhost:3000MCP端点位于http://localhost:3000/mcp.

用法

作为独立服务

您可以使用附带的客户端示例从URL中提取内容:

ts-node-esm client-example.ts

黑曜石

这 obsidian-integration.ts 该文件提供了一个如何将此MCP服务器与Obsidian集成的示例。您可以将其用作创建提取web内容的黑曜石插件的起点。

API

MCP服务器提供以下功能:

  • extract-content:从给定的URL中提取可读内容
    • 参数: { url: string }
    • 退货: { title, content, textContent, excerpt, siteName }

许可证

麻省理工学院