Promas
Promas(产品图片抓取器)
Promas 是一个面向 AI 代理的自动化产品图片抓取器和 Model Context Protocol (MCP) 服务器。
无需编写脆弱的逐站点抓取器(一旦 HTML 结构变化就会失效),Promas 将可插拔的搜索驱动发现与通用语义提取流水线及可扩展的 CDN 感知放大相结合。它能够在任何品牌或零售网站(Apple、Nike、Sony、Amazon、Target、B&H、Best Buy、eBay、Shopify 商店以及任意产品 URL)上可靠地提取主分辨率产品图片。
1. 快速开始
选项 A:从 PyPI 安装(推荐)
pip install promas
playwright install chromium在任何地方即时运行:
promas "iPhone 16 Pro"选项 B:使用 Docker 运行(无需在本地安装 Python / Playwright)
# Build the Docker image
docker build -t promas .
# Run the FastMCP Server for your AI Agent
docker run -i --rm promas
# Or run the standalone CLI scraper
docker run --rm promas promas "Sony FX3"Related MCP server: Universal Shopping Agent MCP Server
2. 架构与流水线
graph TD
User([AI Agent / CLI Request]) --> Cache{TTL Disk Cache}
Cache -- "Cache Hit (<0.1s)" --> Return([Return Verified Master Assets])
Cache -- "Cache Miss" --> SearchRouter{Pluggable Discovery}
SearchRouter -->|BRAVE_API_KEY| BraveAPI[Brave Search API]
SearchRouter -->|SERPAPI_API_KEY| SerpAPI[SerpAPI Google]
SearchRouter -->|Default: Free / Zero Keys| BrowserSearch[Stealth Browser Discovery]
BraveAPI --> Scorer[E-Commerce Candidate Scorer]
SerpAPI --> Scorer
BrowserSearch --> Scorer
Scorer --> ParallelScraper[Parallel Multi-Page Scraper]
subgraph Scraping Pipeline
ParallelScraper --> RateLimiter[Domain Rate Limiter]
RateLimiter --> Parser[Universal Extractor: Schema.org, OG, Microdata, DOM]
Parser --> CDNUpscaler[CDN Master Upscalers: Scene7, Nike, Shopify, Amazon...]
end
CDNUpscaler --> Verifier[Async HTTP Verification & pHash Dedup]
Verifier --> CacheStore[(Save to Disk Cache)]
CacheStore --> Return3. 为什么选择 Promas?(对比)
功能 | 原始脚本( | 付费 API( | Promas |
成本 | 免费 | 每月 50–500+ 美元订阅费 | 100% 免费且开源(MIT) |
设置与维护 | 脆弱的逐站点选择器;改版即失效 | 通用 HTML 响应;需自定义解析器 | 搜索驱动 + 语义模式 + CDN 放大器 |
反爬虫与速率限制 | 很快被 Cloudflare/Akamai 拦截 | 云端处理 | 按域速率限制器 + Stealth + Tenacity 重试 |
图片验证 | 无;返回失效链接和 1x1 像素 | 基本状态检查 | 异步 HTTP 验证 + pHash 感知去重 |
搜索后端 | 硬编码抓取器 | 自定义 API 抓取器 | 可插拔(Brave API / SerpAPI / 浏览器回退) |
缓存 | 无 | 额外费用 | 内置 TTL 磁盘缓存(重复查询亚秒级响应) |
图片质量 | 通常捕获低分辨率 UI 缩略图 | 仅返回页面原始图片 | 主 CDN 去上限(最高 2500px+) |
AI 代理原生支持 | 需要手动封装 | 仅 REST API | 原生 FastMCP 工具协议 + Docker 支持 |
4. 搜索后端与配置
Promas 100% 开箱即用,无需任何配置或 API 密钥。
搜索发现的工作原理:
免费 / 默认(零设置):Promas 使用内置的 Playwright Stealth 浏览器引擎,通过 Bing 和 DuckDuckGo 免费发现电子商务候选页面。
Brave Search API(生产环境推荐):如果设置了
BRAVE_API_KEY,Promas 将切换到官方、符合 ToS、亚秒级响应的 API 发现方式。获取免费密钥(每月 2,000 次免费查询): Brave Search API
SerpAPI(替代方案):如果设置了
SERPAPI_API_KEY,Promas 将通过 SerpAPI 查询 Google 搜索。获取免费密钥(每月 100 次免费查询): SerpAPI
环境变量参考:
变量 | 默认值 | 描述 |
| None | 用于 Brave Search 的可选 API 密钥 |
| None | 用于 SerpAPI Google 搜索的可选 API 密钥 |
|
| 最大并行浏览器上下文数 |
|
| 每个目标商店的最大并发请求数 |
|
| 对同一域名发起请求之间的礼貌延迟(秒) |
|
| 切换磁盘缓存( |
|
| 缓存过期时间(秒) |
|
| 异步 HTTP MIME 类型与像素尺寸检查 |
|
| pHash 近似重复裁剪移除 |
|
| pHash 去重的灵敏度阈值 |
5. 使用方法
A. 独立 CLI
按产品名称搜索:
promas "iPhone 16 Pro"从直接 URL 提取:
promas "https://www.apple.com/iphone-16-pro/"按特定域名过滤并限制数量:
promas "Sony FX3" --max-images 5 --site bhphotovideo.com绕过缓存或禁用验证:
promas "Nike Air Jordan 1" --no-cache --no-verifyB. FastMCP 服务器
运行独立 MCP 服务器:
promas-mcpC. 代理集成(mcp_config.json)
原生 Python 安装:
{
"mcpServers": {
"promas": {
"command": "promas-mcp",
"env": {
"BRAVE_API_KEY": "optional-key-here"
}
}
}
}Docker 容器(零依赖设置):
{
"mcpServers": {
"promas": {
"command": "docker",
"args": ["run", "-i", "--rm", "promas"]
}
}
}6. 多工具 MCP 套件
Promas 向 AI 代理提供专用的细粒度工具:
工具 | 用途 | 描述 |
| 完整流水线 | 查询字符串或 URL -> 自动发现 -> 并行抓取 -> HTTP 验证 -> pHash 去重 -> 主图链接。 |
| 仅发现 | 查询字符串 -> 对候选电子商务产品页面进行快速排序(返回 URL,不抓取图片)。 |
| 仅提取 | 特定直接 URL -> 严格从该页面提取标题和主图片资源。 |
7. 代理系统提示词指南
将以下说明添加到你的 AI 代理的系统提示词中:
You have access to the `fetch_product_images` tool (Promas), which universally retrieves high-resolution product imagery and official product links from across the web.
GUIDELINES FOR USING PROMAS:
1. When asked for product images, photos, or visual references, call `fetch_product_images(query=<specific product name or direct URL>)`.
2. Do not invent or hallucinate image URLs; strictly return the verified URLs returned by Promas.
3. Render primary high-res images as markdown (e.g. ``) and provide source product links for reference.
4. If a specific store is desired by the user, you can supply `site_filter` (e.g. `site_filter="apple.com"`).8. 输出模式
{
"status": "success",
"query": "iPhone 16 Pro",
"title": "Apple iPhone 16 Pro",
"sources_scraped": [
"https://www.target.com/p/apple-iphone-16-pro/-/A-93597960",
"https://www.amazon.com/Apple-iPhone-Version-256GB-Titanium/dp/B0DHJDPYYR",
"https://www.apple.com/shop/buy-iphone/iphone-16"
],
"images": [
"https://target.scene7.com/is/image/Target/GUEST_7c0750b4-ee18-41d4-9309-d08e41619229",
"https://target.scene7.com/is/image/Target/GUEST_4e1ce623-313f-4193-93a4-61dc0fc9da14"
],
"error_message": null
}9. 贡献
热忱欢迎贡献!借助我们的装饰器插件注册表,为新的电子商务平台或 CDN 添加主图放大支持只需不到 10 行代码。
👉 有关添加新 CDN 规则的分步说明,请参阅 CONTRIBUTING.md。
10. 测试与质量保证
Promas 包含纯解析函数的单元测试、类型检查以及金丝雀集成测试:
# Run unit tests
pytest -v
# Run linting
ruff check .
# Run type checker
mypy promas/ tests/
# Run live golden canary integration tests (hits live sites)
pytest -v --run-integration11. 法律与道德使用
仅限公开访问:Promas 仅访问公开可用的网页;它不会绕过身份验证、付费墙或私有登录。
服务条款:自动访问可能受各网站服务条款的约束。在规模化抓取之前,请务必查看目标域名的 ToS 和爬虫策略,或提供官方搜索 API 密钥(
BRAVE_API_KEY/SERPAPI_API_KEY)以进行符合 ToS 的发现。图片版权与署名:Promas 解析并返回直接的图片 URL——它不会存储、重新托管或复制媒体文件。对检索到的图片进行下游展示、存储或商业使用由用户自行负责。
12. 许可证
本项目采用 MIT 许可证 授权。
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- AlicenseAqualityDmaintenanceKlarna-style product discovery for AI shopping agents. Makes product catalogs machine-readable so AI agents can search, compare, and purchase products programmatically.6MIT
- FlicenseAqualityDmaintenanceEnables AI-powered shopping assistance by analyzing natural language shopping queries and automating product searches on multiple e-commerce platforms.12
- FlicenseNot gradedqualityCmaintenanceEnables AI agents to perform web searches, extract webpage content, and conduct end-to-end search-and-extract operations using multiple search providers and content extraction methods.

dentro MCPofficial
AlicenseAqualityDmaintenanceProvides structured commerce data for AI agents, enabling real-time product searches and brand discovery across 22,000+ DTC brands without scraping or hallucination.531MIT
Related MCP Connectors
Agent-native product catalog for AI shopping agents. 296M+ products, 28 countries.
Product discovery for AI agents: ranked products and bundles from the open merchant web.
Web search, page extraction and structured commerce, social and business data for AI agents
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- 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/szqiel/promas'
If you have feedback or need assistance with the MCP directory API, please join our Discord server