Tatn 网页抓取工具

@tatn/mcp-server-fetch-typescript
0 Stars 714 次浏览 tatn 更新于 2026-08-23

一个提供网页内容获取和转换功能的模型上下文协议服务器。

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

可用工具 (4 个)

该服务在 MCP 协议中暴露的工具,AI 可按需调用

get_raw_text 1 个参数 需填 1 项

Retrieves raw text content directly from a URL without browser rendering. Ideal for structured data formats like JSON, XML, CSV, TSV, or plain text files. Best used when fast, direct access to the source content is needed without processing dynamic elements.

必填参数:url

get_rendered_html 1 个参数 需填 1 项

Fetches fully rendered HTML content using a headless browser, including JavaScript-generated content. Essential for modern web applications, single-page applications (SPAs), or any content that requires client-side rendering to be complete.

必填参数:url

get_markdown 1 个参数 需填 1 项

Converts web page content to well-formatted Markdown, preserving structural elements like tables and definition lists. Recommended as the default tool for web content extraction when a clean, readable text format is needed while maintaining document structure.

必填参数:url

get_markdown_summary 1 个参数 需填 1 项

Extracts and converts the main content area of a web page to Markdown format, automatically removing navigation menus, headers, footers, and other peripheral content. Perfect for capturing the core content of articles, blog posts, or documentation pages.

必填参数:url

服务介绍

mcp-server-fetch-typescript MCP 服务器

一个提供网页内容抓取和转换功能的模型上下文协议服务器。该服务器实现了一个全面的网页内容检索系统,支持多种格式和渲染方法,使其适用于从简单的数据提取到复杂的网页抓取等各种任务。

特性

工具

  • get_raw_text - 直接从 URL 获取原始文本内容

    • url 作为必需参数指向基于文本的资源
    • 返回未经浏览器渲染处理的文本内容
    • 适用于 JSON、XML、CSV、TSV 或纯文本文件
    • 当需要快速直接访问源内容时最佳使用
  • get_rendered_html - 抓取完全渲染的 HTML 内容

    • url 作为必需参数
    • 在 JavaScript 执行后返回完整的 HTML 内容
    • 使用 Playwright 进行无头浏览器渲染
    • 对于现代 Web 应用程序和单页应用程序(SPAs)至关重要
  • get_markdown - 将网页内容转换为 Markdown 格式

    • url 作为必需参数
    • 返回保留结构元素的良好格式化的 Markdown
    • 支持表格和定义列表
    • 推荐用于内容归档和文档编制
  • get_markdown_summary - 提取并转换主要内容

    • url 作为必需参数
    • 返回专注于主要内容的干净 Markdown
    • 自动移除导航、页眉和页脚
    • 适合文章和博客帖子的提取

安装

作为全局包

npm install -g mcp-server-fetch-typescript

作为项目依赖

npm install mcp-server-fetch-typescript

使用

与 Claude Desktop 一起使用

要与 Claude Desktop 一起使用,请添加服务器配置:

在 MacOS 上: ~/Library/Application Support/Claude/claude_desktop_config.json
在 Windows 上: %APPDATA%/Claude/claude_desktop_config.json

"mcpServers": {
  "mcp-server-fetch-typescript": {
    "command": "npx",
    "args": [
      "-y",
      "mcp-server-fetch-typescript"
    ]
  }
}

或者添加以下配置:

git clone https://github.com/tatn/mcp-server-fetch-typescript.git
cd mcp-server-fetch-typescript
npm install
npm run build
"mcpServers": {
  "mcp-server-fetch-typescript": {
    "command": "node",
    "args": [
      "/path/to/mcp-server-fetch-typescript/build/index.js"
    ]
  }
}

调试

要调试 MCP 服务器:

npx @modelcontextprotocol/inspector npx -y mcp-server-fetch-typescript
npx @modelcontextprotocol/inspector node /path/to/mcp-server-fetch-typescript/build/index.js

相关 MCP 服务