Automated tests with pytest
The project uses pytest with asyncio support to test helper modules and core functionality.Running tests
Run all tests:Test configuration
You can customize test behavior using environment variables:Test files
The test suite covers several areas:tests/test_tabular_api.py- Tabular API client teststests/test_metrics_api.py- Metrics API client teststests/test_datagouv_api.py- Main data.gouv.fr API client teststests/test_crawler_api.py- Crawler API client teststests/test_health_endpoint.py- Health endpoint teststests/test_env_config.py- Environment configuration tests
The automated tests primarily cover helper modules. For comprehensive testing of the MCP server tools and endpoints, use MCP Inspector.
Interactive testing with MCP Inspector
MCP Inspector provides an interactive way to test server tools and resources in real-time.Prerequisites
You need Node.js withnpx available on your system.
Using MCP Inspector
- Start the MCP server locally (see Running Locally)
- In a separate terminal, launch the inspector:
Replace
${MCP_PORT} with your actual port number (default is 8000). If you exposed the server on a different host or port, adjust the URL accordingly.What you can test
With MCP Inspector, you can:- Test all available MCP tools interactively
- Inspect tool schemas and parameters
- View real-time responses
- Debug tool behavior with actual data.gouv.fr data
- Test different parameter combinations
- Testing search queries with
search_datasetsandsearch_dataservices - Verifying resource data retrieval with
query_resource_data - Checking metadata responses from
get_dataset_infoandget_resource_info - Validating OpenAPI spec parsing with
get_dataservice_openapi_spec