Skip to content

markes76/cars-il-pp-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

cars-il-pp-cli

Read-only Israeli used-car market intelligence CLI and MCP server for Yad2 Cars.

cars-il-pp-cli is built around one idea: used-car listings are market signals. Prices, mileage, ownership count, listing age, and Hebrew seller text can show buyer demand and seller urgency before official market data catches up.

Current status: Printing Press scorecard Grade A. Yad2 live search and local sync were smoke-tested successfully on 2026-05-17. This build is intentionally Yad2-only.

עברית

cars-il-pp-cli הוא כלי CLI ושרת MCP לקריאת מודעות רכב משומש בישראל בצורה בטוחה וקריאה בלבד. הכלי עובד היום מול יד2, שומר נתונים בעברית ב-SQLite, ומחשב תובנות כמו מחיר שוק, ציון עסקה, מודעות ישנות, היסטוריית מחיר וחום שוק.

סטטוס נוכחי: הכלי קיבל Grade A בציון Printing Press. חיפוש חי ביד2 וסנכרון מקומי נבדקו בהצלחה ב-17 במאי 2026. הגרסה הנוכחית מיועדת ליד2 בלבד.

What You Can Do

  • Search live Yad2 listings from the terminal.
  • Store Hebrew listings locally in SQLite with UTF-8 and FTS5 unicode61.
  • Search with English or Hebrew make/model names, for example Toyota or טויוטה.
  • Sync listings into a local database.
  • Compare listings side by side.
  • Score a listing against local market data.
  • Inspect stale listings that may indicate motivated sellers.
  • Calculate market summaries and market heat.
  • Use the MCP server from agent tools that speak JSON-RPC over stdio.

Install

From source, you need Go installed:

git clone https://github.com/markes76/cars-il-pp-cli.git
cd cars-il-pp-cli
go build -o cars-il-pp-cli ./cmd/cars-il-pp-cli
go build -o cars-il-pp-mcp ./cmd/cars-il-mcp

Or install directly with Go:

go install github.com/markes76/cars-il-pp-cli/cmd/cars-il-pp-cli@latest
go install github.com/markes76/cars-il-pp-cli/cmd/cars-il-mcp@latest

If go is not found, either install Go first or use the local binary from this Printing Press run. On this Mac, the MCP server is already available at:

/Users/mark.s/printing-press/library/cars-il/cars-il-pp-mcp

Local build paths from this Printing Press run:

/Users/mark.s/printing-press/library/cars-il/cars-il-pp-cli
/Users/mark.s/printing-press/library/cars-il/cars-il-pp-mcp

Quick Start

./cars-il-pp-cli doctor --json
./cars-il-pp-cli search --make Toyota --model Corolla --limit 5 --source yad2 --data-source live --json
./cars-il-pp-cli search --make "טויוטה" --model "קורולה" --city "תל אביב" --compact
./cars-il-pp-cli sync --make Toyota --model Corolla --limit 25 --source yad2
./cars-il-pp-cli market --make Toyota --model Corolla --data-source local --json

Hebrew values with spaces should be quoted:

./cars-il-pp-cli search --city "תל אביב"  # correct
./cars-il-pp-cli search --city תל אביב    # usually parsed as two arguments

התחלה מהירה בעברית

./cars-il-pp-cli doctor --json
./cars-il-pp-cli search --make "טויוטה" --model "קורולה" --limit 5 --source yad2 --data-source live --json
./cars-il-pp-cli sync --make "טויוטה" --model "קורולה" --limit 25 --source yad2
./cars-il-pp-cli market --make "טויוטה" --model "קורולה" --data-source local --json

Common Workflows

Find a hybrid around ₪50,000 with lower mileage:

./cars-il-pp-cli search \
  --fuel hybrid \
  --price-max 60000 \
  --mileage-max 140000 \
  --source yad2 \
  --data-source live \
  --limit 20 \
  --json

Find a 2020 Toyota Corolla under ₪95,000 in Tel Aviv:

./cars-il-pp-cli search \
  --make Toyota \
  --model Corolla \
  --year-min 2020 \
  --year-max 2020 \
  --price-max 95000 \
  --city "תל אביב" \
  --sort price-asc \
  --compact

Sync data before analytics:

./cars-il-pp-cli sync --make Toyota --model Corolla --limit 50 --source yad2
./cars-il-pp-cli market --make Toyota --model Corolla --json

Score a listing:

./cars-il-pp-cli deal --id yad2-1234 --json

Compare listings:

./cars-il-pp-cli compare --ids yad2-1234,yad2-5678 --data-source local

Show stale listings:

./cars-il-pp-cli stale --days 30 --make Toyota --model Corolla --data-source local

תהליכי עבודה נפוצים

חיפוש רכב היברידי סביב 50,000 ש"ח עם קילומטראז' נמוך:

./cars-il-pp-cli search \
  --fuel hybrid \
  --price-max 60000 \
  --mileage-max 140000 \
  --source yad2 \
  --data-source live \
  --limit 20 \
  --json

בדיקת מחיר שוק אחרי סנכרון:

./cars-il-pp-cli sync --make "טויוטה" --model "קורולה" --limit 50 --source yad2
./cars-il-pp-cli market --make "טויוטה" --model "קורולה" --json

בדיקת ציון עסקה:

./cars-il-pp-cli deal --id yad2-1234 --json

השוואת מודעות:

./cars-il-pp-cli compare --ids yad2-1234,yad2-5678 --data-source local

Commands

cars-il-pp-cli search
cars-il-pp-cli listings get --id <listing-id>
cars-il-pp-cli sync
cars-il-pp-cli watch
cars-il-pp-cli compare --ids <id1,id2,id3>
cars-il-pp-cli deal --id <listing-id>
cars-il-pp-cli price-history --id <listing-id>
cars-il-pp-cli stale --days 30
cars-il-pp-cli market
cars-il-pp-cli market-heat
cars-il-pp-cli depreciation --make <make> --model <model>
cars-il-pp-cli doctor
cars-il-pp-cli agent-context

Global flags:

--json
--csv
--compact
--select FIELDS
--quiet
--dry-run
--yes
--no-input
--no-color
--data-source auto|local|live
--source yad2
--limit N
--output-file PATH
--db PATH
--currency ILS|USD
--romanize
--agent

When stdout is not a terminal, output defaults to JSON. --json and --csv override that behavior.

Authentication And Cookies

Most Yad2 live searches currently work without cookies because the client reads public HTML payloads with browser-like headers. If Yad2 returns AUTH_FAILURE, use a fresh browser session cookie:

export CARS_IL_YAD2_COOKIE='paste-cookie-here'
./cars-il-pp-cli search --make Toyota --limit 5 --source yad2 --data-source live --json

Do not commit cookies. Do not paste cookies into issues, pull requests, or chat logs. Cookies are session credentials.

Database

Default database path is under the user cache directory. For testing, pass --db:

DB=/tmp/cars-il-test.db
./cars-il-pp-cli --db "$DB" sync --make Toyota --model Corolla --limit 10 --source yad2
./cars-il-pp-cli --db "$DB" search --make Toyota --data-source local --json

SQLite uses:

PRAGMA encoding = 'UTF-8';
CREATE VIRTUAL TABLE listings_fts USING fts5(
  id UNINDEXED,
  make,
  model,
  description,
  tokenize='unicode61'
);

Hebrew text is stored as original UTF-8, not transliterated.

MCP Server

Build:

go build -o cars-il-pp-mcp ./cmd/cars-il-mcp

The MCP server exposes the same operation names as the CLI over JSON-RPC stdio, including:

search
listings_get
sync
market
deal
price_history
stale
compare
depreciation
market_heat
doctor

The CLI remains the better interface for long-running watch workflows.

Claude Desktop Setup

This MCP server uses stdio. Claude launches it as a local subprocess, and the server only exposes read-only remote operations. sync writes to your local SQLite cache but does not write to Yad2.

  1. Build, install, or use the already-built MCP binary.

If Go is installed:

go install github.com/markes76/cars-il-pp-cli/cmd/cars-il-mcp@latest
which cars-il-mcp

If go is not found on this Mac, use this existing command path instead:

/Users/mark.s/printing-press/library/cars-il/cars-il-pp-mcp
  1. On macOS, edit Claude Desktop's config file:
open "$HOME/Library/Application Support/Claude/claude_desktop_config.json"
  1. Add this server entry. Replace the command path with the output of which cars-il-mcp if needed:
{
  "mcpServers": {
    "cars-il": {
      "type": "stdio",
      "command": "/Users/YOUR_USER/go/bin/cars-il-mcp",
      "args": [],
      "env": {
        "CARS_IL_YAD2_COOKIE": ""
      }
    }
  }
}
  1. Restart Claude Desktop.

  2. Ask Claude:

Use the cars-il MCP. First call context, then doctor, then search Yad2 for 5 Toyota Corolla listings.

If you do not want cookies in Claude Desktop config, leave the env values empty. Most current Yad2 live search tests worked without cookies.

Claude Code Setup

Claude Code supports adding stdio MCP servers from JSON. The official docs show the same type, command, args, and env shape for stdio servers.

claude mcp add-json cars-il '{
  "type": "stdio",
  "command": "/Users/YOUR_USER/go/bin/cars-il-mcp",
  "args": [],
  "env": {
    "CARS_IL_YAD2_COOKIE": ""
  }
}'

Then verify:

claude mcp list

MCP Safety Notes

  • Remote target-site traffic is GET-only.
  • No phone numbers are extracted or stored.
  • No account pages are scraped.
  • Cookies are optional and passed only via environment variables.
  • watch is intentionally not run as a long-lived MCP tool; use the CLI for background polling.
  • Keep --limit small in prompts when asking Claude to search live data.

Example safe prompt:

Use cars-il MCP to search Yad2 live for up to 5 hybrid cars under 60000 ILS. Summarize price, mileage, city, hand, and URL.

Exit Codes

0 success
2 invalid arguments
3 not found
4 auth failure
5 upstream API error
7 rate limited
9 dry-run completed

Errors are JSON on stderr:

{"error":{"code":"INVALID_ARGUMENTS","message":"this build supports Yad2 only; use --source yad2 or omit --source"}}

Safety And Ethics

  • GET-only against target sites.
  • No account scraping.
  • No phone-number extraction.
  • No hardcoded secrets.
  • 10-second request timeout.
  • Conservative request cadence and backoff on rate limits.
  • Users are responsible for complying with Yad2's terms of service.

Current Limitations

  • Yad2 has no public API; the adapter depends on public browser-rendered HTML payloads and may need updates if Yad2 changes its Next.js data shape.
  • Some live filters are applied client-side after fetching public search pages. For serious analysis, sync a wider cohort and run local filters.
  • Price history becomes useful only after repeated sync runs.

Detailed Guides

About

Read-only Israeli used-car market intelligence CLI and MCP server for Yad2 Cars

Topics

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages