geizhals-mcp

geizhals-mcp

An MCP server that lets an LLM search Geizhals, a leading German/DACH price-comparison site, for the cheapest offers on new products.

Category
访问服务器

README

geizhals-mcp

An MCP server that lets an LLM search Geizhals, a leading German/DACH price-comparison site, for the cheapest offers on new products. Built for self-hosting: one container, no API keys, no per-query credits.

Companion to jnslmk/kleinanzeigen-mcp — that one covers second-hand classifieds, this one covers new retail goods.

⚠️ Status: scaffolded, not yet smoke-tested. Geizhals sits behind a Cloudflare JS challenge, so this drives a real (patched, headed) browser to reach the page. The class-name-based selectors in scraper.py (_SEL) were written without live-HTML access and must be verified against real pages before the extraction can be trusted. The JSON-LD and product-href paths are designed to hold regardless. See Verifying the scraper.

Tools

Tool What it does
search_products Search by keyword, sort by price/relevance, filter by price band. Returns product summaries.
get_product Full detail — name, price range, per-merchant offers — for one product id.
get_products_batch Full details for several ids at once — the normal follow-up to a search.
search_by_url Search from a pasted Geizhals URL, preserving filters search_products cannot express.

The intended flow is search_products → pick interesting ids → get_products_batch. Search results omit the per-merchant offer tables so a broad search does not blow up the model's context window.

How it works

Geizhals has no public API and is fronted by Cloudflare's "Sichere Verbindung wird überprüft" JS challenge, which returns 403 to any plain HTTP client. So:

  • Browser: patchright (a patched, undetected Playwright fork) drives Chromium headed under Xvfb — a headed browser behind a virtual display clears Cloudflare far more reliably than headless from a datacenter IP.
  • Parsing: scraper.py prefers the page's application/ld+json Product block and the stable aNNNNNNN.html product hrefs, falling back to CSS selectors (collected in _SEL) for the human-readable fields.

Running it

docker run --rm -p 8000:8000 --shm-size=1g ghcr.io/jnslmk/geizhals-mcp:latest

Streamable HTTP at http://localhost:8000/mcp, plain GET /healthz for container healthchecks. Give the container at least 1.5 GB of memory and --shm-size=1g — Chromium maps its renderer heap into /dev/shm.

Configuration

Variable Default Purpose
MCP_TRANSPORT http http (streamable HTTP) or stdio
MCP_HOST 0.0.0.0 Bind address
MCP_PORT 8000 Bind port
MCP_PATH /mcp MCP endpoint path
GH_MAX_CONCURRENT 2 Concurrent browser contexts / scrapes
GH_MAX_RESULTS 40 Hard cap on products returned by a search
GH_MAX_BATCH_SIZE 10 Cap on ids per get_products_batch call
GH_CHALLENGE_TIMEOUT_MS 25000 How long to wait for Cloudflare to clear
GH_HEADLESS 0 1 runs headless (local dev without a display)
LOG_LEVEL INFO Python log level

LibreChat

mcpServers:
  geizhals:
    type: streamable-http
    url: "http://geizhals-mcp:8000/mcp"
    timeout: 180000
    chatMenu: true

mcpSettings:
  allowedAddresses:
    - "geizhals-mcp:8000"

allowedAddresses is required — LibreChat's SSRF guard blocks MCP URLs that resolve to private addresses, which a sibling container always does. The timeout is generous because a cold call starts a browser and waits out a Cloudflare challenge.

Claude Code

claude mcp add --transport http geizhals http://localhost:8000/mcp

Development

uv venv && uv pip install -e .
patchright install chromium
# Headless is fine for a quick check; headed (default) needs a display:
GH_HEADLESS=1 python -m geizhals_mcp

Verifying the scraper

The extraction was written without live-HTML access. Before trusting a release:

  1. Run the server and call search_products with a common term (e.g. RTX 4070).
  2. If results come back empty but the logs show no Cloudflare block, the row selectors in _SEL are stale — capture a real search page (page.content()), inspect it, and correct _SEL["row"], _SEL["row_price"] and _SEL["row_offercount"].
  3. Do the same for get_product against _SEL["offer_*"].
  4. If calls fail with a Cloudflare-timeout error, the datacenter IP is flagged — route egress through a residential/mobile proxy (see below).

Cloudflare and proxies

Cloudflare challenges are much harsher on datacenter IPs. If the headed-Xvfb browser cannot clear them from your host, point Chromium at a residential/mobile egress proxy. browser.py is the single place to add a proxy= argument to chromium.launch.

Images

ghcr.io/jnslmk/geizhals-mcp — multi-arch (linux/amd64, linux/arm64), built by GitHub Actions on native runners for each architecture.

Tag Meaning
latest Newest build of main
sha-<full-sha> A specific commit
v1.2.3, v1.2 Release tags

Caveats

Geizhals has no public API, so this scrapes the site with a headless browser. It can break whenever Geizhals change their markup or tighten Cloudflare, and heavy or parallel use will trip bot detection — particularly from a datacenter IP. Scraping is also at odds with Geizhals' terms of service. Keep it to personal-scale use; the conservative concurrency defaults exist for exactly this reason.

License

MIT — see LICENSE.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选