Skip to main content
Glama
kleinanzeigen-mcp

kleinanzeigen-mcp

by Samxel

An MCP server that lets an AI search Kleinanzeigen listings and pull ad and seller details. It wraps the Kleinanzeigen Android app's API (api.kleinanzeigen.de / gateway.kleinanzeigen.de) and returns the important fields to the AI.

Highlights

  • Visual Listing Analysis
    Downloads and analyzes the actual ad photos, allowing vision-capable AI to inspect an item's condition, wear, damage, completeness, and other visual details instead of relying only on the seller's description. Small by default, sharp enough to read a label when asked.

  • Filters the API doesn't have
    title_only, require and exclude are applied server-side here and page on automatically, so an AI gets the number of real matches it asked for instead of re-searching to work around accessories and wrong variants.

  • From discovery to full inspection
    Find relevant ads, then retrieve complete descriptions, itemised attributes, locations, seller reputation and all photos for a deeper analysis, for one ad or up to ten at once.

Related MCP server: willhaben-mcp

Setup

Pick one of two ways. Neither needs anything running in the background: the client starts the server when it needs it.

With uv, no clone. One command runs the current version straight from GitHub:

uvx --from git+https://github.com/Samxel/kleinanzeigen-mcp kleinanzeigen-mcp --stdio

From a clone. Requires Python 3.10+.

git clone https://github.com/Samxel/kleinanzeigen-mcp
cd kleinanzeigen-mcp
pip install -r requirements.txt
python main.py --stdio

uv run main.py --stdio also works without the pip install: main.py declares its own dependencies.

Add it to Claude (and other MCP clients)

Claude Code

One command, no config file:

claude mcp add kleinanzeigen -- uvx --from git+https://github.com/Samxel/kleinanzeigen-mcp kleinanzeigen-mcp --stdio

From a clone, point it at main.py instead:

claude mcp add kleinanzeigen -- python /path/to/kleinanzeigen-mcp/main.py --stdio

Add --scope user to have it in every project instead of only the current one. claude mcp list shows whether the connection came up, claude mcp remove kleinanzeigen takes it out again.

Claude Desktop

Open Settings > Developer > Edit Config, add the kleinanzeigen entry to claude_desktop_config.json and restart Claude Desktop:

{
  "mcpServers": {
    "kleinanzeigen": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Samxel/kleinanzeigen-mcp", "kleinanzeigen-mcp", "--stdio"]
    }
  }
}

From a clone, use "command": "python" and "args": ["C:\\path\\to\\kleinanzeigen-mcp\\main.py", "--stdio"] (the full path to main.py, forward slashes on macOS/Linux).

Custom connectors (Settings > Connectors) connect from Anthropic's cloud, so they cannot reach a server running only on your own machine. To use the tools in claude.ai and the mobile apps, expose the HTTP server (see Run it yourself) through cloudflared, ngrok or a box with a public hostname, and add that HTTPS URL under Settings > Connectors > Add custom connector. Anyone who finds the URL can use the server too, though, so put authentication in front of it.

Every tool is marked read-only, so clients that honour that hint won't ask before each call. In Claude Desktop you can also open Settings > Connectors > kleinanzeigen and set the tools' dropdown on the right to Always allow.

Cursor, Codex, VS Code and other JSON-config clients

The same entry as for Claude Desktop, in the client's MCP config:

{
  "mcpServers": {
    "kleinanzeigen": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/Samxel/kleinanzeigen-mcp", "kleinanzeigen-mcp", "--stdio"]
    }
  }
}

Clients that connect to a URL instead take "type": "http" and "url": "http://127.0.0.1:8020/mcp", with the server started as below.

Run it yourself

Without --stdio, the server starts over streamable HTTP and prints where it's listening:

python main.py
Starting kleinanzeigen-mcp server on http://127.0.0.1:8020/mcp

Point your client at that URL, e.g. claude mcp add --transport http kleinanzeigen http://127.0.0.1:8020/mcp. Host, port and path live at the top of kleinanzeigen/server.py; the port differs from geizhals-mcp (8000) and willhaben-mcp (8010), so all three can run side by side. Installed with pip or uv, the kleinanzeigen-mcp command and python -m kleinanzeigen do the same as python main.py.

Tools

Results come as compact JSON, and fields without a value are left out. Every hit and ad carries its url; the server instructions ask the AI to link every ad it names.

Search by free-text keyword and/or category (id or name; a name matches the way a model writes it, so "Handys" finds "Handy & Telefon" and "Laptop" finds "Laptops & Notebooks", and a miss suggests the closest categories). Filters for category-specific attributes, location/radius or postcode, price range, offer/wanted, private/commercial, shipping and "Direkt kaufen", plus sorting and paging (rows up to 30).

Client-side filters, applied here over what Kleinanzeigen returns, paging on until rows matches turn up or 250 ads were scanned:

  • title_only: every word of query must be in the title

  • require: terms that must appear in title or description ("128gb" matches "128 GB" too). This is where specs belong: sellers write the same storage size several ways and often leave it out of the title.

  • exclude: drop ads whose title carries these ("kabel" catches "Ladekabel", "pro" spares "Prozessor")

Paid "TOP" placements are left out unless include_top_ads=True. They sit above any sort order and are mostly repair shops and buyers ("Ankauf"), not the item. Each hit says whether it ships and how many photos it has (image_count). total, next_offset and has_more say where to continue; next_offset points at the exact ad a filtered search stopped at, so no match is skipped between pages.

Everything about one ad: full description, attributes by the label the ad page shows ("Zustand", "Speicher", ...), category, location, shipping options, the seller's rating and how many photos it has. Pass up to 10 ids instead of ad_id to compare several in one call; they come back as {count, ads, failed}, and an ad that is gone lands in failed instead of failing the rest.

Download an ad's photos server-side (at most 10) and return them as real image content, so a vision-capable client sees the pictures instead of just URLs. detail="low" (300×400, about 160 tokens per photo) is enough for condition and completeness; detail="high" (720×960, about 900 tokens) reads small print such as a label, a serial number or a screen.

Name, private vs commercial, member-since date, ad counts, followers, reply speed and Kleinanzeigen's reputation score. The profile half is guarded by IP-range anti-fraud and can fail from VPN or datacenter addresses; partial then says so and the reputation still comes back.

Look up location ids for the location_id filter by name prefix: states, cities and districts (at most 50 per call; count says how many matched). For a postcode, pass zip_code to the search instead.

The attribute filters the search's attributes argument takes for one category, straight from Kleinanzeigen's own search-options schema, with each filter's values as a value-to-label map ({"bmw": "BMW"}). They narrow far better than extra words in query: in "PC-Zubehör & Software" they cut a search down to grafikkarten or mainboards outright. A category with long value lists (cars list every make) can be narrowed to one filter with key, by key or label ("autos.marke" or "Marke").

Browse the category tree for the ids the search takes, each with its path (at most 100 per call). The tree (159 categories) ships with the server in kleinanzeigen/data/categories.json, so this costs no request. It stops fairly high up: finer cuts like "Grafikkarten" are attribute filters.

Disclaimer

This is an independent, unofficial project and is not affiliated with, endorsed by, or connected to Kleinanzeigen or Adevinta. "Kleinanzeigen" and all related trademarks belong to their respective owners.

It uses an unofficial interface of the Kleinanzeigen app, which can change or go away at any time. You are responsible for how you use it: respect Kleinanzeigen's Terms of Service and applicable law, don't hammer their servers, and don't collect personal data from listings.

If you're a rights holder and have a concern about this repository, please open an issue and I'll respond promptly.

License

MIT LICENSE. Provided "as is", without warranty.

Available Tools

7 tools
get_ad_detailA
Read-only

One ad in full: the complete description, attributes by their label ("Zustand", "Versand", ...), category, location, shipping options, seller and image_count. To compare several, pass up to 10 ids instead; they come back as {count, ads, failed}.

Args: ad_id: The ad id from a search. ids: Several ad ids, instead of ad_id.

Inputs: ids, ad_id.

get_ad_imagesA
Read-only

The ad's photos as images you can look at, up to max_images (at most 10). Use them whenever the answer depends on what the item looks like: condition, damage, completeness, or details only a picture shows, such as a label or a screen.

Args: ad_id: The ad id from a search. max_images: How many photos to fetch. Default 4. detail: "low" (300x400, enough for condition and completeness) or "high" (720x960, about six times the tokens) to read small print such as a label, serial number or screen.

Inputs: ad_id (required), detail, max_images.

get_category_filtersA
Read-only

The attribute filters of a category, for the attributes of search_kleinanzeigen: [{key, label, type, multi_select, values}], where values maps each value to its label ({"bmw": "BMW"}) and is left out for free-form attributes.

Args: category: Category id or name. key: Only this attribute (a key or a label, e.g. "autos.marke" or "Marke"), when the category has many with long value lists.

Inputs: category (required), key.

get_seller_infoA
Read-only

Who sells an ad: name, private or commercial, member since, ads run, followers, reply speed and reputation score. For a trust check the ad itself does not answer.

The profile half is guarded by IP-range anti-fraud and can fail from VPN or datacenter addresses; partial then says so and the reputation still comes back.

Args: seller_id: seller_id from a search hit or ad detail.

Inputs: seller_id (required).

list_categoriesA
Read-only

Find category ids for search_kleinanzeigen and get_category_filters. Returns {count, categories: [{id, path}]}.

Args: query: Part of the category path, e.g. "pc-zubehör". Omit to list everything up to limit. limit: At most 100. Default 40.

Inputs: limit, query.

search_kleinanzeigenA
Read-only

Search Kleinanzeigen listings. Needs a query, a category or both.

A bare query matches the whole ad text and drags in accessories, bundles and spare parts, so scope to a category when you can, and use attributes over extra words.

Put the model in query and every spec in require. Sellers write "128GB", "128 GB" or leave it out of the title, so query="iPhone 13", require=["128gb"] finds what query="iPhone 13 128 GB" misses.

These filters run here, paging on until rows matches turn up or 250 ads were scanned (scanned):

  • title_only: every query word must be in the title.

  • require: every term must be in the title or description; a number with its unit matches however it is spelled.

  • exclude: drop titles carrying any of these words, e.g. ["pro", "max"]. A word also hits the tail of a compound ("kabel" in "Ladekabel"), never a prefix ("pro" spares "Prozessor"). Don't exclude ordinary nouns like "akku" or "display", real listings use them too.

A missing price_amount is normal: price_type then says "FREE" (zu verschenken) or "PLEASE_CONTACT" (VB); with a price, PLEASE_CONTACT means negotiable.

Args: query: Search words. category: Category id or name; includes its subcategories. attributes: Category filters, e.g. {"pc_zubehoer_software.art": "grafikkarten"}; a multi_select one also takes a list. Keys and values come from get_category_filters. location_id: From search_locations. zip_code: A German postcode, instead of location_id. distance_km: Radius around the location or postcode. min_price / max_price: Price bounds. ad_type: "OFFERED" (Ich biete) or "WANTED" (Ich suche). poster_type: "PRIVATE" or "COMMERCIAL". sort: Default "RECOMMENDED"; "DISTANCE_ASCENDING" needs a location. picture_required / buy_now_only / shippable: Only ads with photos / "Direkt kaufen" / shipping. include_top_ads: Also return paid "TOP" placements (is_top_ad). They are pinned above any sort order and mostly repair shops and buyers, so they are left out by default.

Inputs: rows, sort, query, offset, +17 more.

search_locationsA
Read-only

Find location ids for the location_id filter of search_kleinanzeigen by name prefix: states, cities and districts. For a postcode, pass zip_code to the search instead.

Args: query: Start of the name, e.g. "berl". limit: At most 50. Default 10.

Inputs: query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.3/5.0

    Scored across 7 tools

    Disambiguation5/5

    Each tool targets a clearly distinct resource or action: listing search, ad detail, ad images, seller profile, location lookup, category filters, and category listing. The two helper lookups (search_locations, list_categories) are unambiguous because each feeds a different filter of search_kleinanzeigen. The split between get_ad_detail and get_ad_images is explicitly justified (text vs. visual inspection), so there is no real overlap.

    Naming Consistency4/5

    All names are snake_case and verb-first (search_, get_, list_), which makes the set predictable. The one deviation is search_kleinanzeigen, which names the site rather than the resource (unlike search_locations), so a more parallel name like search_ads would have fit the pattern better.

    Tool Count5/5

    Seven tools is a tight, well-scoped surface for a marketplace search server, and each tool maps to a step in a real workflow (find category/location -> filter attributes -> search -> inspect ad -> check seller). Nothing feels redundant or missing at the count level.

    Completeness4/5

    The read-side lifecycle is well covered: discovery (categories, locations, filters), search with rich filters, detail, images, and seller reputation. The only gaps are write/interaction operations such as contacting a seller or managing watchlists/postings, which agents can work around since the server appears intentionally read-only.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables AI assistants to search willhaben.at marketplace listings and retrieve full ad details, using filters for category, condition, size, color, pattern, brand, and more.
      11
      6
      MIT
    • F
      license
      Not graded
      quality
      Not graded
      maintenance
      Enables read-only access to Kleinanzeigen.de listings, including compact search, listing details, availability checks, and route calculations with optional distance and driving information.
      -
    • A
      license
      A
      quality
      B
      maintenance
      Enables Claude or any MCP client to search offers on kleinanzeigen.de, resolve locations, browse categories, and read individual listing details. It provides read-only access to public listings without login, purchasing, messaging, or ad creation.
      4
      MIT