@kazuph/mcp-fetch
MCP 获取
用于获取 Web 内容和处理图像的模型上下文协议服务器。这使得 Claude Desktop(或任何 MCP 客户端)能够获取 Web 内容并进行适当的图像处理。
快速入门(针对用户)
要将此工具与 Claude Desktop 一起使用,只需将以下内容添加到您的 Claude Desktop 配置( ~/Library/Application Support/Claude/claude_desktop_config.json )中:
{
"tools": {
"fetch": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-fetch"]
}
}
}这将在需要时自动下载并运行该工具的最新版本。
所需设置
为 Claude 启用辅助功能:
打开系统设置
前往“隐私和安全”>“辅助功能”
点击“+”按钮
从您的应用程序文件夹添加 Claude
为克劳德打开开关
自动剪贴板操作(Cmd+V)需要此辅助功能设置才能正常工作。
Related MCP server: OpenAI Agents MCP Server
特征
Web 内容提取:自动提取 Web 内容并将其格式化为 Markdown
文章标题提取:提取并显示文章标题
图像处理:可选地对网页中的图像进行优化处理(默认情况下禁用,使用
enableFetchImages: true启用)分页支持:支持文本和图像的分页
JPEG 优化:自动将图像优化为 JPEG 以获得更好的性能
GIF 支持:从动画 GIF 中提取第一帧
对于开发人员
以下部分适用于那些想要开发或修改该工具的人。
先决条件
Node.js 18+
macOS(用于剪贴板操作)
Claude Desktop(从https://claude.ai/desktop安装)
tsx(通过
npm install -g tsx)
安装
git clone https://github.com/kazuph/mcp-fetch.git
cd mcp-fetch
npm install
npm run build图像处理规格
处理来自 Web 内容的图像时,将应用以下优化:
图像被转换为 JPEG 格式并进行质量控制
最大宽度默认限制为 1200px
默认最大高度限制为 1600px
色度子采样(4:2:0)可实现更好的压缩
MozJPEG 优化,可实现更小的文件大小
配置
确保 Claude Desktop 已安装并正在运行。
如果还没有安装 tsx,请全局安装:
npm install -g tsx
# or
pnpm add -g tsx修改位于以下位置的 Claude Desktop 配置:
~/Library/Application Support/Claude/claude_desktop_config.json
您可以通过 Claude Desktop 菜单轻松找到它:
打开 Claude 桌面
在 Mac 菜单栏上单击 Claude
点击“设置”
点击“开发者”
将以下内容添加到您的 MCP 客户端的配置中:
{
"tools": {
"fetch": {
"args": ["tsx", "/path/to/mcp-fetch/index.ts"]
}
}
}可用参数
url(必填):要获取的 URLmaxLength(默认值:20000):返回内容的最大长度startIndex(默认值:0):内容中的起始位置imageStartIndex(默认值:0):图像收集的起始位置raw(默认值:false):返回原始内容而不是处理过的 markdownimageMaxCount(默认值:3):每个请求处理的最大图像数量imageMaxHeight(默认值:4000):合并图像的最大高度imageMaxWidth(默认值:1000):合并图像的最大宽度imageQuality(默认值:80):JPEG 质量(1-100)enableFetchImages(默认值:false):启用图像获取和处理功能。仅限 CLAUDE 用户:您可以启用此功能!CLAUDE 可以获取和处理图像!尽情享受这项功能吧!ignoreRobotsTxt(默认值:false):忽略 robots.txt 限制
示例
基本内容获取(无图像)
{
"url": "https://example.com"
}启用图片抓取
{
"url": "https://example.com",
"enableFetchImages": true,
"imageMaxCount": 3
}通过图像分页
{
"url": "https://example.com",
"enableFetchImages": true,
"imageStartIndex": 3,
"imageMaxCount": 3
}笔记
由于此工具依赖于 macOS 特定的剪贴板操作,因此仅适用于 macOS。
使用 Sharp 处理图像以获得最佳性能和质量。
当发现多幅图像时,它们会垂直合并,同时考虑尺寸限制。
通过提取动画 GIF 的第一帧来自动处理动画 GIF。
变更日志
v1.1.3
更改了默认行为:默认情况下不获取图像(
enableFetchImages: false)删除
disableImages,改为使用enableFetchImages参数
v1.1.0
增加文章标题提取功能
改进了响应格式以包含文章标题
修复了 MCP 响应内容的类型问题
v1.0.0
初始版本
网页内容提取
图像处理与优化
分页支持
Available Tools
1 toolimageFetchA
画像取得に強いMCPフェッチツール。記事本文をMarkdown化し、ページ内の画像を抽出・最適化して返します。
新APIの既定(imagesを指定した場合)
画像: 取得してBASE64で返却(最大3枚を縦結合した1枚JPEG)
保存: しない(オプトイン)
クロスオリジン: 許可(CDN想定)
パラメータ(新API)
url: 取得先URL(必須)
images: true | { output, layout, maxCount, startIndex, size, originPolicy, saveDir }
output: "base64" | "file" | "both"(既定: base64)
layout: "merged" | "individual" | "both"(既定: merged)
maxCount/startIndex(既定: 3 / 0)
size: { maxWidth, maxHeight, quality }(既定: 1000/1600/80)
originPolicy: "cross-origin" | "same-origin"(既定: cross-origin)
text: { maxLength, startIndex, raw }(既定: 20000/0/false)
security: { ignoreRobotsTxt }(既定: false)
旧APIキー(enableFetchImages, returnBase64, saveImages, imageMax*, imageStartIndex 等)は後方互換のため引き続き受け付けます(非推奨)。
Examples(新API) { "url": "https://example.com", "images": true }
{ "url": "https://example.com", "images": { "output": "both", "layout": "both", "maxCount": 4 } }
Examples(旧API互換) { "url": "https://example.com", "enableFetchImages": true, "returnBase64": true, "imageMaxCount": 2 }
| Name | Required | Description | Default |
|---|---|---|---|
| url | Yes | ||
| maxLength | No | ||
| startIndex | No | ||
| imageStartIndex | No | ||
| raw | No | ||
| imageMaxCount | No | ||
| imageMaxHeight | No | ||
| imageMaxWidth | No | ||
| imageQuality | No | ||
| enableFetchImages | No | ||
| allowCrossOriginImages | No | ||
| ignoreRobotsTxt | No | ||
| saveImages | No | ||
| returnBase64 | No | ||
| images | No | ||
| text | No | ||
| security | No |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description carries full burden. It details behavioral traits: images are fetched, base64 returned (default), max 3 images merged into one JPEG, no save unless opted in, cross-origin allowed, and old API compatibility. Absent are rate limits or auth needs, but core behavior is transparent.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is lengthy (≈250 words) but well-structured with sections for defaults, parameters, and examples. It is front-loaded with purpose but contains redundant details (e.g., repeating default values in both text and examples). Could be more concise.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (17 parameters, nested objects, no output schema), the description provides extensive detail on new API behavior, defaults, and legacy support. Includes examples. Does not explicitly explain return format beyond base64 and Markdown, but contextually sufficient.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, so description must compensate. It lists parameters for the new API (images object with output, layout, maxCount, etc.) and mentions old keys. It covers defaults and options, though some top-level schema parameters (e.g., maxLength, startIndex) are explained only under the text object, causing slight ambiguity.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it is an MCP fetch tool specialized for image acquisition, converting article text to Markdown and extracting/optimizing images. It specifies verb+resource (fetch and process web pages with images) and no sibling tools exist, so no differentiation needed.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explains when to use (for fetching pages with images) and provides detailed parameter behavior for both new and legacy APIs. It does not explicitly exclude scenarios but offers enough context for appropriate use.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
1 tool update
v1.6.2- Changed
imageFetch4 fields changed- added
Input schema / properties / allowCrossOriginImagesAdded value: +{ + "default": true, + "type": [ + "boolean", + "string" + ] +} - added
Input schema / properties / imagesAdded value: +{ + "anyOf": [ + { + "type": "boolean" + }, + { + "additionalProperties": false, + "properties": { + "layout": { + "enum": [ + "merged", + "individual", + "both" + ], + "type": "string" + }, + "maxCount": { + "maximum": 10, + "minimum": 0, + "type": "integer" + }, + "originPolicy": { + "enum": [ + "cross-origin", + "same-origin" + ], + "type": "string" + }, + "output": { + "enum": [ + "base64", + "file", + "both" + ], + "type": "string" + }, + "saveDir": { + "type": "string" + }, + "size": { + "additionalProperties": false, + "properties": { + "maxHeight": { + "maximum": 10000, + "minimum": 100, + "type": "integer" + }, + "maxWidth": { + "maximum": 10000, + "minimum": 100, + "type": "integer" + }, + "quality": { + "maximum": 100, + "minimum": 1, + "type": "integer" + } + }, + "type": "object" + }, + "startIndex": { + "minimum": 0, + "type": "integer" + } + }, + "type": "object" + } + ] +} - added
Input schema / properties / securityAdded value: +{ + "additionalProperties": false, + "properties": { + "ignoreRobotsTxt": { + "type": "boolean" + } + }, + "type": "object" +} - added
Input schema / properties / textAdded value: +{ + "additionalProperties": false, + "properties": { + "maxLength": { + "exclusiveMinimum": 0, + "maximum": 1000000, + "type": "integer" + }, + "raw": { + "type": "boolean" + }, + "startIndex": { + "minimum": 0, + "type": "integer" + } + }, + "type": "object" +}
1 tool update
v1.0.0- First observed
imageFetch
TDQS
Scored across 1 tool
With only one tool, there is no possibility of confusion between tools. The tool's purpose is clearly defined and distinct.
The single tool name 'imageFetch' is descriptive and follows a verb_noun pattern. There is no inconsistency since only one tool exists.
While the server has only one tool, it is a complex and well-documented tool that handles a wide range of functionality appropriate for its fetch-image purpose. The count is slightly below the typical range but not insufficient.
The tool comprehensively covers fetching web pages, extracting images, and outputting them in various formats (base64, file, merged, individual). It includes parameters for text extraction and security, leaving no apparent gaps for its stated purpose.
Maintenance
Related MCP Connectors
MCP server for Firecrawl — web search, scraping, and biomedical/arXiv paper search.
Enable secure connectivity between Sentry issues and debugging data, and LLM clients, using a Model Context Protocol (MCP) server.
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- AlicenseBqualityDmaintenanceAn educational implementation of a Model Context Protocol server that demonstrates how to build a functional MCP server for integrating with various LLM clients like Claude Desktop.1162MIT
- FlicenseBqualityDmaintenanceA Model Context Protocol server that enables Claude users to access specialized OpenAI agents (web search, file search, computer actions) and a multi-agent orchestrator through the MCP protocol.410-
- AlicenseAqualityDmaintenanceModel Context Protocol server that enables Claude Desktop (or any MCP client) to fetch web content and process images appropriately.1141 npmMIT
- AlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server that enables Claude or other LLMs to fetch content from URLs, supporting HTML, JSON, text, and images with configurable request parameters.33MIT