Skip to main content
Glama

lbc-mcp

Serveur MCP qui permet à Claude de chercher des annonces Leboncoin : recherche multi-critères, pages enchaînées, export CSV/JSON, détail d'une annonce et profil du vendeur.

Tout l'accès à Leboncoin repose sur lbc d'etienne-hd, qui interroge l'API mobile du site. Ce serveur se contente d'exposer lbc à Claude, en y ajoutant ce qui manque pour un usage conversationnel : localisation par nom de ville, filtres tolérants, pagination, espacement des requêtes, export.

Les outils

Outil

Rôle

search_ads

Recherche par mots-clés, catégorie, ville + rayon, départements, régions, prix, type de vendeur, livraison, filtres avancés (surface, kilométrage, année…), ou directement à partir d'une URL de recherche leboncoin.fr. Récupère jusqu'à 50 pages d'un coup et peut tout écrire dans un fichier CSV ou JSON.

get_ad

Détail complet d'une annonce (description, photos, attributs, favoris) à partir de son identifiant ou de son URL.

get_seller

Profil d'un vendeur : note, nombre d'avis, ancienneté, taux de réponse et, pour un professionnel, sa boutique (SIRET, adresse, site).

Quelques demandes qu'on peut faire à Claude une fois le serveur branché :

  • « Trouve des Nintendo Switch OLED à moins de 200 € autour de Lyon, particuliers seulement, les plus récentes d'abord. »

  • « Exporte en CSV toutes les annonces de Clio 4 diesel de moins de 100 000 km en Gironde et donne-moi le prix médian. »

  • « Voici une recherche que j'ai faite sur le site : https://www.leboncoin.fr/recherche?… Récupère les 5 premières pages et repère les meilleures affaires. »

  • « Le vendeur de cette annonce est-il fiable ? https://www.leboncoin.fr/ad/… »

Related MCP server: leboncoin-mcp

Installation

Il faut Python 3.10 ou plus récent.

git clone https://github.com/BPiroga/lbc-mcp.git
cd lbc-mcp
python -m venv .venv
.venv\Scripts\python -m pip install -e .

(Sous macOS ou Linux, remplacer .venv\Scripts\python par .venv/bin/python.)

Brancher le serveur sur Claude Desktop

Ouvrir %APPDATA%\Claude\claude_desktop_config.json (menu Paramètres → Développeur → Modifier la configuration) et ajouter le serveur, avec le chemin réel du dossier :

{
  "mcpServers": {
    "leboncoin": {
      "command": "C:\\Users\\<vous>\\lbc-mcp\\.venv\\Scripts\\python.exe",
      "args": ["-m", "lbc_mcp"]
    }
  }
}

Puis redémarrer Claude Desktop.

Brancher le serveur sur Claude Code

claude mcp add leboncoin -- C:\Users\<vous>\lbc-mcp\.venv\Scripts\python.exe -m lbc_mcp

Sans cloner le dépôt, avec uv

uvx --from git+https://github.com/BPiroga/lbc-mcp lbc-mcp

Réglages

Tous facultatifs, à passer en variables d'environnement (clé "env" dans la configuration de Claude Desktop).

Variable

Défaut

Effet

LBC_MIN_INTERVAL

2

Secondes minimales entre deux requêtes à Leboncoin.

LBC_PROXY

aucun

Proxy à utiliser, forme http://utilisateur:motdepasse@hote:port.

LBC_IMPERSONATE

chrome_android

Navigateur dont lbc imite l'empreinte TLS (voir ci-dessous).

LBC_EXPORT_DIR

Téléchargements\leboncoin

Dossier des exports CSV/JSON.

Gros volumes et blocages

Leboncoin est protégé par Datadome, qui trie d'abord les clients d'après leur empreinte TLS. lbc en choisit une au hasard parmi quatre navigateurs ; lors des essais (septembre 2026), seule chrome_android passait (8 fois sur 8), les trois autres étant refusées dès la première requête. Utilisé tel quel, lbc échoue donc environ trois fois sur quatre. Le serveur fixe chrome_android par défaut ; si Datadome change de règles, LBC_IMPERSONATE permet d'en essayer une autre (chrome, edge, safari, safari_ios, firefox…).

Le débit toléré, lui, n'est pas connu. Par prudence, le serveur espace ses requêtes d'au moins deux secondes, et s'il est bloqué au milieu d'une récupération de plusieurs pages, il rend ce qu'il a déjà obtenu au lieu de tout perdre.

Pour de gros volumes :

  • demander un export (export_format) plutôt que d'afficher les annonces dans la conversation : 100 annonces par page, jusqu'à la limite de pagination du site (environ 3 500 annonces par recherche) ;

  • augmenter LBC_MIN_INTERVAL si les blocages se répètent ;

  • passer par un proxy résidentiel situé en France (LBC_PROXY), comme le recommande lbc.

Particularités

  • Villes. lbc attend des coordonnées GPS. Le serveur les obtient auprès de l'API publique geo.api.gouv.fr : on peut donner un nom de commune, un code postal, ou Saint-Denis (974) pour lever une homonymie.

  • Départements. Les listes de lbc couvrent la métropole hors Corse ; pour la Corse et l'outre-mer, il faut passer par les régions.

  • Export CSV. Séparateur point-virgule, UTF-8 avec BOM et virgule décimale : le fichier s'ouvre directement dans Excel en français, accents et nombres compris.

  • Tri par prix. Dans lbc 1.1.6, Sort.CHEAPEST et Sort.EXPENSIVE sont inversés. Le serveur choisit le tri d'après sa valeur réelle (price/asc ou desc), ce qui restera juste quand lbc sera corrigé.

  • URL de recherche. Le serveur décode l'URL et remet ses paramètres dans un ordre que lbc accepte, avant de la lui passer. Le paramètre page de l'URL est respecté.

Développement

.venv\Scripts\python -m pip install -e ".[dev]"
.venv\Scripts\python -m pytest

Les tests n'interrogent pas Leboncoin. Pour un essai réel de bout en bout (quelques requêtes, espacées) : .venv\Scripts\python scripts\smoke_test.py.

Avertissement

Projet personnel, sans lien avec Leboncoin. Il interroge une API non documentée qui peut changer à tout moment ; l'usage doit rester raisonnable et conforme aux conditions d'utilisation du site.

Licence

MIT. lbc est également sous licence MIT.

Available Tools

3 tools
get_adDetail d'une annonce LeboncoinA
Read-only

Detail complet d'une annonce : description, photos, tous les attributs, coordonnees, nombre de favoris et identifiant du vendeur (seller_id).

ParametersJSON Schema
NameRequiredDescriptionDefault
adYesIdentifiant numerique ou URL de l'annonce.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations already declare readOnlyHint and openWorldHint, so the description only needs to add useful context; it lists the ad attributes and the presence of seller_id, which is helpful. It does not cover error cases, authentication needs, or rate limits, but for a simple read-only operation this is not a major omission. No contradiction with annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one efficient sentence: the purpose is front-loaded, followed by a colon-separated list of returned content. There is no filler or redundancy; every part adds useful information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read-only tool with an output schema and openWorldHint, the description is largely sufficient and even enumerates the expected output fields. It could be slightly stronger with explicit sibling routing or failure behavior, but nothing essential for a correct call is missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema already documents the only parameter fully: 'Identifiant numerique ou URL de l'annonce.' The description adds no additional parameter-level semantics or format guidance, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb and resource: 'Detail complet d'une annonce' and lists the exact contents returned (description, photos, attributes, contact info, favorites, seller_id). This makes the tool's purpose unambiguous and distinguishes it from siblings: it returns full detail of one ad, not search results or seller data.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the right context: use this tool when full details of a single ad are needed, identified by an ad ID or URL. However, it does not explicitly say when not to use it or mention alternatives such as search_ads for listing discovery or get_seller for seller-focused information.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_sellerProfil d'un vendeur LeboncoinA
Read-only

Profil d'un vendeur : anciennete, note sur 5 et nombre d'avis, taux et delai de reponse, nombre d'annonces en ligne, et pour un professionnel sa boutique (SIRET, adresse, site web).

ParametersJSON Schema
NameRequiredDescriptionDefault
sellerYesseller_id renvoye par get_ad, ou identifiant/URL d'une annonce du vendeur.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The annotations already declare readOnlyHint=true and openWorldHint=true, so the safety profile is established. The description adds the payload contents and the conditional professional-shop field, which is useful but does not disclose behavior for edge cases such as unknown sellers or missing professional data. With annotations covering the main behavior, a 3 is appropriate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, compact sentence that front-loads the purpose and then lists the returned fields in a clear semicolon-separated structure. Every word earns its place and there is no filler.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a one-parameter read-only lookup with full schema coverage and an output schema present, the description is largely complete. It covers the returned data well and the parameter description implies how to obtain the seller identifier. Explicit routing from get_ad could improve it, but is not a significant gap.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 100% and the single seller parameter is well documented in the schema as the seller_id from get_ad or an ad identifier/URL. The description itself adds no extra parameter-level meaning, so the baseline of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the resource ('Profil d'un vendeur') and enumerates the specific data returned: anciennete, note, avis, response metrics, active listings, and professional shop details. It is distinguishable from get_ad and search_ads because it focuses on seller-level profile data rather than ads or searches, though it lacks an explicit action verb.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

There is no explicit when-to-use or when-not-to-use statement. However, the schema's parameter description says the seller is a seller_id returned by get_ad or an ad URL, which implies this is the follow-up tool for seller-level information. The usage context is present but not made explicit.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_adsRechercher des annonces LeboncoinA
Read-only

Recherche des annonces sur Leboncoin.

Renvoie les totaux du site, des statistiques de prix sur les annonces recuperees et, pour chacune : id, titre, prix, date, lieu, categorie, URL et attributs utiles (etat, kilometrage, surface...). next_page indique la page a demander pour continuer. Pour le detail d'une annonce (description, photos, vendeur), utiliser get_ad.

ParametersJSON Schema
NameRequiredDescriptionDefault
urlNoURL d'une recherche faite sur leboncoin.fr. Si fournie, elle remplace tous les autres criteres (seuls limit, page, pages et export_format comptent).
cityNoCommune francaise autour de laquelle chercher : nom ('Lyon'), code postal ('69003') ou 'Saint-Denis (974)' pour lever une homonymie.
pageNoPremiere page a recuperer.
sortNorelevance
limitNoAnnonces par page.
pagesNoNombre de pages consecutives a recuperer.
queryNoMots-cles. 'velo OR trottinette' pour l'un ou l'autre.
ad_typeNooffer : annonces de vente/offre ; demand : demandes.offer
filtersNoFiltres avances, par cle d'API Leboncoin. Intervalle : [min, max] ou {'min': x, 'max': y}, une borne pouvant etre null. Enumeration : liste de codes texte. Exemples : {'square': [40, 80], 'rooms': [3, null], 'real_estate_type': ['1', '2']} (1 maison, 2 appartement), {'mileage': [null, 100000], 'regdate': [2016, null]}. Les cles des attributs renvoyes avec chaque annonce sont des cles de filtre valides.
regionsNoRegions.
categoryNoCategorie ; les sous-categories sont prefixees par leur parent.TOUTES_CATEGORIES
price_maxNoPrix maximum en euros.
price_minNoPrix minimum en euros.
radius_kmNoRayon autour de city.
title_onlyNoChercher les mots-cles dans le titre seul.
departmentsNoNumeros ('69', '5') ou noms ('Gironde') de departements.
seller_typeNoParticuliers, professionnels ou les deux.all
export_formatNoEcrit toutes les annonces trouvees dans un fichier (description complete comprise) et ne renvoie qu'un resume et un echantillon. Indispensable au-dela de 300 annonces.
shippable_onlyNoSeulement avec livraison.

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.2/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses meaningful behavior beyond annotations: it returns site totals, price statistics, per-ad fields, and a next_page pagination token. With readOnlyHint=true, the safety profile is already covered. It does not mention the file-writing behavior of export_format or the 300-ad threshold, but these are documented in the parameter schema, lowering the burden on the description.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three sentences: the first states the primary action, the second summarizes outputs and pagination, the third routes to a sibling. There is no filler, and the most important information is front-loaded. Every sentence earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a 19-parameter tool with rich schema descriptions, an output schema, and annotations, the description covers the essentials: purpose, return contents, pagination, and a routing rule for ad details. The only notable omission is the export_format large-result caveat, but that is thoroughly covered in the schema, so the description remains sufficiently complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 95%, so the parameters are already thoroughly documented in the input schema. The description adds no parameter-level semantics but notes useful returned attributes (etat, kilometrage, surface), which indirectly hints at filter keys. This meets the baseline for high schema coverage without requiring additional compensation.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb+resource: 'Recherche des annonces sur Leboncoin' (search ads on Leboncoin), and further differentiates itself from siblings by explicitly directing ad-detail lookups to get_ad. An agent can immediately understand what this tool does and how it differs from get_ad and get_seller.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly states a key alternative: 'Pour le detail d'une annonce (description, photos, vendeur), utiliser get_ad.' This gives an explicit condition for choosing a sibling tool. It does not explicitly mention when to use get_seller, but the distinction between searching and retrieving seller info is clear from context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updatesv0.1.0
    • First observedget_ad
    • First observedget_seller
    • First observedsearch_ads

TDQS

A4.1/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: searching ads, retrieving ad details, and fetching seller profiles. There is no overlap or ambiguity between them.

Naming Consistency5/5

All tools follow a consistent verb_noun pattern in snake_case: search_ads, get_ad, get_seller. This makes the API predictable and easy to navigate.

Tool Count5/5

With only 3 tools, the set is minimal but well-scoped for read-only classifieds access. Each tool is necessary and none are redundant, fitting the typical 3-15 tool range.

Completeness4/5

The tools cover the core browsing workflow: search, ad details, and seller info. A minor gap is the lack of a direct way to list all ads from a specific seller, though this might be achievable via search parameters.

Maintenance

ActivityMaintained
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    B
    quality
    C
    maintenance
    Exposes Leboncoin classified ads to Claude, allowing search with filters and full ad details. Includes rate limiting and optional residential proxy support.
    2
    1
    -
  • A
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to search and consult Leboncoin classified ads through the MCP protocol, with tools for ad search, detail retrieval, user profiles, and category/region listings.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Enables Claude to search and analyze product listings from multiple French marketplaces, evaluating price, delivery, and distance to a reference point to find the best value.
    -
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to search and monitor Dutch and Belgian classifieds (Marktplaats and 2dehands) for listings, seller profiles, and categories.
    8
    2
    MIT