FastMCP server for French public open data APIs (data.gouv.fr, geo.api.gouv.fr, …).
Project description
mcp-gouv-fr
MCP server built with FastMCP for Claude Desktop, Cursor, and other clients. Use it to explore French public open data through ready-made tools instead of calling each portal yourself.
Source repository: github.com/gghez/mcp-gouv-fr
APIs
| API | What you can do |
|---|---|
| data.gouv.fr | Search and open datasets: metadata, organization, and links to files or APIs. |
| geo.api.gouv.fr | Look up communes, departments, and regions (names, codes, and related geography). |
| INSEE API Sirene | Look up a legal entity (SIREN) or an establishment (SIRET); needs an INSEE API key. |
| Radio France Open API | Run GraphQL queries on Radio France open data; needs an API token. |
data.gouv.fr
Tools use the datagouv_ prefix.
| Tool | What it does |
|---|---|
datagouv_search_datasets |
Search datasets by title, description, or organization, with pagination. |
datagouv_get_dataset |
Full metadata and resource links for one dataset (id or slug). |
geo.api.gouv.fr
Tools use the geo_ prefix.
| Tool | What it does |
|---|---|
geo_search_communes |
Search communes by name, postal code, and/or department (at least one filter). |
geo_get_commune |
Commune details by INSEE municipality code. |
geo_search_departements |
List or search departments. |
geo_get_departement |
Department detail by code. |
geo_search_regions |
List or search regions. |
geo_get_region |
Region detail by code. |
INSEE API Sirene
Tools use the insee_ prefix. Set MCP_GOUV_INSEE_API_KEY or these tools will report a configuration error.
| Tool | What it does |
|---|---|
insee_get_unite_legale |
Legal unit (unité légale) by 9-digit SIREN. |
insee_get_etablissement |
Establishment (établissement) by 14-digit SIRET. |
Radio France Open API
Tools use the radiofrance_ prefix. Set MCP_GOUV_RADIOFRANCE_API_TOKEN for radiofrance_graphql.
| Tool | What it does |
|---|---|
radiofrance_graphql |
Execute a GraphQL query against Radio France public data. |
Default transport is stdio for local MCP clients; streamable HTTP is optional for remote access (see Transports and CLI options).
Prerequisites
- uv installed and available on your
PATH(souvxworks). - This project targets Python 3.14 (
requires-pythoninpyproject.toml). uv will provision a compatible interpreter when installing from Git or from a local checkout. - If you use
uvxwith agit+https://...URL (recommended install-from-GitHub flow below), Git must be installed andgitmust be on thePATHof the MCP subprocess. uv clones or updates the repo using Git; if Git is missing you get:Git executable not found. On Windows, Claude Desktop sometimes spawns MCP servers with a shorterPATHthan your terminal: either use the clone +uv runsetup, or extendPATHin the serverenvblock (see below).
Recommended setup: MCP config with uvx (GitHub)
uvx runs the published console script mcp-gouv-fr in an isolated environment. You can point it at this repository with --from and a Git URL (no manual clone required).
Command shape:
uvx --from git+https://github.com/gghez/mcp-gouv-fr.git mcp-gouv-fr
Optional: pin a branch, tag, or commit after @ in the URL (see uv tools guide), for example git+https://github.com/gghez/mcp-gouv-fr.git@v0.1.0.
Claude Desktop (claude_desktop_config.json)
Typical path on Windows: %APPDATA%\Claude\claude_desktop_config.json.
{
"mcpServers": {
"mcp-gouv-fr": {
"command": "uvx",
"args": [
"--from",
"git+https://github.com/gghez/mcp-gouv-fr.git",
"mcp-gouv-fr"
],
"env": {
"PATHEXT": ".COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW"
}
}
}
}
Restart Claude Desktop after editing. If uvx is not found, use the full path to the uv executable and run uv tool run instead of uvx, or add uv to your user PATH.
If uv fails with “Git executable not found” (common on Windows), the MCP host did not expose git on PATH. Fixes:
- System-wide (simplest): add
C:\Program Files\Git\cmd(or your Git install) to the user or systemPATHin Windows Settings so GUI apps (Claude Desktop) inherit it, then restart Claude. - Per server: set
env.PATHin the MCP JSON to a single string that lists every folder the process needs, in order — at minimum Git’scmdand the folder containinguv.exe/uvx.exe(e.g.C:\Users\YOU\.local\bin). Some clients replace the processPATHentirely whenenvis set, so do not rely on${PATH}expansion unless you verified your client merges variables. - Avoid Git at MCP startup: use clone +
uv run(uv run --directory … mcp-gouv-fr) afteruv syncin that clone; uv then runs the project without cloning from Git on each start.
Cursor and other editors
Use the same JSON shape in your MCP servers configuration: command uvx, args as above. For stdio, do not pass extra arguments unless you need non-default transport (see below).
If uvx is not on PATH (Windows)
Use the full path to uv.exe and the equivalent invocation:
{
"mcpServers": {
"mcp-gouv-fr": {
"command": "C:\\Users\\YOU\\AppData\\Local\\Programs\\uv\\uv.exe",
"args": [
"tool",
"run",
"--from",
"git+https://github.com/gghez/mcp-gouv-fr.git",
"mcp-gouv-fr"
]
}
}
}
Adjust the command path to match your uv installation.
Alternative: clone the repo and run with uv
For a fixed checkout or local changes:
git clone https://github.com/gghez/mcp-gouv-fr.git
cd mcp-gouv-fr
uv sync
uv run mcp-gouv-fr
MCP JSON (stdio) — set --directory to your clone:
{
"mcpServers": {
"mcp-gouv-fr": {
"command": "uv",
"args": [
"run",
"--directory",
"C:\\path\\to\\mcp-gouv-fr",
"mcp-gouv-fr"
]
}
}
}
Transports and CLI options
Default is stdio (suitable for Claude Desktop and Cursor).
uvx --from git+https://github.com/gghez/mcp-gouv-fr.git mcp-gouv-fr --transport stdio
Streamable HTTP (bind address, port, path can be changed):
uvx --from git+https://github.com/gghez/mcp-gouv-fr.git mcp-gouv-fr --transport streamable-http --host 127.0.0.1 --port 8765 --path /mcp
Environment variables (optional): MCP_GOUV_TRANSPORT, MCP_GOUV_HOST, MCP_GOUV_PORT, MCP_GOUV_HTTP_PATH, MCP_GOUV_APIS (comma-separated API ids; default: all), MCP_GOUV_LOG_LEVEL (logging level for stderr; default: INFO).
Environment variables (API behavior)
| Variable | Description |
|---|---|
MCP_GOUV_APIS |
Comma-separated API ids to load (datagouv, geo, insee, radiofrance); default is all |
MCP_GOUV_DATAGOUV_API_BASE |
data.gouv API base URL (default: https://www.data.gouv.fr/api/1) |
MCP_GOUV_GEO_API_BASE |
Geo API base URL (default: https://geo.api.gouv.fr) |
MCP_GOUV_INSEE_API_KEY |
INSEE portal consumer key for Sirene (required for insee_* tools; from portail-api.insee.fr) |
MCP_GOUV_INSEE_SIRENE_API_BASE |
Sirene 3.11 API base (default: https://api.insee.fr/api-sirene/3.11) |
MCP_GOUV_RADIOFRANCE_GRAPHQL_URL |
Radio France GraphQL endpoint (default: https://openapi.radiofrance.fr/v1/graphql) |
MCP_GOUV_RADIOFRANCE_API_TOKEN |
Radio France Open API key (x-token); required for radiofrance_graphql (portal) |
MCP_GOUV_HTTP_TIMEOUT |
Outbound HTTP timeout in seconds (default: 30) |
MCP_GOUV_USER_AGENT |
User-Agent header for HTTP requests |
MCP_GOUV_LOG_LEVEL |
Stderr log level for the server process (DEBUG, INFO, WARNING, …; default: INFO) |
In MCP JSON, set these under env next to command / args if your client supports it.
INSEE Sirene (API key required)
Unlike data.gouv and geo.api.gouv.fr, Sirene lookups will not work until you set an API key. Subscribe to the Sirene API on the INSEE developer portal, generate a consumer key, and expose it to the MCP process as MCP_GOUV_INSEE_API_KEY. The server sends it as the X-INSEE-Api-Key-Integration header to api.insee.fr. If this variable is missing or empty, the insee_* tools return an error that asks you to configure it.
When using Claude Desktop or Cursor, add MCP_GOUV_INSEE_API_KEY to the server’s environment (e.g. env in the MCP JSON config) so the subprocess inherits it.
Development
Contributors: tests and lint live in the repo. Run uv run pytest and uv run ruff check src. Install Git hooks with uv run pre-commit install (runs ruff check --fix on commit). Tool outputs use Pydantic models (JSON Schema for MCP clients). See AGENTS.md for layout conventions (nested tests next to the code they cover).
License
Not set yet (no LICENSE file in this repository).
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mcp_gouv_fr-0.1.0.tar.gz.
File metadata
- Download URL: mcp_gouv_fr-0.1.0.tar.gz
- Upload date:
- Size: 23.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
324916c0172e32445b06e2529b69185b8eb23ce71d0abfde597fc16458e1b952
|
|
| MD5 |
6bb8b0032e3c37ef0c1fa8bdcb961a1a
|
|
| BLAKE2b-256 |
d82dd91bc785de901b9483dfb776b73e4d2b50bb61bf6d13759810d844f9dbc8
|
File details
Details for the file mcp_gouv_fr-0.1.0-py3-none-any.whl.
File metadata
- Download URL: mcp_gouv_fr-0.1.0-py3-none-any.whl
- Upload date:
- Size: 31.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.10.6 {"installer":{"name":"uv","version":"0.10.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ffa16db4f3d3940f1d3e34ec6ab7d3a7bef8ac001cc96f74c00a4b1991fa53c8
|
|
| MD5 |
90041a99c66ab0c0adeae75f22e8bb24
|
|
| BLAKE2b-256 |
6d5a750887b9e6c1636024183eea7078b449d2b59970c1517d78750c2dc2113a
|