Custom Fetch MCP
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Custom Fetch MCPFetch the main content from https://example.com"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Claude Custom Fetch MCP
为使用第三方 API 的 Claude Code 用户提供网页抓取能力的 MCP 服务器。
解决什么问题
Claude Code 内置的 WebFetch 工具依赖 Anthropic 官方 API 的服务端能力。当你使用第三方 API 提供商(SiliconFlow、自建网关等)时,WebFetch 无法正常工作。
本 MCP 服务器在本地发起 HTTP 请求抓取网页,不依赖任何 API 提供商,只要你的电脑能上网就能工作。
Related MCP server: Web Search MCP Server (Authless)
功能
网页抓取:抓取网页并提取正文内容(去除广告、导航等干扰元素)
智能缓存:基于 SQLite 的本地缓存,避免重复请求(默认 1 小时过期)
API 检测:自动检测当前 Claude Code 的 API 配置
网络测试:测试到各网站的连通性
限制
无法抓取需要 JavaScript 渲染的页面(如 SPA 应用、聊天界面等)
无法抓取需要登录的页面
安装
1. 克隆仓库并安装依赖
git clone https://github.com/lyshrines/claude-custom-fetch-mcp
cd claude-custom-fetch-mcp
pip install -r requirements.txt
pip install truststore2. 配置 Claude Code
在你的项目根目录(或 home 目录)创建 .mcp.json:
{
"mcpServers": {
"custom-fetch": {
"command": "python",
"args": ["-m", "mcp_fetch.server"],
"env": {
"PYTHONPATH": "/path/to/claude-custom-fetch-mcp",
"USERPROFILE": "C:\\Users\\YourName",
"CACHE_TTL": "3600",
"MAX_CACHE_SIZE_MB": "100",
"LOG_LEVEL": "INFO"
}
}
}
}Windows 用户注意:
env中需要显式设置USERPROFILE,否则日志路径解析可能失败。
3. 启用 MCP 服务器
在 ~/.claude/settings.json 中添加:
{
"enabledMcpjsonServers": ["custom-fetch"]
}重启 Claude Code,在 /mcp 中应能看到 custom-fetch 已启用。
4. 推荐:在 CLAUDE.md 中添加指令
# 联网抓取
当需要抓取网页内容时,优先使用 custom-fetch MCP 的 `fetch_url` 工具,而非内置 WebFetch(内置 WebFetch 在非官方 API 下不可用)。提供的工具
fetch_url
抓取网页并提取内容。
参数 | 类型 | 必填 | 默认值 | 说明 |
| string | 是 | - | 要抓取的 URL |
| boolean | 否 | true | 是否使用缓存 |
| boolean | 否 | true | 是否只提取正文 |
| number | 否 | 15 | 超时时间(秒) |
detect_api_provider
检测当前 Claude Code 的 API 配置,判断是否使用官方 API。
cache_stats
查看缓存统计信息。
clear_cache
清理缓存。older_than 参数指定清理多少秒前的条目,0 表示全部清理。
network_test
测试到指定网站的连通性。sites 参数传入 URL 列表。
依赖
Python 3.10+
mcp- MCP SDKrequests- HTTP 客户端truststore- 使用系统 SSL 证书readability-lxml- 正文提取beautifulsoup4- HTML 解析lxml- XML/HTML 处理
许可证
MIT License
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/lyshrines/claude-custom-fetch-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server