Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/datagouv/datagouv-mcp/llms.txt

Use this file to discover all available pages before exploring further.

This guide walks you through installing and running the data.gouv.fr MCP server manually using the uv package manager.

Prerequisites

Before you begin, ensure you have:
  • Python 3.13+ installed on your system
  • uv package manager installed

Installation Steps

1

Clone the repository

Clone the repository and navigate to the project directory:
git clone git@github.com:datagouv/datagouv-mcp.git
cd datagouv-mcp
2

Install dependencies

Use uv to install all required Python dependencies:
uv sync
This command reads the project configuration and installs all dependencies specified in pyproject.toml.
3

Configure environment variables

Copy the example environment file to create your own configuration:
cp .env.example .env
The .env.example file contains all available configuration options with sensible defaults. You can edit the .env file to customize settings for your environment.Example .env configuration:
MCP_HOST=127.0.0.1  # Bind to localhost for local development
MCP_PORT=8000       # HTTP server port
MCP_ENV=local       # Environment name for monitoring
DATAGOUV_API_ENV=prod  # Use production data.gouv.fr API
LOG_LEVEL=INFO      # Logging verbosity
For local development, set MCP_HOST=127.0.0.1 to follow MCP security best practices. This ensures the server only accepts connections from your local machine.
See the Configuration page for detailed information about all available environment variables.
4

Load environment variables

Load the environment variables into your shell session:
set -a && source .env && set +a
This command exports all variables from the .env file to your current shell.
5

Start the server

Run the MCP server:
uv run main.py
The server will start on the configured host and port (default: http://127.0.0.1:8000).
6

Verify the installation

Test that the server is running by accessing the health endpoint:
curl http://127.0.0.1:8000/health
You should receive a JSON response like:
{
  "status": "ok",
  "timestamp": "2026-03-04T12:34:56.789Z",
  "version": "1.0.0"
}

Next Steps

Now that you have the server running:
  • Connect a chatbot: Follow the connection instructions in the README to integrate with Claude, ChatGPT, or other MCP clients
  • Configure advanced settings: See the Configuration page for all available options
  • Deploy with Docker: Check out the Docker deployment guide for production deployments

Troubleshooting

Port already in use

If port 8000 is already in use, change the MCP_PORT in your .env file:
MCP_PORT=8007

Python version issues

Ensure you have Python 3.13 or higher:
python --version

Dependencies installation fails

Make sure uv is up to date:
pip install --upgrade uv