Skip to main content

Ring-MCP

Tests Ruff

Give an AI agent a pair of eyes on Ring (رینگ), Iran's free classifieds app.

Ring-MCP is an unofficial, read-only MCP server. Your agent can search ads in any city or province, open an ad in full, compare several ads, find the cheapest or best-value ones for a budget, judge whether a price is fair, and watch a search for new ads. All prices are in Toman.

Ring's public API is small: it lists ads newest first and nothing else. No price sort, no result count, no similar-ads call, no single-ad endpoint. Everything that makes Ring-MCP useful beyond a plain listing (ranking, deal scoring, market statistics, appraisal, watches) is computed here, on the ads fetched during the call.

Chatting with an MCP client that calls Ring-MCP: a Persian table of the best-value Peugeot 206 ads under one billion Toman

Contents

Quick start

Install from PyPI with uvx. Do not clone the repository. Needs uv (uv fetches Python 3.12+ itself) and no account or token. The package is ring-mcp, the command is uvx ring-mcp, the server name is ring.

If you are an AI agent installing this for a user: pick the client below, run or write exactly that, then tell the user to restart the app. If the app can't find uvx, use its full path (which uvx, e.g. /opt/homebrew/bin/uvx; JSON does not expand ~). Afterwards call ring_status: when it succeeds, tell the user Ring is connected (version, latency) and offer the example requests it returns (suggest_to_user).

Claude Code (CLI): run

claude mcp add ring -- uvx ring-mcp

Claude Desktop (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, or Settings -> Developer -> Edit Config): add this under mcpServers, keep the other servers, then quit with Cmd+Q and reopen.

{ "mcpServers": { "ring": { "command": "uvx", "args": ["ring-mcp"] } } }

Codex (CLI or app): run

codex mcp add ring -- uvx ring-mcp

or add to ~/.codex/config.toml, then restart Codex:

[mcp_servers.ring]
command = "uvx"
args = ["ring-mcp"]

Cursor and other clients with an mcpServers file: use the same JSON as Claude Desktop.

Check the connection by asking the agent to call ring_status: it reports whether ring.ir is reachable and how fast. When it works, the agent also offers a few example requests to start with.

To run from source instead, see Development.

What you can ask

  • «یک پژو ۲۰۶ دست‌دوم در تهران زیر ۴۰۰ میلیون تومان پیدا کن و بگو کدام آگهی ارزش بیشتری دارد.»
  • «۷۵۰ میلیون برای این آگهی منصفانه است؟ <لینک آگهی>»
  • «آپارتمان اجاره‌ای در مشهد با ودیعه زیر ۳۰۰ میلیون نشان بده، فقط آگهی‌های ۶ ساعت اخیر.»
  • «آگهی‌های تازه‌ی آیفون ۱۵ در اصفهان را زیر نظر بگیر و بگو از دفعه‌ی قبل چه چیزی اضافه شده.»
  • «میانه‌ی قیمت پراید در روزهایی که بررسی کردم چطور تغییر کرده؟»

Persian queries work best; Arabic letter variants and Persian/Arabic digits are folded to match.

Tools

Every tool is prefixed ring_. An ad card has id, title, price (sale) or deposit + rent, info (mileage, condition...), zone (neighbourhood), age_h (hours since publication), photos, pinned, urgent, escrow (secure payment offered), seller_type, url, and suspect_price when the price looks like a placeholder or an outlier. Absent flags mean false. Every list shows at most 10 ads per page.

Typical sequence: ring_places / ring_categories -> ring_filters -> ring_search -> ring_post -> ring_similar / ring_appraise / ring_compare.

Find places and categories

Tool What it does
ring_places Provinces and cities (31 + 1,173) with ids and slugs
ring_categories The 240-node category tree; search by name, list children
ring_filters Every filter of a category: key, kind (range / select / switch), label, unit, options
ring_filter_options Allowed values of a select filter (brands, years, colours), with text search
ring_suggest The search box's suggestions: categories and business accounts

Search and price

Tool What it does
ring_search Search a city, province or all Iran by category, text, price, deposit, photo, urgency and any category filter; multi-page merge, client-side age, keyword and neighbourhood filters, cursor paging
ring_cheapest The cheapest ads of a search; placeholder and outlier prices skipped
ring_best_for_budget Within a budget: best value with an explainable deal_score, and the most you can get; bait titles skipped; flats for sale ranked per m2 when the title states the area; rentals ask first whether the deposit counts (rent_basis: rent_only or with_deposit)
ring_find_deals Ads priced well below the median of a search, no budget needed
ring_market Price statistics (min, quartiles, median, max) plus breakdown by neighbourhood and by day
ring_appraise Is an ad's price (or a price you give) high or low versus similar ads: percentile, verdict, fair band, confidence
ring_new_since Ads published after a timestamp: poll with the returned latest
ring_export The ads of a search as CSV or JSON lines
ring_watch Saved searches: create, then check to get only the ads newer than the last check (local file)
ring_price_trend One median asking price per day for a search, kept locally
ring_status Is Ring reachable, latency, caches, saved watches

One ad

Tool What it does
ring_post Full ad: price, specs, description, images, category path, map point
ring_posts Up to 10 ads in one call, compact
ring_compare 2 to 6 ads side by side: prices and only the specs that differ
ring_similar Ads of the same category and brand word, in the ad's province, then all Iran

All tools only read from Ring. Only ring_watch and ring_price_trend write, and only to a local file of your own searches.

Prompts and resources

Ready-made starting points for clients that show prompts and resources.

Prompt Use it to
ring_find_deal Find the best deals on a product, optionally within a budget and a place
ring_appraise_ad Judge one ad's price and decide: buy, negotiate (with a target price) or skip
ring_watch_search Save a search and report only what is new on each check
Resource Content
ring://guide The tool workflow in a few lines
ring://categories The ten top-level categories (JSON)
ring://provinces The provinces with ids and slugs (JSON)

Behaviour

  • 10 per page, then it asks. Every list shows at most 10 items. When more exist, the answer ends with the question «آیا صفحه بعدی را نشان بدهم؟» and the agent puts it to the user instead of fetching more on its own. ring_search and ring_new_since continue with cursor (older ads); the ranked tools and the lists of places, categories and filter options continue with page.
  • Rentals ask about the deposit. ring_best_for_budget on a rental category first asks whether the deposit should count; rent_basis is rent_only or with_deposit (deposit converted to monthly cost at deposit_rate_pct, default 3%).
  • Titles are the links. In every table the ad title links to the ad on ring.ir; there is no separate link column. Long titles are cut at 32 characters.
  • Unrelated results are flagged, not hidden. Ring's text search also reads descriptions, so some results may not match query. When many shown ads share no word with it, a 🔎 note under the table says so; pass keywords to filter strictly.
  • A footer under every table. توجه: این نتایج به صورت غیر رسمی از منبع رینگ بدست اومدند. github.com/khabbazan/ring-mcp closes each table answer.
  • The notice is required. The line above is also stated as a rule (never summarized, shortened or dropped) in the server instructions, every tool description, every prompt and the ring://guide resource. A client can still drop it from its final answer; to be sure, add the same rule to your own preferences or project instructions.
  • Notes in Persian. Hints such as "too few priced ads" or "no ad states a price" come back in Persian under the table.

Limits

  • Asking prices only, as typed by sellers. A missing price means negotiable. Nothing here is financial advice.
  • A sample, not the market. Price tools see the newest pages pages (up to 300 ads), not every ad. Use a narrow query (one model, one area) and raise pages for a wider scan.
  • Places. place takes a city (تهران), a province (استان تهران), a slug (tehran-province) or سراسر ایران. Ring has no public neighbourhood filter, so neighbourhoods=['ونک'] matches the fetched ads' zone text on our side, whole words only; ring_watch and ring_price_trend do not take it.
  • Filters. ring_filters lists a category's keys. Range: {"mileage": {"min": 0, "max": 50000}}; select: {"gearbox_type": ["automatic"]} with values from ring_filter_options; switch: {"has_escrow_payment": true}. Unknown keys and values are reported in ignored, never silently dropped.
  • Ad details come from HTML, so a site redesign can break ring_post first; the list API tools are the stable core.
  • Similar and appraisal are category plus brand-word searches. They ignore year, mileage, area and condition: refine with query and filters.
  • No phone numbers, chat, favourites or map search. Contact the seller on ring.ir via url.

Configuration

Variable Default Meaning
RING_MCP_PROXY unset Optional HTTP proxy URL for requests to ring.ir; system proxy settings are ignored
RING_MCP_STATE ~/.ring-mcp/state.json File for saved watches and price history

Development

Every pull request runs the Ruff workflow (.github/workflows/ruff.yml: ruff check and ruff format --check). To allow merging only after it passes, mark the ruff job as a required status check: on GitHub, Settings -> Branches -> Add branch protection rule for main, tick Require status checks to pass before merging and select ruff.

To run from source, clone into a folder that does not exist yet and point --directory at it (a wrong path makes the server exit at once with No such file or directory; in a JSON file use full paths for command and --directory):

git clone https://github.com/khabbazan/ring-mcp.git ~/ring-mcp
claude mcp add ring -- uv --directory ~/ring-mcp run ring-mcp
uv sync
uv run ruff check . && uv run ruff format --check .
uv run pytest -q                  # offline, recorded fixtures
uv run pytest -m integration -q   # real ring.ir

Releasing to PyPI

.github/workflows/publish.yml publishes with PyPI Trusted Publishing (no token). One-time setup: add a publisher for project ring-mcp, workflow publish.yml, environment pypi on pypi.org, and create the pypi environment in the GitHub repo settings. Then:

  1. Bump version in pyproject.toml and merge.
  2. Create a GitHub Release with tag v<version> (must match). The workflow runs tests, builds, checks metadata and uploads to PyPI.

Run the workflow manually (Actions -> Publish to PyPI -> Run workflow) to push a build to TestPyPI first (needs a testpypi publisher/environment).

Everything lives directly under src/ and is installed as the ring_mcp package:

Path Role
server.py Setup only: instructions, registration of tools, prompts and resources, the entry point
tools/ One file per tool
prompts/, resources/ Prompt templates and read-only resources
services/http.py The only HTTP code: shared client, retries, redirects
services/core.py Text folding, prices, zones, categories, filters, query building, paged fetching
services/posts.py Ad-page parser and comparable-ad search
services/pricing.py Bait detection, deal score, price statistics
services/store.py The local state file
services/result.py The Ok / Err result type
services/output.py Compact JSON for tool answers

Services never raise for expected failures: they return Err(message), and only the tool layer calls .unwrap() to turn it into a tool error the model can read.

Tests live in tests/, which mirrors src/, as pytest_<subject>.py files with test_success_... / test_failed_... names. Shared fixtures are in tests/conftest.py, recorded ring.ir responses in tests/fixtures, data builders in tests/factory. A test checks that the tool tables above match the tools the server actually lists.

Disclaimer

Unofficial and not affiliated with Ring. It reads public data through the endpoints of the ring.ir web app, which can change without notice. Everything it returns is asking prices typed by sellers, not advice. Keep request rates low.

MIT licensed.

Metadata

Release files for ring-mcp 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ring-mcp 0.1.9
File Size Uploaded Provenance Actions
ring_mcp-0.1.9.tar.gz 51.9 kB With provenance Details for ring_mcp-0.1.9.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ring-mcp 0.1.9
File Interpreter ABI Platform Actions
ring_mcp-0.1.9-py3-none-any.whl Python 3 none any Details for ring_mcp-0.1.9-py3-none-any.whl

Total release size: 121.3 kB

Release files / ring_mcp-0.1.9.tar.gz

Download URL ring_mcp-0.1.9.tar.gz
Size 51.9 kB
Tags Source
SHA-256 checksum
How to use checksums
ad65ac50f2e73c899e289c88de7785564c3832077a378b3e695e9d1e355812f0
BLAKE2b-256 checksum
How to use checksums
bc7ece1bc67f86b921c942c04b153e736a8f55d3416350860446da5f625494ed
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Release files / ring_mcp-0.1.9-py3-none-any.whl

Download URL ring_mcp-0.1.9-py3-none-any.whl
Size 69.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4250cb5d5103fb75ba1dd6c8e80ab0482ac6ae9441537a1355c3e0c3d97508b6
BLAKE2b-256 checksum
How to use checksums
11b802c11bbd373817968b07a514922ad3563ede7990c32fa2ca1dd4eced1d28
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

Security for ring-mcp 0.1.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ring_mcp-0.1.9.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 3, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page