Polovnjak MCP

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.

Category
访问服务器

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 common SourceAdapter interface: 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 like pa:12345678 or ma:3554254. Make names are alias-resolved per source ("VW" and "Volkswagen" both work everywhere); filters a source cannot express are reported as per-source warnings in 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 into listings and appends a price_observations row 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)

  1. 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/callback for local use).
  2. Configure the environment:
cp .env.example .env
# set GOOGLE_CLIENT_ID and GOOGLE_CLIENT_SECRET (and PUBLIC_URL for non-local deployments)
  1. Start everything (MCP server + Postgres + FlareSolverr):
docker compose up -d --build
  1. 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

  1. create_watch with a name and filters (optionally restricted to specific sources) — current matches become the baseline.
  2. Later (e.g. a scheduled prompt: "check my car watches"), check_watches returns only the listings that appeared since, per watch and per source.

Adding a new marketplace adapter

  1. Create src/adapters/<name>/ and implement the SourceAdapter interface from src/adapters/types.ts: pick a short stable id (used in composite listing ids), translate canonical SearchQuery filters into your provider's query, and map raw results into the canonical ListingSummary / ListingDetail shapes from src/domain/listing.ts.
  2. 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_history reflects 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

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 模型以安全和受控的方式获取实时的网络信息。

官方
精选