Skip to main content
Glama

Paperasse MCP

CI

An open-source MCP server that lets AI assistants answer questions about French administrative procedures from official sources only, with a citable link and last update date for every answer. It covers the guides for individuals (service-public.gouv.fr) and for professionals and the self-employed (entreprendre.service-public.gouv.fr).

Status: early development (v0.1.0). Both official feeds, keyword search with synonyms, a dev/test search eval and CI work. There is no hosted version, by design: you install it on your machine (about a minute), so your questions stay local.

Demo

Paperasse answering "Je suis étudiant, est-ce que j'ai droit aux APL ?" with the official fiche, its link and update date

A real MCP client calling the server: question → search_fiche → get_fiche → official text with its link and update date (15 s, sped up). The full 2-minute video, which also shows an English freelancer question with a low_confidence retry and an off-topic question, is attached to the v0.1.0 release. In the demo the keyword rewriting an assistant would do is scripted and labelled; see demo/.

https://github.com/user-attachments/assets/6e271201-e9ae-48b5-8b47-abf22a0778f8

Related MCP server: french-admin-mcp

Why

French administrative procedures are hard to navigate, and general-purpose AI assistants answer questions about them from memory: rules change every year (amounts, thresholds, deadlines), and a confident but outdated answer about the CAF, taxes or a residence permit can cost someone money or a deadline. The official guides already exist, are kept up to date by the DILA and are open data.

Paperasse gives an assistant those guides instead of its memory. It searches the official fiches, returns their text word for word with the official link and last update date, and says when it found nothing relevant. The assistant explains and cites; the server never writes or rewords the content.

Try it

You need uv and about a minute to download the official feeds and build the index:

git clone https://github.com/medkouritahaparis-create/paperasse-mcp.git
cd paperasse-mcp
uv sync
uv run python -m paperasse.ingest   # download both official feeds (about 35 MB) into data/
uv run python -m paperasse.store    # build the search index data/paperasse.db

To refresh the data later (the official feeds are updated daily), run the same two commands again.

Claude Code: open Claude Code in the repo folder: .mcp.json registers the server. From anywhere else:

claude mcp add paperasse -- uv --directory /absolute/path/to/paperasse-mcp run main.py

Claude Desktop: add this to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/, Windows: %APPDATA%\Claude\), keeping your other servers, then restart Claude Desktop:

{
  "mcpServers": {
    "paperasse": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/paperasse-mcp", "run", "main.py"]
    }
  }
}

If Claude Desktop can't find uv, use its full path (the output of which uv) as command.

Then ask, for example: "Je suis étudiant, est-ce que j'ai droit aux APL ?" or "How do I declare my micro-entrepreneur revenue?". The answer should cite a service-public.gouv.fr or entreprendre.service-public.gouv.fr link.

Tools

Tool

What it does

search_fiche(query, audience="all", limit=5)

Best matching fiches: id, title, summary, official URL, last update date and a match score. audience is "all", "particuliers" (individuals) or "professionnels" (businesses, self-employed); the URL is the page on that audience's site. Says low_confidence: true when the best result probably doesn't answer the question

get_fiche(id, offset=0)

Full official text of a fiche, with its URL on each site, update date, online services and legal sources; long fiches come in pages

Search quality

Measured with evals/questions.jsonl: 93 questions whose expected fiches were labelled by hand from fiche titles, never from search results. They are split into dev (65, used to tune search) and test (28, only reported, never tuned on). Current results on the test split, 2026-10-27 (search code 8b2687b, 3,673 fiches from both feeds):

Test split

n

Top-1

Top-3

MRR@10

Keywords, as clients are told to send them ("APL étudiant")

11

64%

73%

0.72

Full sentences, sent as is ("Comment avoir un garant gratuit pour louer ?")

15

33%

53%

0.46

Freelancers / micro-entrepreneurs (keywords and sentences)

8

38%

50%

0.47

All answerable

26

46%

62%

0.57

Same questions rewritten by an LLM client (Claude Haiku 5.5, --rewrite)

26

not measured yet

On dev (61 answerable): 54% top-1, 70% top-3, MRR 0.63. Full report: evals/results/2026-10-27-8b2687b-q0c79b3.md.

What moved the numbers (each change measured before and after; every option tried, kept or rejected, is in docs/decisions.md):

Change

Measured on

Before → after

Length prior: main guides outrank short Q&A spin-offs

first 48 questions

top-1 44% → 62%, top-3 75% → 79%

Entreprendre feed + audience="all"

13 freelance questions

top-3 0/13 → 4/13

Synonyms run as query variants (auto-entrepreneur → micro-entrepreneur, chômage → ARE, enceinte → grossesse)

dev

top-1 32 → 33, top-3 41 → 43 of 61

same

test (reported once)

top-1 42% → 46%, top-3 58% → 62%; freelance top-1 2/8 → 3/8, top-3 3/8 → 4/8

Full sentences are the weak spot (33% top-1 on test). The search_fiche docstring tells the client model to rewrite questions into official keywords. The --rewrite mode measures exactly that with Claude Haiku and needs an API key; it hasn't been run yet. If rewritten sentences stay weak, the next step is hybrid BM25 + multilingual embeddings fused with RRF (plan).

low_confidence is set on all 6 questions that have no good answer (off-topic, English). On test it is also set on 3 of 12 questions whose rank-1 result is right (false alarms).

Reproduce:

uv run python -m evals.run                                  # writes evals/results/<date>-<code>-q<question set>.md
uv run --group eval python -m evals.run --rewrite           # needs ANTHROPIC_API_KEY in .env; ~$0.03, cached afterwards

The official feeds are updated daily, so numbers can move slightly with the data. Each report records the code commit, the question set and the data snapshot. The test split is small: one question is about 4 points.

Development

uv run pytest                        # tests (no network, no data needed)
uv run mcp dev main.py               # inspect the tools in the MCP Inspector
uv run python -m evals.run           # search eval, writes evals/results/
uv run python demo/demo.py           # terminal demo (a real MCP client); vhs demo/demo.tape records it

CI (.github/workflows/ci.yml) runs the tests on every push and pull request. They need no network, data or API key.

Design choices, with the options considered and the numbers behind them, are in docs/decisions.md.

Roadmap

  • Ingest both official feeds (Particuliers, Entreprendre) into clean, verbatim fiches

  • search_fiche / get_fiche: SQLite FTS5 (BM25), length prior, low_confidence, measured synonyms

  • Search eval with a dev/test split, CI, scripted demo

  • Run the LLM-rewrite eval (--rewrite); add hybrid BM25 + embeddings only if rewritten sentences stay weak

  • get_procedure_steps: structured steps and required documents

  • Légifrance law articles (PISTE API) and find_local_help (France Services, préfectures, mairies)

Licence and data

The code is under the MIT licence, © 2026 Taha Medkouri.

The content it serves is not covered by that licence: it comes from Service-Public.gouv.fr / DILA (Direction de l'information légale et administrative) and stays under the Licence Ouverte / Etalab. Every tool response credits the source. The data is downloaded at install time and is not stored in this repository. Two feeds, both schema 3.5:

Disclaimer

This project is not affiliated with, endorsed by or operated by the French administration. It returns official text but is not legal advice. Always check the linked official page.

Available Tools

2 tools
get_ficheA

Read the full official text of a service-public.fr fiche, by id (e.g. "F12006").

Use after search_fiche, before answering. The text is the official wording, in French,
with Markdown headings and [links](url). It often covers several cases ("### En France",
"### À l'étranger"): pick the one that matches the user's situation. When the official text
repeats a block word for word in several cases, it is given once; later copies are replaced by
a line "[Paperasse : identique à « … » plus haut (sous « … »)]" pointing to the first copy.

Returns title, url, urls (the official page on each site, for fiches written for both
individuals and professionals), updated_at, text, online_services (official online procedures with
links) and sources (legal texts). Long fiches come in pages: if `next_offset` is not null,
call again with offset=next_offset to read more. For paged fiches, `outline` lists the
main headings with their offset: call get_fiche(id, offset=...) to jump to a section.

Inputs: id (required), offset. Returns: object

search_ficheA

Search official service-public.fr guides (fiches) about a French administrative procedure.

Use this first for any question about French paperwork: CAF (APL, RSA, prime d'activité),
URSSAF, impôts, titre de séjour, carte Vitale, logement social, carte grise,
micro-entreprise, création d'entreprise, etc.
The fiches are in French: always translate the user's question into a few French keywords
using official administrative terms before calling, even if the user writes in another
language (e.g. "I lost my residence permit" -> "perte titre de séjour";
"student housing aid" -> "APL étudiant"; "auto-entrepreneur" or "freelance" ->
"micro-entrepreneur"). Don't pass a full sentence.

`audience`: "all" (default) searches both guides for individuals (service-public.fr) and for
professionals (entreprendre.service-public.fr: self-employed, micro-entrepreneurs, companies,
employers). Pass "particuliers" or "professionnels" only when the user's situation is
clearly one or the other.

Returns up to `limit` (max 10) fiches, best match first, each with id, title, summary,
official url (the page on the site of the requested audience), audiences, updated_at and
`match` (0-1: how much of the query the title and summary cover). Then call get_fiche(id) to read the full text before answering: the summary alone
is not enough to answer.

If `low_confidence` is true, the best result probably doesn't answer the question: retry
once with different French official terms (synonyms, the name of the benefit or document).
If it is still low, don't present these fiches as the answer; say no matching official
guide was found.

Inputs: query (required), limit, audience. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4.8/5.0

    Scored across 2 tools

    Disambiguation5/5

    The two tools form a clean search-then-read pair with explicitly disjoint roles: search_fiche returns ranked summaries with ids, get_fiche reads one fiche by id. The descriptions even state the intended sequence, leaving no plausible way to misselect.

    Naming Consistency5/5

    Both tools use the same snake_case verb_noun pattern (search_fiche, get_fiche) over a single consistent resource noun, and the verb semantics match the action (search vs. get). No mixed conventions.

    Tool Count3/5

    Two tools is on the thin side, but it is a deliberate minimal retrieval surface for a read-only corpus and each tool earns its place. Still, there is no operation beyond search+read, which is borderline for the domain breadth advertised.

    Completeness4/5

    Search by keyword/audience plus full-text read with pagination, outline jumping, online services and legal sources covers the core Q&A workflow end to end. Gaps are minor: no browsing/listing of fiches by theme or category and no way to resolve an id without a prior search.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers