Skip to main content
Glama
marches-publics

marches-publics

mcp-marches-publics

Licence: MIT Python 3.11+ Tests: 225 offline Eval: oracle 24/24

An AI assistant that does your public-procurement watch for you: it finds the tenders that concern you, tells you who usually wins them and at what price, in France and across Europe, from official sources only.

Plug this MCP server into Claude, Cursor or any MCP client and ask in plain language: open tenders (BOAMP, TED), awarded contracts (DECP), who buys and who wins what.

No API key. Official sources only. Compact, paginated outputs designed for LLM context windows. Every claim about quality below is backed by a test suite and a published evaluation set.

You:    Which companies won the most cleaning contracts (CPV 9091) in the Rhône in 2025?
Claude: [calls rank_decp_parties(by="supplier", cpv_prefix="9091", department="69",
         notified_from="2025-01-01", notified_to="2025-12-31", top=3)]
        Out of 115 contracts published in DECP for that filter:
        1. SOC SEGUIGNE ET RUIZ — 10 contracts, 2.6 M€
        2. CONCEPT 3P — 8 contracts, 0.7 M€
        3. SAMSIC II — 7 contracts, 19.4 M€ (framework agreements: maximum amounts)
        Caveat: DECP coverage is incomplete, so this is a lower bound.

The output above is a real tool result (2026-11-20, live API), not a mock-up.

Why

Public buyers in France publish their tenders in BOAMP, their awarded contracts in the DECP (données essentielles de la commande publique), and above EU thresholds in TED. The data is open but spread across three APIs with three query languages (two Opendatasoft datasets with ODSQL, TED's expert query syntax), no company names in DECP, and CPV codes that each source matches differently. This server hides that behind 8 typed tools an agent can use reliably.

Related MCP server: mcp-marches-publics

Tools

Tool

Source

What it answers

search_boamp_notices

BOAMP

French notices by keywords, CPV (exact code or prefix), department / region / department name, publication dates, open-only, tender vs award, works/services/supplies, buyer

get_boamp_notice

BOAMP

One notice, compact: description, CPV, estimated value, lots, award criteria, winners

search_decp_awards

DECP

Awarded contracts by keywords, CPV prefix, buyer or supplier SIRET, department, dates, amount range, procedure; buyer and supplier names resolved

rank_decp_parties

DECP

Top buyers or suppliers by number of contracts or total amount, aggregated upstream, with explicit caveats

search_ted_notices

TED

EU notices by keywords, CPV (hierarchical), country of performance, dates, open-only, notice type

get_ted_notice

TED

One TED notice: description, estimated value, procedure, winners, award value, PDF link

lookup_company

Recherche d'entreprises

SIRET / SIREN to company name

search_cpv_codes

CPV 2008

Find CPV codes from words (FR or EN), e.g. "nettoyage"

All tools are read-only (readOnlyHint, idempotentHint, openWorldHint). Resources: marches://regions (region to departments), marches://sources (sources, licences, freshness). Prompt: veille_marches(cpv, region), a ready-made monitoring workflow.

Design choices, following Anthropic's Writing effective tools for agents and MCP tool-description research:

  • Few, task-shaped tools rather than one tool per endpoint; each description says when to use it and when to use its sibling instead.

  • Strict input schemas (pydantic): CPV and department patterns, ISO dates, bounded limits. Invalid calls fail fast with a message that tells the model how to fix the call.

  • Compact structured output: titles and descriptions truncated, no raw upstream blobs, a page block with total and next_offset, and a hint when a search returns nothing.

  • Honest aggregates: rankings carry their caveats (framework-agreement maxima, first co-contractor only, incomplete coverage).

Conventions

  • Dates are ISO (YYYY-MM-DD). CPV codes are digits; an optional check digit (90910000-9) is ignored.

  • Lists are paginated: pass the next_offset of a result as offset (TED: next_page as page). Default limit 10, maximum 50.

  • DECP carries only SIRET identifiers; names are resolved through the company directory and may be null.

  • Use BOAMP for French questions (fresher, filters by department), TED for EU-wide or foreign notices; DECP lists awarded contracts only, never open tenders.

Install

Requires Python 3.11+ and uv.

Claude Code

claude mcp add marches-publics -- uvx mcp-marches-publics

Claude Desktop

claude_desktop_config.json:

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

Cursor

.cursor/mcp.json (project) or ~/.cursor/mcp.json (global):

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

Until the package is on PyPI, replace uvx mcp-marches-publics with uvx --from git+https://github.com/FlavioDurante/mcp-marches-publics mcp-marches-publics, or with a local checkout: uv run --directory /path/to/mcp-marches-publics mcp-marches-publics.

Streamable HTTP

mcp-marches-publics --transport streamable-http --host 127.0.0.1 --port 8000
# endpoint: http://127.0.0.1:8000/mcp

A Dockerfile is provided for the HTTP transport. The server has no authentication of its own: bind it to localhost or put it behind an authenticated reverse proxy, never expose it directly.

Configuration

Variable

Default

Purpose

MCP_MP_LOG_LEVEL

INFO

Log level (JSON lines on stderr; stdout is the protocol)

MCP_MP_BOAMP_URL

BOAMP Opendatasoft records endpoint

Override (mirror, tests)

MCP_MP_DECP_URL

DECP Opendatasoft records endpoint

Override

MCP_MP_TED_URL

https://api.ted.europa.eu/v3/notices/search

Override

MCP_MP_ENTREPRISES_URL

https://recherche-entreprises.api.gouv.fr/search

Override

No variable holds a secret: none of the sources requires a key.

Sources, licences and limits

Source

API

Licence

Rate limit (as documented or observed)

BOAMP (DILA)

Opendatasoft Explore v2.1

Licence Ouverte / Etalab

Header X-RateLimit-Limit: 2000000 per day on the domain; 100 records per page, 10,000 records reachable per query

DECP, format of the arrêté du 22/12/2022

data.economie.gouv.fr decp-2022-marches-valides

Licence Ouverte v2.0 (Etalab)

Header X-RateLimit-Limit: 50000 per day on the domain (40x lower than BOAMP); same 100 / 10,000 windows

TED (EU Publications Office)

TED API v3 search, anonymous

Free reuse, commercial or not, under Commission Decision 2011/833/EU

Fair usage: 700 requests per minute per IP; 15,000 results reachable per query

Recherche d'entreprises (DINUM)

recherche-entreprises.api.gouv.fr

Licence Ouverte

7 calls per second, may be lowered under load; the client paces itself

CPV 2008 nomenclature

see src/marches_publics_mcp/data/README.md

EU reuse policy

bundled, offline

The client retries on network errors, 429 and 5xx with exponential backoff and jitter, honours Retry-After, paces per host, and caches successful responses for 5 minutes.

Known limits, stated plainly:

  • BOAMP has no CPV field. CPV codes live inside the notice payload; an 8-digit code matches that exact code, a 2-7 digit prefix is expanded to the codes of the official nomenclature (up to 300 codes: "72" works, "45" asks for a longer prefix). TED matches CPV hierarchically.

  • BOAMP departments are diffusion departments, not the place of performance: a notice is returned if any of its departments matches (about 15% of Occitanie tenders in October 2026 also list departments outside the region). Corsica is stored as 20A / 20B upstream and mapped from 2A / 2B.

  • BOAMP data quality. Some deadlines are typos (year 2924); open_only ignores deadlines more than two years ahead. Rectifications are separate notices (status, linked_notices); a tender cancelled by a later notice is flagged cancelled: true. Deadlines are given in Europe/Paris time.

  • DECP has no names. Buyer and supplier names come from the company directory by SIRET, so a name can be missing. Amounts of framework agreements are maxima, not money spent, and a framework agreement and its subsequent contracts can both be counted in a total. Not every buyer publishes, so rankings are lower bounds. A more exhaustive consolidation exists (decp.info / colibre.fr, 277 MB Parquet) but has no query API; this server uses the official dataset that does.

  • TED counts by place of performance (countries), which differs from the buyer's country for cross-border buyers.

  • Live data drifts: numbers in this README and in the evaluation are dated.

  • This is open data, not legal advice; the official notice remains the reference.

Evaluation

eval/ holds 24 realistic questions in French (8 BOAMP, 10 DECP, 5 TED, 1 cross-source), each with a ground truth computed directly against the official APIs, independently of this code, the upstream request used to verify it, and the date it was verified. The protocol was written before any run (eval/PREREGISTRATION.md).

Run

What it shows

Result

Oracle (gold tool calls replayed through the MCP server, live APIs, 2026-11-20)

The tools can answer every question

24 / 24

Agent (an LLM that only sees the tool list and the question)

Whether a model does find the answer

not run yet: it needs a paid model API

python eval/run_eval.py --check
python eval/run_eval.py --mode oracle
python eval/run_eval.py --mode agent --provider anthropic --model <model-id>   # needs ANTHROPIC_API_KEY

See eval/README.md for metrics (success per answer type, tool calls, invalid-call rate, tokens, latency) and limits (small n, drifting live data).

Development

uv venv && uv pip install -e ".[dev]"
pytest -q                    # unit + end-to-end MCP tests, no network (recorded fixtures)
pytest -q -m integration     # live API tests, opt-in
ruff check . && black --check .

Layout: src/marches_publics_mcp/http.py (shared async client), sources/ (one client per API, returning the models of models.py), server.py (MCP tools, resources, prompt), geo.py (regions and departments), cpv.py (nomenclature). End-to-end tests drive the server through the official MCP client, in memory and over stdio.

Prior art and what this server adds: docs/STATE_OF_THE_ART.md.

Roadmap

  • Agent-mode evaluation across several models, with pass^k over repeated runs.

  • Alerts: persist a query and return only new notices since the last call.

  • DECP concessions dataset; modification notices.

  • Other national portals (PLACE, regional profiles) where an open API exists.

  • Publication on PyPI and the MCP registry.

Licence

MIT (code). Data belongs to its publishers under the licences listed above.

Available Tools

8 tools
get_boamp_noticeGet one BOAMP noticeA
Read-onlyIdempotent

Get the compact detail of one BOAMP notice: description, CPV, lots, value, winners.

Use after search_boamp_notices when the user wants more on a specific notice. Do NOT guess ids, and do not use for TED notices (get_ted_notice).

Inputs: notice_id (required). Returns: Full but compact view of one BOAMP notice.

get_ted_noticeGet one TED noticeA
Read-onlyIdempotent

Get the compact detail of one TED notice: description, value, procedure, winners.

Use after search_ted_notices. Do NOT use for BOAMP ids (get_boamp_notice).

Inputs: publication_number (required). Returns: Compact detail of one TED notice.

lookup_companyLook up a company name by SIRET/SIRENA
Read-onlyIdempotent

Resolve a French SIRET or SIREN to the company name (public company directory).

Use when a DECP/BOAMP result shows only an identifier. Do NOT use to search by name or to get financial data. DECP tools already resolve names; this is for ad-hoc checks.

Inputs: identifier (required). Returns: Result of a company-name lookup.

rank_decp_partiesRank top buyers or suppliers (DECP)A
Read-onlyIdempotent

Rank the top buyers or suppliers of French awarded contracts (DECP).

Use for: "who are the main suppliers of IT services in Occitanie in 2025", "which buyers spend most on cleaning". Aggregated upstream over all matching contracts, not only a page. Example: by="supplier", order="amount", cpv_prefix="72", department="31". Do NOT use to list individual contracts (search_decp_awards). Read caveats: DECP coverage is incomplete and amounts are notified values, not payments.

Inputs: by (required), top, order, keywords, +5 more. Returns: DECP ranking with an empty-result hint.

search_boamp_noticesSearch BOAMP notices (France)A
Read-onlyIdempotent

Search French public procurement notices (BOAMP), newest first.

Use for: open calls for tenders and published notices in France, filtered by topic, CPV code, region/department, buyer or date. Example: open IT-services tenders in Occitanie -> cpv="72", region="Occitanie", open_only=true, notice_kind="tender". Do NOT use for: contract amounts or winners over time or rankings (use search_decp_awards / rank_decp_parties), nor for notices outside France (use search_ted_notices). Returns a compact list; call get_boamp_notice with an id for the full notice. Caution: the region/department filter matches the notice's diffusion departments (code_departement, multivalued), not the place of performance: about 15% of October 2026 Occitanie tenders also list departments outside Occitanie.

Inputs: cpv, buyer, limit, offset, +9 more. Returns: BOAMP search result plus the department codes actually applied.

search_cpv_codesFind CPV codes from wordsA
Read-onlyIdempotent

Find CPV 2008 codes whose label matches the words (official EU nomenclature, offline).

Use before a search when the user names an activity instead of a code. Shorter codes (e.g. 90910000) are broader; pass their significant digits as a prefix ("9091") to the search tools. Do NOT use to find notices: use the search_* tools with the code found.

Inputs: text (required), lang, limit. Returns: CPV codes matching a text query.

search_decp_awardsSearch awarded contracts (DECP, France)A
Read-onlyIdempotent

List awarded French public contracts (DECP) with amount, buyer and supplier.

Use for: "which contracts were awarded for X", biggest contracts (order_by="amount"), what a given buyer or supplier signed. Names are resolved from SIRET automatically. Do NOT use for open tenders (search_boamp_notices), for "top N buyers/suppliers" (rank_decp_parties does the aggregation upstream), or for EU data (search_ted_notices). Amounts are as notified; framework agreements show their maximum.

Inputs: limit, offset, keywords, order_by, +9 more. Returns: DECP search result with an empty-result hint.

search_ted_noticesSearch TED notices (EU)A
Read-onlyIdempotent

Search EU-wide public procurement notices on TED (Tenders Electronic Daily).

Use for: tenders in other EU countries or cross-border, or above-threshold French contracts seen from the EU side. Example: cpv="72" (or "72000000"), countries=["DEU","AUT"], open_only=true. Do NOT use for France-only searches by department/region (use search_boamp_notices) or for award amounts/rankings in France (DECP tools). Pagination is by page: pass the result's next_page as page (null = no more pages); next_offset is informational only. Call get_ted_notice with a publication_number.

Inputs: cpv, page, limit, keywords, +5 more. Returns: TED search result with an empty-result hint.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.5/5.0

    Scored across 8 tools

    Disambiguation5/5

    Each tool has a distinct resource+action target, and the descriptions include explicit 'Use for' / 'Do NOT use for' routing hints that resolve the few potential overlaps (BOAMP vs TED by geography, DECP listing vs DECP aggregation). The search/get pairings per source are cleanly separated, and cross-references even tell the agent which sibling tool to use instead.

    Naming Consistency5/5

    All names are snake_case verb_noun with a predictable pattern: search_<source>, get_<source>, rank_<entity>, lookup_<entity>. Verb choice varies (search/get/rank/lookup) but is semantically consistent and always paired with the noun it operates on, making the tool's source and action readable at a glance.

    Tool Count5/5

    Eight tools is well within the ideal band and each one earns its place: two sources of tenders, their detail lookups, award search plus aggregation, and two small helper utilities. Nothing appears redundant or padded.

    Completeness4/5

    The surface covers the core lifecycle well — find tenders (BOAMP/TED), inspect a notice, find and rank awards, resolve identifiers, and map activity names to CPV codes. The main gap is the reverse identifier path: lookup_company only resolves SIRET/SIREN to a name, so an agent asked to 'find company X' has no name-to-SIRET tool, and there is no standalone DECP contract detail lookup beyond the search listing.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      Not graded
      maintenance
      Exposes French and EU public procurement data (BOAMP + TED) as MCP tools for AI agents, enabling search for tenders, awards, and winner intelligence via typed filters.
      4
      163 PyPI
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables agents to inspect French public procurement sources, including DECP, BOAMP, buyers, suppliers, and SIRENE data, to discover and summarize public contracts and related context.
      5
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI agents to search and retrieve public procurement notices from 17 sources across Germany, the EU, and the UK, with filtering by country, CPV code, deadline, and contract value, plus full tender details and source freshness checks.
      MIT