Test the MCP server
mainAutomated Tests (pytest)
Run tests using uv run pytest.
- Verbose:
uv run pytest -v - Specific file:
uv run pytest tests/test_tabular_api.py - With environment:
DATAGOUV_API_ENV=prod uv run pytest
Stress Tests
Requires a running server. These test concurrency and client disconnect handling.
# In a new terminal while server is running:
uv run pytest -m stressHealth Check
Validates the end-to-end stack (tool layer + data.gouv.fr API).
uv run pytest -m health_checkLocal Tool Testing Script
Use scripts/call_tool.py to call tools without manual JSON-RPC handshakes. Requires a running server.
python scripts/call_tool.py search_datasets '{"query": "IRVE"}'Interactive Testing (MCP Inspector)
Use the official MCP Inspector to test tools interactively. Requires Node.js.
- Start the MCP server.
- In another terminal:
npx @modelcontextprotocol/inspector --http-url "http://127.0.0.1:${MCP_PORT}/mcp"