How datagouv/datagouv-mcp works
This is a Python MCP server that lets chatbots search and inspect the data.gouv.fr open-data catalog, retrieve resource data, and explore registered third-party APIs. The principal workflow is chatbot request → registered MCP tool → catalog or data-service client → formatted result. Tools cover dataset and organization discovery, dataset/resource details, tabular queries, metrics, and third-party API specifications. The graph also shows supporting API clients, health/telemetry, and configuration. Some tool and server behavior is known only from the README or source index; those links are cited accordingly.
Main entry points: datagouv_api_client.py Catalog API client · __init__.py Tool registry · main.py MCP entrypoint · logging.py Tool logging
Components 29
MCP server
- MCP entrypoint
main.py - Tool registry
tools/__init__.py
Catalog discovery
- Search datasets
tools/search_datasets.py - Search organizations
tools/search_organizations.py - Search APIs
tools/search_dataservices.py - Dataset details
tools/get_dataset_info.py - List resources
tools/list_dataset_resources.py - Resource details
tools/get_resource_info.py - API details
tools/get_dataservice_info.py - API specification
tools/get_dataservice_openapi_spec.py
Data exploration
- Query tabular data
tools/query_resource_data.py - Metrics tool
tools/get_metrics.py
Clients and operations
- Catalog API client
helpers/datagouv_api_client.py - Crawler API client
helpers/crawler_api_client.py - Tabular API client
helpers/tabular_api_client.py - Metrics API client
helpers/metrics_api_client.py - Endpoint configuration
helpers/env_config.py - SSRF safeguards
helpers/ssrf.py - Health probe
helpers/health_probe.py - Tool logging
helpers/logging.py - Usage analytics
helpers/matomo.py - Tool defaults
helpers/mcp_tool_defaults.py - Service identity
helpers/user_agent.py
Other components
- Chatbot client
- data.gouv.fr APIs
- Crawler service
- Tabular service
- Metrics service
- Matomo
Connections 48
- Chatbot client → MCP entrypoint: requests tools
README.md - MCP entrypoint → Tool registry: registers tools
main.py - MCP entrypoint → Health probe: uses probe
main.py - MCP entrypoint → Tool logging: uses logging
main.py - MCP entrypoint → Usage analytics: sets context
main.py - Tool registry → Search datasets: registers
tools/__init__.py - Tool registry → Search organizations: registers
tools/__init__.py - Tool registry → Search APIs: registers
tools/__init__.py - Tool registry → Dataset details: registers
tools/__init__.py - Tool registry → List resources: registers
tools/__init__.py - Tool registry → Resource details: registers
tools/__init__.py - Tool registry → API details: registers
tools/__init__.py - Tool registry → API specification: registers
tools/__init__.py - Tool registry → Query tabular data: registers
tools/__init__.py - Tool registry → Metrics tool: registers
tools/__init__.py - Search datasets → Catalog API client: queries catalog
tools/search_datasets.py - Search organizations → Catalog API client: queries catalog
tools/search_organizations.py - Search APIs → Catalog API client: queries catalog
tools/search_dataservices.py - Dataset details → Catalog API client: fetches details
tools/get_dataset_info.py - List resources → Catalog API client: fetches resources
tools/list_dataset_resources.py - Resource details → Catalog API client: fetches metadata
tools/get_resource_info.py - Resource details → Crawler API client: checks resource
tools/get_resource_info.py - API details → Catalog API client: fetches details
tools/get_dataservice_info.py - API specification → Catalog API client: fetches specification
tools/get_dataservice_openapi_spec.py - API specification → SSRF safeguards: validates URL
tools/get_dataservice_openapi_spec.py - Query tabular data → Catalog API client: fetches metadata
tools/query_resource_data.py - Query tabular data → Tabular API client: queries rows
tools/query_resource_data.py - Metrics tool → Catalog API client: fetches catalog data
tools/get_metrics.py - Metrics tool → Metrics API client: fetches metrics
tools/get_metrics.py - Catalog API client → data.gouv.fr APIs: calls API
helpers/datagouv_api_client.py - Crawler API client → Crawler service: calls API
helpers/crawler_api_client.py - Tabular API client → Tabular service: calls API
helpers/tabular_api_client.py - Metrics API client → Metrics service: calls API
helpers/metrics_api_client.py - Catalog API client → Endpoint configuration: gets endpoints
helpers/datagouv_api_client.py - Crawler API client → Endpoint configuration: gets endpoints
helpers/crawler_api_client.py - Tabular API client → Endpoint configuration: gets endpoints
helpers/tabular_api_client.py - Metrics API client → Endpoint configuration: gets endpoints
helpers/metrics_api_client.py - Catalog API client → Service identity: sets identity
helpers/datagouv_api_client.py - Crawler API client → Service identity: sets identity
helpers/crawler_api_client.py - Tabular API client → Service identity: sets identity
helpers/tabular_api_client.py - Metrics API client → Service identity: sets identity
helpers/metrics_api_client.py - Search datasets → Tool logging: logs calls
tools/search_datasets.py - Search APIs → Tool logging: logs calls
tools/search_dataservices.py - Query tabular data → Tool logging: logs calls
tools/query_resource_data.py - Search datasets → Tool defaults: declares behavior
tools/search_datasets.py - API specification → Tool defaults: declares behavior
tools/get_dataservice_openapi_spec.py - Tool logging → Usage analytics: tracks events
helpers/logging.py - Usage analytics → Matomo: posts events
helpers/matomo.py