Official data.gouv.fr Model Context Protocol (MCP) server that allows AI chatbots to search, explore, and analyze datasets from the French national Open Data platform, directly through conversation.
[!TIP]
Got feedback? Tell us about it here
Model Context Protocol (MCP) server that allows AI chatbots (Claude, ChatGPT, Gemini, etc.) to search, explore, and analyze datasets from data.gouv.fr, the French national Open Data platform, directly through conversation.
Instead of manually browsing the website, you can simply ask questions like "Quels jeux de données sont disponibles sur les prix de l'immobilier ?" or "Montre-moi les dernières données de population pour Paris" and get instant answers.
[!TIP]
Use it now: A public instance is available for everyone at https://mcp.data.gouv.fr/mcp with no access restrictions.
To connect your favorite chatbot, simply follow the connection instructions below.
Use the hosted endpoint https://mcp.data.gouv.fr/mcp (recommended). If you self-host, swap in your own URL.
The MCP server configuration depends on your client. Use the appropriate configuration format for your client:
AnythingLLM | ChatGPT | Claude Code | Claude Desktop | Cursor | Gemini CLI | HuggingChat | IBM Bob | Kiro CLI | Kiro IDE | Le Chat (Mistral) | Mistral Vibe | OpenCode | VS Code | Windsurf
anythingllm_mcp_servers.json file in your AnythingLLM storage plugins directory:~/.config/anythingllm-desktop/storage/plugins/anythingllm_mcp_servers.json~/Library/Application Support/anythingllm-desktop/storage/plugins/anythingllm_mcp_servers.jsonC:\Users\<username>\AppData\Roaming\anythingllm-desktop\storage\plugins\anythingllm_mcp_servers.json{
"mcpServers": {
"datagouv": {
"type": "streamable",
"url": "https://mcp.data.gouv.fr/mcp"
}
}
}For more details, see the AnythingLLM MCP documentation.
Available for paid plans only (Plus, Pro, Team, and Enterprise).
Settings, then Apps and connectors.Advanced settings and enable Developer mode.Settings > Connectors > Browse connectors and click Add a new connector.https://mcp.data.gouv.fr/mcp and save to activate the tools.Use the claude mcp command to add the MCP server:
claude mcp add --transport http datagouv https://mcp.data.gouv.fr/mcpAdd the following to your Claude Desktop configuration file (typically ~/.config/Claude/claude_desktop_config.json on Linux, ~/Library/Application Support/Claude/claude_desktop_config.json on MacOS, or %APPDATA%\Claude\claude_desktop_config.json on Windows):
{
"mcpServers": {
"datagouv": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.data.gouv.fr/mcp"
]
}
}
}Claude Desktop on Windows: If the server appears in the list but never connects (no handshake, tools missing), Claude may be using its built-in Node.js runtime, which does not see packages installed with your system npm (including a global mcp-remote). Set isUsingBuiltInNodeForMcp to false at the root of the same config file so npx uses your installed Node — then restart Claude Desktop:
{
"isUsingBuiltInNodeForMcp": false,
"mcpServers": {
"datagouv": {
"command": "npx",
"args": [
"mcp-remote",
"https://mcp.data.gouv.fr/mcp"
]
}
}
}See issue #69 for background.
Cursor supports MCP servers through its settings. To configure the server:
{
"mcpServers": {
"datagouv": {
"url": "https://mcp.data.gouv.fr/mcp",
"transport": "http"
}
}
}Add the following to your ~/.gemini/settings.json file (Linux: ~/.gemini/settings.json, MacOS: ~/.gemini/settings.json, Windows: %USERPROFILE%\.gemini\settings.json):
{
"mcpServers": {
"datagouv": {
"httpUrl": "https://mcp.data.gouv.fr/mcp"
}
}
}MCP Servers, and click Manage MCP Servers.Add Server button in the server management window.https://mcp.data.gouv.fr/mcp. Click Add Server to save.Health Check button on the new server card to confirm it displays as Connected. Ensure the toggle is activated to use the tools in your chat.IBM Bob supports MCP servers through its settings. To configure the server:
mcp_settings.json file.bob/mcp.json file (Bob creates it if it does not exist)Both files use JSON format with an mcpServers object containing named server configurations.
{
"mcpServers": {
"datagouv": {
"url": "https://mcp.data.gouv.fr/mcp",
"type": "streamable-http"
}
}
}Add the following to ~/.kiro/settings/mcp.json (Linux: ~/.kiro/settings/mcp.json, MacOS: ~/.kiro/settings/mcp.json, Windows: %USERPROFILE%\.kiro\settings\mcp.json):
{
"mcpServers": {
"datagouv": {
"url": "https://mcp.data.gouv.fr/mcp"
}
}
}Add the following to your Kiro MCP configuration file (.kiro/settings/mcp.json in your workspace, or for global config: Linux: ~/.kiro/settings/mcp.json, MacOS: ~/.kiro/settings/mcp.json, Windows: %USERPROFILE%\.kiro\settings\mcp.json):
{
"mcpServers": {
"datagouv": {
"url": "https://mcp.data.gouv.fr/mcp"
}
}
}Available on all plans, including free.
Intelligence > Connectors.Add connector > Custom MCP Connector, give it a name (for example DataGouv), and set the server URL to https://mcp.data.gouv.fr/mcp.Edit your Vibe config (default: Linux: ~/.vibe/config.toml, MacOS: ~/.vibe/config.toml, Windows: %USERPROFILE%\.vibe\config.toml) and add the MCP server:
[[mcp_servers]]
name = "datagouv"
transport = "streamable-http"
url = "https://mcp.data.gouv.fr/mcp"See the full Vibe MCP options in the official docs: MCP server configuration.
Add to opencode.json (e.g. ~/.config/opencode/opencode.json or your project root). Remote servers use the top-level mcp object with type: "remote". See OpenCode MCP servers.
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"datagouv": {
"type": "remote",
"url": "https://mcp.data.gouv.fr/mcp",
"enabled": true
}
}
}Add the following to your VS Code mcp.json file (Linux: ~/.config/Code/User/mcp.json, MacOS: ~/Library/Application Support/Code/User/mcp.json, Windows: %APPDATA%\Code\User\mcp.json). Run MCP: Open User Configuration from the Command Palette to open it.
{
"servers": {
"datagouv": {
"url": "https://mcp.data.gouv.fr/mcp",
"type": "http"
}
}
}Add the following to your ~/.codeium/windsurf/mcp_config.json (Linux: ~/.codeium/windsurf/mcp_config.json, MacOS: ~/.codeium/windsurf/mcp_config.json, Windows: %USERPROFILE%\.codeium\windsurf\mcp_config.json):
{
"mcpServers": {
"datagouv": {
"command": "npx",
"args": [
"-y",
"mcp-remote",
"https://mcp.data.gouv.fr/mcp"
]
}
}
}Note:
https://mcp.data.gouv.fr/mcp. If you run the server yourself, replace it with your own URL (see “Run locally” below for the default local endpoint).Before starting, clone this repository and browse into it:
git clone [email protected]:datagouv/datagouv-mcp.git
cd datagouv-mcpDocker is required for the recommended setup. Install it via Docker Desktop or any compatible Docker Engine before continuing.
# With default settings (port 8000, prod environment)
docker compose up -d
# With custom environment variables
MCP_PORT=8007 DATAGOUV_API_ENV=demo LOG_LEVEL=DEBUG docker compose up -d
# Stop
docker compose downEnvironment variables:
MCP_HOST: host to bind to (defaults to 0.0.0.0). Set to 127.0.0.1 for local development to follow MCP security best practices.MCP_PORT: port for the MCP HTTP server (defaults to 8000 when unset).MCP_ENV: environment name reported to Sentry (defaults to local when unset). Set explicitly to prod, preprod, or demo in your deployment.DATAGOUV_API_ENV: prod (default) or demo. This controls which data.gouv.fr environement it uses the data from (https://www.data.gouv.fr or https://demo.data.gouv.fr). By default the MCP server talks to the production data.gouv.fr. Set DATAGOUV_API_ENV=demo if you specifically need the demo environment.LOG_LEVEL: Python logging level for the application (defaults to INFO). Common values: DEBUG, INFO, WARNING, ERROR, CRITICAL.SENTRY_DSN: Sentry DSN to enable error and performance monitoring. Monitoring is disabled when unset.SENTRY_SAMPLE_RATE: sampling rate for Sentry traces and profiles (float 0.0–1.0, defaults to 1.0).You will need uv to install dependencies and run the server.
uv sync Copy the example environment file to create your own .env file:
cp .env.example .env Then optionally edit .env and set the variables that matter for your run:
MCP_HOST=127.0.0.1 # (defaults to 0.0.0.0, use 127.0.0.1 for local dev)
MCP_PORT=8007 # (defaults to 8000 when unset)
MCP_ENV=local # environment name sent to Sentry (defaults to local when unset)
DATAGOUV_API_ENV=prod # Allowed values: demo | prod (defaults to prod when unset)
LOG_LEVEL=INFO # Python log level (default: INFO)Load the variables with your preferred method, e.g.:
set -a && source .env && set +auv run main.pyFollow the steps in Connect your chatbot to the MCP server and simply swap the hosted URL for your local endpoint (default: http://127.0.0.1:${MCP_PORT:-8000}/mcp).
The MCP server is built using the official Python SDK for MCP servers and clients and uses the Streamable HTTP transport only.
STDIO and SSE are not supported.
Streamable HTTP transport (standards-compliant):
POST /mcp - JSON-RPC messages (client → server)GET /health - Simple JSON health probe ({"status":"ok","timestamp":"..."})The MCP server provides tools to interact with data.gouv.fr datasets and dataservices.
Note: "Dataservices" are external third-party APIs (e.g., Adresse API, Sirene API) registered in the data.gouv.fr catalog. They are distinct from data.gouv.fr's own internal APIs (Main/Tabular/Metrics) which power this MCP server.
search_datasets - Search for datasets by keywords. Returns datasets with metadata (title, description, organization, tags, resource count).Parameters: query (required), page (optional, default: 1), page_size (optional, default: 20, max: 100)get_dataset_info - Get detailed information about a specific dataset (metadata, organization, tags, dates, license, etc.).Parameters: dataset_id (required)list_dataset_resources - List all resources (files) in a dataset with their metadata (format, size, type, URL).Parameters: dataset_id (required)get_resource_info - Get detailed information about a specific resource (format, size, MIME type, URL, dataset association, Tabular API availability).Parameters: resource_id (required)query_resource_data - Query data from a specific resource via the Tabular API. Fetches rows from a resource to answer questions.Parameters: resource_id (required), page (optional, default: 1), page_size (optional, default: 20, max: 200)Note: Recommended workflow: 1) Use search_datasets to find the dataset, 2) Use list_dataset_resources to see available resources, 3) Use query_resource_data with default page_size (20) to preview data structure. For small datasets (<500 rows), increase page_size or paginate. For large datasets (>1000 rows), continue paginating or use get_resource_info to retrieve the raw file URL and fetch it directly. Works for CSV/XLS resources within Tabular API size limits (CSV ≤ 100 MB, XLSX ≤ 12.5 MB).search_dataservices - Search for dataservices (APIs) registered on data.gouv.fr by keywords. Returns dataservices with metadata (title, description, organization, base API URL, tags).Parameters: query (required), page (optional, default: 1), page_size (optional, default: 20, max: 100)get_dataservice_info - Get detailed metadata about a specific dataservice (title, description, organization, base API URL, OpenAPI spec URL, license, dates, related datasets).Parameters: dataservice_id (required)get_dataservice_openapi_spec - Fetch and summarize the OpenAPI/Swagger specification for a dataservice. Returns a concise overview of available endpoints with their parameters.Parameters: dataservice_id (required)Note: Recommended workflow: 1) Use search_dataservices to find the API, 2) Use get_dataservice_info to get its metadata and documentation URL, 3) Use get_dataservice_openapi_spec to understand available endpoints and parameters, 4) Call the API using the base_api_url per the spec.get_metrics - Get metrics (visits, downloads) for a dataset and/or a resource.Parameters: dataset_id (optional), resource_id (optional), limit (optional, default: 12, max: 100)Returns monthly statistics including visits and downloads, sorted by month in descending order (most recent first). At least one of dataset_id or resource_id must be provided. Note: This tool only works with the production environment (DATAGOUV_API_ENV=prod). The Metrics API does not have a demo/preprod environment.Run the tests with pytest (these cover helper modules; the MCP server wiring is best exercised via the MCP Inspector):
# Run all tests
uv run pytest
# Run with verbose output
uv run pytest -v
# Run specific test file
uv run pytest tests/test_tabular_api.py
# Run with custom resource ID
RESOURCE_ID=3b6b2281-b9d9-4959-ae9d-c2c166dff118 uv run pytest tests/test_tabular_api.py
# Run with prod environment
DATAGOUV_API_ENV=prod uv run pytestStress tests send many concurrent requests against a running MCP server. They require a running server and make real HTTP requests, so they are excluded from default pytest runs.
# Start the server first, then in another terminal:
uv run pytest -m stressCurrently includes a test that mixes normal requests with abrupt client TCP disconnects, verifying the server stays healthy and keeps serving despite the disruption. It uses MCP_PORT (default: 8000) to connect to the local server.
Use the official MCP Inspector to interactively test the server tools and resources.
Prerequisites:
npx availableSteps:
npx @modelcontextprotocol/inspector --http-url "http://127.0.0.1:${MCP_PORT}/mcp"Adjust the URL if you exposed the server on another host/port.We welcome contributions! To keep the project stable and reviews manageable, please observe these rules before submitting:
feat: add dataset search, fix: handle empty API response). See the specification for allowed types, scopes, and breaking-change markers.We use a standard review-and-deploy process:
main branch.main, maintainers deploy changes periodically to pre-production for more tests and validation before wider release.This project follows PEP 8 style guidelines using Ruff for linting and formatting, and ty for type checking.
Either running these commands manually or installing the pre-commit hook is required before submitting contributions.
# Lint (including import sorting) and format code
uv run ruff check --fix && uv run ruff format
# Type check (ty)
uv run ty checkThis repository uses a pre-commit hook which lint and format code before each commit. Installing the pre-commit hook is strongly recommended so the checks run automatically.
Install pre-commit hooks:
uv run pre-commit installThe pre-commit hook that automatically:
The release process uses the tag_version.sh script to create git tags, GitHub releases and update CHANGELOG.md automatically. Package version numbers are automatically derived from git tags using setuptools_scm, so no manual version updates are needed in pyproject.toml.
Prerequisites: GitHub CLI must be installed and authenticated, and you must be on the main branch with a clean working directory.
# Create a new release
./tag_version.sh <version>
# Example
./tag_version.sh 2.5.0
# Dry run to see what would happen
./tag_version.sh 2.5.0 --dry-runThe script automatically:
!: in the subject)This project is licensed under the MIT License - see the LICENSE file for details.
datagouv/datagouv-mcp
November 25, 2025
April 13, 2026
Python