Skip to main content
Glama
kleinanzeigen-mcp

kleinanzeigen-mcp

by Samxel
README.md
<h1 align="center">kleinanzeigen-mcp</h1>

<p align="center"><sub>From the same series: <a href="https://github.com/Samxel/geizhals-mcp">geizhals-mcp</a> · <a href="https://github.com/Samxel/willhaben-mcp">willhaben-mcp</a> · <a href="https://github.com/Samxel/rabatt-mcp">rabatt-mcp</a></sub></p>

An MCP server that lets an AI search [Kleinanzeigen](https://www.kleinanzeigen.de)
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.

<p align="center">
  <a href="https://www.kleinanzeigen.de/"><img alt="Listings" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FSamxel%2Fkleinanzeigen-mcp%2Fcoverage%2Fcoverage.json&query=%24.listings&label=Listings&color=green&suffix=%20live&cacheSeconds=3600"></a>
  <a href="https://themen.kleinanzeigen.de/ueber-uns/"><img alt="Monthly visitors" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FSamxel%2Fkleinanzeigen-mcp%2Fcoverage%2Fcoverage.json&query=%24.visitors&label=Visitors&color=ff7300&suffix=%20%2Fmonth&cacheSeconds=3600"></a>
  <a href="https://themen.kleinanzeigen.de/ueber-uns/"><img alt="Commercial users" src="https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fraw.githubusercontent.com%2FSamxel%2Fkleinanzeigen-mcp%2Fcoverage%2Fcoverage.json&query=%24.commercial_users&label=Commercial%20users&color=1e6fff&cacheSeconds=3600"></a>
</p>

<p align="center">
  <a href="#highlights">Highlights</a> ·
  <a href="#setup">Setup</a> ·
  <a href="#add-it-to-claude-and-other-mcp-clients">Add to Claude</a> ·
  <a href="#run-it-yourself">Run</a> ·
  <a href="#tools">Tools</a> ·
  <a href="#disclaimer">Disclaimer</a> ·
  <a href="#license">License</a>
</p>

<p align="center"><sub><a href="README.de.md">Diese Anleitung auf Deutsch</a></sub></p>

## 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.

## Setup

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

**With [uv](https://docs.astral.sh/uv/), no clone.** One command runs the
current version straight from GitHub:

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

**From a clone.** Requires Python 3.10+.

```bash
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:

```bash
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:

```bash
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:

```json
{
  "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](#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:

```json
{
  "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:

```bash
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.

<details>
<summary><code>search_kleinanzeigen(query, ...)</code>: search listings by keyword and/or category</summary>

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.

</details>

<details>
<summary><code>get_ad_detail(ad_id | ids)</code>: get one ad, or up to ten, in full</summary>

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.

</details>

<details>
<summary><code>get_ad_images(ad_id, max_images=4, detail="low")</code>: look at an ad's photos</summary>

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.

</details>

<details>
<summary><code>get_seller_info(seller_id)</code>: see who is selling</summary>

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.

</details>

<details>
<summary><code>search_locations(query, limit=10)</code>: find a location id</summary>

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.

</details>

<details>
<summary><code>get_category_filters(category, key)</code>: list a category's attribute filters</summary>

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"`).

</details>

<details>
<summary><code>list_categories(query, limit=40)</code>: look up category ids</summary>

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.

</details>

## 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`](LICENSE). Provided "as is", without warranty.

<p align="center"><sub><a href="README.de.md">Diese Anleitung auf Deutsch</a></sub></p>

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