Token导航 LogoToken导航TokenDH.com
Zyte Fetch Page Content MCP Server logo
AI代理stdio官方级别未说明来源级核验

Zyte Fetch Page Content MCP Server

MCP Server

一个通过Zyte API从任何网页提取干净、适合LLM处理内容的MCP服务器,适用于需要阅读和理解网页内容的AI助手。

工具数

3

提示词数

0

GitHub Stars

2

资源数

0
PythonClaudeAI代理Claude DesktopClaude

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

作者 / 组织

apscrapes

提供方

apscrapes

最后核验

2026/5/17 20:19

快速接入

先看主来源和安装命令,再打开仓库或文档;下面只保留这个条目的关键接入事实。

命令预览

pip install mcp[cli] httpx

详细介绍

Zyte获取页面内容MCP服务器

一个模型上下文协议(MCP)服务器,使用 Zyte API非常适合需要阅读和理解网络内容的人工智能助手。

特性

  • 🧹 清洁内容提取 -获取主页内容
  • 🌐 浏览器渲染 -动态页面的完整JavaScript支持
  • 可配置提取 -在速度(HTTP)或质量(浏览器渲染)之间进行选择
  • 🔒 安全 -API密钥存储在Docker机密中,以非root用户身份运行
  • 🐳 基于Docker -通过Docker MCP工具包轻松部署

可用工具

服务器提供了三种工具,每种工具都使用不同的提取方法:

工具说明
fetch_page_content_from_http_response_body从HTTP响应中提取(最快、最便宜)
fetch_page_content_from_browser_html从浏览器中提取视觉特征(最佳质量,默认)
fetch_page_content_from_browser_html_only仅从浏览器HTML中提取(更适合JS繁重的页面)

提取方法详解

方法速度成本用例回报
HTTP响应正文最快最便宜简单的静态页面,快速预览pageContent 只有
浏览器HTML中等中等最佳质量,包括视觉特征pageContent + browserHtml
仅浏览器HTML较慢较高JavaScript繁重的页面,SPApageContent + browserHtml

先决条件

  • 启用MCP工具包
  • Docker MCP CLI插件(docker mcp 命令)
  • Zyte API密钥 (免费版可用)

安装

步骤1:克隆存储库

git clone https://github.com/YOUR_USERNAME/zyte-fetch-page-content-mcp-server.git
cd zyte-fetch-page-content-mcp-server

第二步:构建Docker镜像

docker build -t zyte-fetch-page-content-mcp-server .

步骤3:设置Zyte API密钥

docker mcp secret set ZYTE_API_KEY="your-zyte-api-key-here"

从获取API密钥 Zyte仪表板.

步骤4:导入目录

# Create catalogs directory if it doesn't exist
mkdir -p ~/.docker/mcp/catalogs

# Copy catalog file
cp custom.yaml ~/.docker/mcp/catalogs/custom.yaml

# Import the catalog
docker mcp catalog import ~/.docker/mcp/catalogs/custom.yaml

步骤5:添加服务器

docker mcp server add zyte-fetch-page-content

步骤6:验证安装

# Check server is listed
docker mcp server ls

# Should show:
# zyte-fetch-page-content    -    ✓ done    -    Fetches page content...

# Check tools are available
docker mcp tools ls | grep fetch

步骤7:配置LLM客户端(例如,Claude Desktop)

编辑您的Claude Desktop配置文件:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • 视窗: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

确保它包含:

{
  "mcpServers": {
    "MCP_DOCKER": {
      "command": "docker",
      "args": ["mcp", "gateway", "run"]
    }
  }
}

步骤8:重新启动克劳德桌面

完全退出克劳德桌面(Cmd+Q/Ctrl+Q)并重新打开。

用法

安装后,您可以要求Claude使用这些工具:

基本用法(最佳质量)

Use fetch_page_content_from_browser_html to get content from https://example.com

快速提取(静态页面)

Use fetch_page_content_from_http_response_body to quickly get content from https://example.com

JavaScript重度页面

Use fetch_page_content_from_browser_html_only to extract content from https://example.com

刀具参数

所有三个工具都接受一个参数:

  • url (必填):从中获取内容的URL

例子:

fetch_page_content_from_browser_html(url="https://example.com")

响应格式

所有工具都从Zyte API返回原始JSON文本。

HTTP响应正文响应

{
  "url": "https://example.com",
  "statusCode": 200,
  "pageContent": {
    "itemMain": "Main article content as clean text...",
    "itemSecondary": "Sidebar and navigation content..."
  }
}

浏览器HTML响应(带视觉功能)

{
  "url": "https://example.com",
  "statusCode": 200,
  "browserHtml": "...",
  "pageContent": {
    "itemMain": "Main article content as clean text...",
    "itemSecondary": "Sidebar and navigation content..."
  }
}

仅浏览器HTML响应

{
  "url": "https://example.com",
  "statusCode": 200,
  "browserHtml": "...",
  "pageContent": {
    "itemMain": "Main article content as clean text...",
    "itemSecondary": "Sidebar and navigation content..."
  }
}

测试

直接测试Docker镜像

# Test that the server starts
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | docker run --rm -i -e ZYTE_API_KEY="your-key" zyte-fetch-page-content-mcp-server

通过Docker MCP进行测试

# Test HTTP response body extraction
docker mcp tools call fetch_page_content_from_http_response_body url="https://example.com"

# Test browser HTML extraction (best quality)
docker mcp tools call fetch_page_content_from_browser_html url="https://example.com"

# Test browser HTML only extraction
docker mcp tools call fetch_page_content_from_browser_html_only url="https://example.com"

故障排除

在目录中找不到服务器

# Reimport the catalog
docker mcp catalog rm custom
docker mcp catalog import ~/.docker/mcp/catalogs/custom.yaml
docker mcp server add zyte-fetch-page-content

或者将其添加到~/.docker/mcp/register.yaml

registry:
  zyte-fetch-page-content:
    ref: ""

工具未出现在Claude中

  1. 验证服务器是否已启用: docker mcp server ls
  2. 检查工具是否存在: docker mcp tools ls | grep fetch
  3. 完全重新启动克劳德桌面

API关键问题

# Verify secret is set
docker mcp secret ls | grep ZYTE

# Reset the secret
docker mcp secret set ZYTE_API_KEY="your-key"

配置错误响应

如果您看到此响应:

{"error": "ZYTE_API_KEY not configured", "type": "config_error"}

API密钥设置不正确。运行:

docker mcp secret set ZYTE_API_KEY="your-actual-key"

超时错误

默认超时为120秒。如果您遇到超时:

  • 使用 fetch_page_content_from_http_response_body 在简单页面上获得更快的结果
  • 考虑到具有大量JavaScript的复杂页面可能需要更长的时间来呈现

运作原理

请求流

Claude Desktop
      ↓
MCP Gateway (Docker)
      ↓
Zyte MCP Server (this project)
      ↓
Zyte API (api.zyte.com)
      ↓
Returns JSON with pageContent

实现细节

每个工具都会向以下对象发出HTTPS POST请求 https://api.zyte.com/v1/extract 与:

  • 认证:使用Zyte API密钥进行HTTP基本验证
  • 超时:120秒
  • 标头: Content-Type: application/json, Accept-Encoding: gzip
  • 有效载荷:URL和提取选项

这些工具的不同之处仅在于 pageContentOptions.extractFrom 价值和是否 browserHtml: true 包括在内。

发展

本地开发

# Install dependencies
pip install mcp[cli] httpx

# Set API key
export ZYTE_API_KEY="your-key"

# Run server
python zyte_fetch_page_content_server.py

本地测试MCP协议

# List available tools
echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | python zyte_fetch_page_content_server.py

更改后重建

docker build -t zyte-fetch-page-content-mcp-server .
docker mcp server rm zyte-fetch-page-content
docker mcp server add zyte-fetch-page-content
# Restart Claude Desktop

安全

  • API密钥存储在Docker Desktop机密中(从不存储在代码中)
  • 容器以非root用户身份运行
  • 未记录敏感数据
  • 所有网络请求都使用HTTPS
  • 用于API身份验证的HTTP基本身份验证

性能提示

  • 用于静态HTML页面:使用 fetch_page_content_from_http_response_body (最快)
  • 为了获得最佳的提取质量:使用 fetch_page_content_from_browser_html (包括视觉特征)
  • 对于JavaScript密集的SPA:使用 fetch_page_content_from_browser_html_only
  • 成本优化:HTTP响应体提取是最便宜的选择

实用链接

-

目录标签

目录标签

PythonClaudeAI代理网页提取本地部署内容清洗浏览器渲染AI助手自动化工具

支持客户端

Claude DesktopClaude

接入字段

传输方式(transport,传输协议)

stdio

鉴权方式(authType,认证方式)

api-key

工具数量(toolCount,工具数)

3

资源数量(resourceCount,资源数)

0

提示词数量(promptCount,提示词数)

0

权限和风险

stdioapi-key部署方式未说明

接入前请确认传输方式、认证方式和部署位置,并根据实际工具能力限制访问范围。

安装前确认

不要直接授予不必要的文件、网络或账号权限;先核对安装命令和配置内容。

来源信息

继续浏览同类 MCP