Model Context Protocol 服务器可用于抓取网络内容并处理图像,这使得 Claude Desktop(或其他 MCP 客户端)能够抓取网页内容并对图像进行适当处理。
若要将此工具与 Claude Desktop 配合使用,请将以下内容添加到您的 Claude Desktop 配置文件(~/Library/Application Support/Claude/claude_desktop_config.json)中:
{
"tools": {
"fetch": {
"command": "npx",
"args": ["-y", "@kazuph/mcp-fetch"]
}
}
}
这样会自动下载并按需运行该工具的最新版本。
此辅助功能设置是自动执行剪贴板操作(Cmd + V)所必需的。
enableFetchImages: true)。按照以下命令进行安装:
npm install -g @kazuph/mcp-fetch
图像处理采用 Sharp 库,以保障最佳性能和质量。当发现多张图像时,它们会按顺序垂直拼接,同时会考虑尺寸限制。
在 ~/.config/mcp-fetch.json 中添加以下配置:
{
"proxy": "http://your-proxy-server:port",
"timeout": 30000,
"maxConcurrency": 5
}
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| url | string | 是 | 待抓取的网页地址 |
| enableFetchImages | bool | 否 | 是否启用图像处理,默认为 false |
| imageStartIndex | number | 否 | 图像起始索引,默认为 0 |
| imageMaxCount | number | 否 | 最大抓取图像数量,默认为 1 |
| 参数名 | 类型 | 是否必填 | 描述 |
|---|---|---|---|
| proxy | string | 否 | 设置代理服务器地址和端口 |
| timeout | number | 否 | 设置请求超时时间,单位为毫秒,默认 30000 |
| maxConcurrency | number | 否 | 设置并发请求数量,默认为 5 |
| 参数名 | 类型 | 描述 |
|---|---|---|
| content | string | 抓取到的网页内容 |
| title | string | 文章标题 |
| images | array | 抓取到的图像列表 |
| 参数名 | 类型 | 描述 |
|---|---|---|
| src | string | 图像源地址 |
| width | number | 图像宽度 |
| height | number | 图像高度 |
| extractedFrame | bool | 是否为 GIF 的第一帧 |
{
"url": "https://example.com"
}
{
"url": "https://example.com",
"enableFetchImages": true,
"imageMaxCount": 3
}
{
"url": "https://example.com",
"enableFetchImages": true,
"imageStartIndex": 3,
"imageMaxCount": 3
}
enableFetchImages: false)。disableImages 参数,转而使用 enableFetchImages 参数。