Core Server Settings
The host address to bind the HTTP server to.
0.0.0.0: Accept connections from any network interface (default for Docker)127.0.0.1: Only accept connections from localhost (recommended for local development)
The port number for the HTTP server.The server will be available at
http://{MCP_HOST}:{MCP_PORT}/mcp.Environment name reported to Sentry for monitoring and error tracking.Common values:This value is used to tag errors and traces in Sentry, making it easier to filter issues by environment.
local: Local development (default)demo: Demo/staging environmentpreprod: Pre-production environmentprod: Production environment
Data.gouv.fr API Settings
Controls which data.gouv.fr API environment the MCP server connects to.Available values:
prod: Production API athttps://www.data.gouv.fr(default)demo: Demo API athttps://demo.data.gouv.fr
The Metrics API only works with
prod environment. The demo environment does not have metrics data.Logging Configuration
Python logging level for application logs.Common values (from most to least verbose):
DEBUG: Detailed diagnostic informationINFO: General informational messages (default)WARNING: Warning messages for potentially problematic situationsERROR: Error messages for serious problemsCRITICAL: Critical messages for very severe errors
Monitoring and Analytics
Matomo Analytics
The MCP server includes optional support for Matomo web analytics tracking.Matomo site ID for analytics tracking.When unset or empty, Matomo tracking is disabled.The site ID is available in your Matomo dashboard under Settings → Websites.
Matomo authentication token for server-side tracking.Required when
MATOMO_SITE_ID is set. The token authenticates tracking requests to the Matomo API.The authentication token can be generated in Matomo under Settings → Personal → Security → Auth tokens.
Sentry Integration
The MCP server includes built-in support for Sentry error and performance monitoring.Sentry Data Source Name (DSN) for error and performance monitoring.When unset or empty, Sentry monitoring is disabled.The DSN is available in your Sentry project settings under “Client Keys (DSN)”.
Sampling rate for Sentry traces and performance profiles.
1.0: Sample 100% of transactions (default)0.1: Sample 10% of transactions0.0: Disable performance sampling
Configuration Examples
Local Development
For local development with maximum debugging information:.env
Testing with Demo API
To test against the demo data.gouv.fr environment:.env
Production Deployment
For production deployment with monitoring:.env
Docker Compose Production
When using Docker Compose, pass environment variables:Environment vs Production Environments
Don’t confuse
MCP_ENV with DATAGOUV_API_ENV:MCP_ENV: Controls monitoring labels (local, demo, preprod, prod)DATAGOUV_API_ENV: Controls which data.gouv.fr API to use (prod vs demo)
| Use Case | MCP_ENV | DATAGOUV_API_ENV |
|---|---|---|
| Local development | local | prod |
| Testing demo data | local or demo | demo |
| Pre-production | preprod | prod |
| Production | prod | prod |
Security Best Practices
Local Development
Bind to localhost
Always use This follows MCP security best practices and ensures the server only accepts connections from your local machine.
MCP_HOST=127.0.0.1 for local development to prevent external access:Production Deployment
Use a reverse proxy
Never expose the MCP server directly to the internet. Use a reverse proxy (nginx, Caddy, Traefik) with:
- Authentication: API keys, OAuth, or other authentication mechanisms
- Rate limiting: Protect against abuse
- TLS/SSL: Encrypt all traffic with HTTPS
- Access logs: Monitor and audit access
Sensitive Configuration
Validation
Port Validation
The server validates thatMCP_PORT is a valid integer:
Sentry Sample Rate
TheSENTRY_SAMPLE_RATE must be a float between 0.0 and 1.0:
Troubleshooting
Environment variables not loading
Ensure you’ve loaded the.env file:
Server not accessible
Check thatMCP_HOST is set correctly:
- Local development: Use
127.0.0.1 - Docker/production: Use
0.0.0.0
Sentry not receiving events
Verify your Sentry configuration:- Check that
SENTRY_DSNis set and valid - Ensure
MCP_ENVis set to help filter events - Check your Sentry project’s inbound filters
- Look for Sentry initialization messages in logs