Polovnjak MCP
Enables agents to search and analyze used-vehicle listings across multiple Serbian marketplaces, including price statistics, history, and per-user saved-search watches.
README
Polovnjak MCP
A multi-provider MCP server for used-vehicle marketplaces. Agents get one unified tool surface — search, listing details, price statistics, price history, and per-user saved-search watches — backed by pluggable marketplace adapters. Included adapters: polovniautomobili.com (source id pa) and mojauto.rs (source id ma), both Serbia.
Users sign in with Google via the standard MCP OAuth 2.1 flow; watches are private per user. Every listing the hub observes (from any user's searches, stats sampling, or watch checks) is recorded into a shared Postgres "market memory" that powers price history and trend queries no single marketplace offers.
Architecture
- Adapters (
src/adapters/) implement a commonSourceAdapterinterface:search,getListing,getMakesModels, plus capability flags. Each adapter translates the canonical filters into its provider's query and maps results back into a canonical listing model. Listings carry composite ids likepa:12345678orma:3554254. Make names are alias-resolved per source ("VW" and "Volkswagen" both work everywhere); filters a source cannot express are reported as per-sourcewarningsin results. - Tools (
src/tools/) fan out across adapters and merge results, tagging everything with its source. Categories cover cars, motorcycles, vans, light/heavy trucks, buses, trailers, campers, machinery, tractors, boats, and bicycles. - Recorder (
src/recorder.ts) upserts every observed listing intolistingsand appends aprice_observationsrow on first sighting or price change. - Auth (
src/auth/) is a self-hosted OAuth 2.1 authorization server (dynamic client registration, PKCE, refresh tokens) with Google OIDC as the identity layer. Tokens are stored hashed in Postgres. - Storage is Postgres via Drizzle ORM; migrations run automatically at startup.
Quick start (Docker Compose)
- Create a Google OAuth client at Google Cloud Console (type "Web application") with authorized redirect URI
<PUBLIC_URL>/auth/google/callback(e.g.http://localhost:8321/auth/google/callbackfor local use). - Configure the environment:
cp .env.example .env
# set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET (and PUBLIC_URL for non-local deployments)
- Start everything (MCP server + Postgres + FlareSolverr):
docker compose up -d --build
- Point your MCP client at
http://localhost:8321/mcp. The client will discover the OAuth metadata, register itself, and open a browser window for Google sign-in. Everything after that is per-user.
For a quick local test without Google credentials, set AUTH_MODE=none — the server then skips auth and uses a single local dev user.
Tools
| Tool | Purpose |
|---|---|
list_sources |
Registered marketplace sources with coverage and capability flags. Source ids are used in the sources param of other tools and in composite listing ids. |
search_listings |
One page of normalized listings per source, merged and source-tagged. Filters: category, make/models, price/year/mileage/power ranges, fuel, body, gearbox, region/city, condition flags. Listings include previousPrice when the source shows a discount; per-source warnings explain any filter a source could not apply natively. |
get_listing |
Full detail for one listing by composite id (pa:12345678, ma:3554254), URL, or bare id: specs, equipment, description, photos, seller contact. |
get_makes_and_models |
Per-source taxonomy: makes, models of a make, regions, accepted filter values, city-name resolution. |
get_price_stats |
Live market snapshot: min/p25/median/avg/p75/max + per-year breakdown, per source and combined, sampled from up to maxPages result pages per source. |
get_price_history |
Answered from the hub's own recorded observations: a single listing's price timeline (repricing detection) or a month-by-month trend for a segment (make/model/year). Coverage grows with usage. |
create_watch / list_watches / delete_watch / check_watches |
Per-user saved searches across one or more sources. check_watches returns only listings that appeared since the last check — ideal for a scheduled daily prompt. |
Agent skill
The repo ships an agent skill at .cursor/skills/car-market-hub/SKILL.md that teaches LLM agents how to use this server effectively (tool workflows, gotchas), with per-client connection guides for OpenAI, Claude, LibreChat, and Cursor in clients.md. Cursor picks it up automatically; for other platforms, copy the skill directory into that platform's skills location (e.g. .claude/skills/) or paste its contents into the agent's instructions.
Watch workflow
create_watchwith a name and filters (optionally restricted to specificsources) — current matches become the baseline.- Later (e.g. a scheduled prompt: "check my car watches"),
check_watchesreturns only the listings that appeared since, per watch and per source.
Adding a new marketplace adapter
- Create
src/adapters/<name>/and implement theSourceAdapterinterface from src/adapters/types.ts: pick a short stableid(used in composite listing ids), translate canonicalSearchQueryfilters into your provider's query, and map raw results into the canonicalListingSummary/ListingDetailshapes from src/domain/listing.ts. - Register it in src/server.ts with
registerAdapter(...).
Search fan-out, watches, recording, and price history pick the new source up automatically.
Environment variables
| Variable | Default | Meaning |
|---|---|---|
PORT |
8080 |
HTTP listen port. |
PUBLIC_URL |
http://localhost:<PORT> |
Public base URL; OAuth issuer and Google callback host. |
DATABASE_URL |
postgres://carhub:carhub@localhost:5432/carhub |
Postgres connection string. |
AUTH_MODE |
oauth |
oauth (Google-backed OAuth 2.1) or none (single local dev user, no auth). |
GOOGLE_CLIENT_ID / GOOGLE_CLIENT_SECRET |
— | Google OAuth credentials (required in oauth mode). |
FLARESOLVERR_URL |
— | Optional FlareSolverr instance for Cloudflare-challenge fallback. |
CACHE_TTL_MS |
600000 |
Upstream response cache TTL. |
FETCH_CONCURRENCY |
5 |
Max concurrent upstream requests per adapter. |
REQUEST_TIMEOUT_MS |
25000 |
Upstream request timeout. |
Local development
npm install
docker compose up -d postgres # or point DATABASE_URL at your own Postgres
AUTH_MODE=none npm run dev # server on http://localhost:8080/mcp
Schema changes: edit src/db/schema.ts, then npm run db:generate to produce a new migration under drizzle/ (applied automatically at startup).
Notes and limits
- polovniautomobili.com has no public API; the adapter reads the site's Next.js data endpoints using Chrome TLS impersonation (impit), with FlareSolverr as Cloudflare-challenge fallback. Use responsibly and respect the site's terms of service.
- Prices below 100 EUR are treated as "price on request" and excluded from stats and observations.
- Watch checks scan the first two result pages (~50 newest listings) per source.
get_price_historyreflects only listings observed through this hub — it is a growing sample, not the full market.- The previous single-provider implementation is kept for reference in
old/(not part of the build).
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。