Spaces:
Running
Running
Commit History
15 days ago
-
better error handling
61d2b72
-
Gradio 6 (transport MCP Streamable HTTP + SSE), sorties JSON compactes, sources réparées, find_territory, page Space
- Gradio 5.29 → 6.15.2 : /gradio_api/mcp/ répondait 404 (SSE seul), d'où le 502 des connecteurs claude.ai / Claude Code ; noms d'outils corrigés (préfixe sans underscore). - Outils déclarés via gr.api() : schéma dérivé des docstrings, réponses en JSON compact (plus de repr pydantic « root={...} »), limites et troncature signalées, valeurs numériques. - get_indicator_details : les sources échouaient toujours (dimension « libelle » inexistante) ; seules les dimensions listées par /meta sont demandées. - Recherche insensible aux accents/pluriels avec score ; find_territory (nom → code INSEE/SIREN). - Interface : accueil, tableaux, bloc de connexion (URL réelle, snippets), exemples ; README carte HF. - Tests hors ligne sur un backend simulé construit à partir de réponses réelles (17 tests). Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>febc39b
-
feat: Implement MCP Server for Indicateurs Territoriaux API
Add complete MCP server exposing 4 tools for querying French territorial ecological indicators via the CGDD/Ministry Cube.js API. Tools implemented: - list_indicators: List all indicators with thematique/maille filters - get_indicator_details: Get full metadata and sources for an indicator - query_indicator_data: Query data values by geographic level and code - search_indicators: Full-text search in indicator names/descriptions Architecture: - Gradio SSE endpoint at /gradio_api/mcp/ for Claude.ai integration - CubeResolver for mapping indicator_id to data cubes via /meta parsing - Metadata cache with periodic refresh - Async httpx client with proper error handling Cube naming convention discovered: - Data cubes: {thematique}_{maille} (e.g., conso_enaf_com) - Measures: {cube}.id_{indicator_id} (e.g., conso_enaf_com.id_611) - Geo dimensions: geocode_*/libelle_* for all levels Co-authored-by: Cursor <cursoragent@cursor.com>bad6218