Last Updated: March 14, 2026
✅ Core Functionality: Complete and operational
✅ All Tests: Passing (22/22 tests, 0.27s)
✅ Code Quality: Optimized (~80 lines reduced)
✅ Enhanced Logging: Implemented and documented
✅ Dataflow Blacklist: Implemented and operational
✅ Get Constraints Tool: Implemented with complete descriptions
- Feature: New MCP tool to retrieve available constraint values for each dimension with descriptions
- Implementation:
- Created
src/istat_mcp_server/tools/get_constraints.pyhandler - Added
DimensionConstraintWithDescriptionsandTimeConstraintOutputmodels - Combines data from:
- availableconstraint endpoint (valid values per dimension)
- datastructure endpoint (dimension-to-codelist mapping)
- codelist endpoint (code descriptions in IT/EN)
- Returns complete JSON with dimensions, codelists, codes, and descriptions
- Maintains dimension order from datastructure
- Special handling for TIME_PERIOD dimension
- Created
- Caching: 1 month TTL for constraints
- Tests: 4 comprehensive tests covering success, errors, and edge cases
- Documentation: Updated README.md with usage examples
- Feature: Filter out specific dataflows from all queries
- Implementation:
- Created
src/istat_mcp_server/utils/blacklist.pymodule - Environment variable configuration via
DATAFLOW_BLACKLIST - Automatic filtering in
discover_dataflowstool - Validation blocking in
get_datatool
- Created
- Configuration: Comma-separated list in
.envfile - Use Cases:
- Exclude deprecated datasets
- Filter problematic dataflows
- Hide internal/test datasets
- Documentation: Updated README.md with configuration guide
- Problem: ISTAT API returned 404 errors for queries with incorrect dimension formatting
- Solution:
- Empty dimensions now use
.between separators (not...) - Added conditional
/ALL/suffix based on dimension path - Example fixed:
/data/{id}/A.IT.LU.1092./ALL/(was/data/{id}/A.IT.LU.1092.../ALL/)
- Empty dimensions now use
- Files Modified:
src/istat_mcp_server/api/client.py(fetch_data method)
- Problem: Datastructures with empty dimension elements caused malformed queries
- Solution: Added filter
if not dimension: continuein fetch_datastructure - Location:
src/istat_mcp_server/api/client.pyline ~296 - Impact: Prevents queries like
............/ALL/that cause 404 errors
- Achievement: Reduced ~80 lines across 4 files
- Techniques Applied:
- List comprehensions for filtering
- Dict comprehensions for mappings
next()instead of loops for single items- Context managers for diskcache
- Inline cache key construction
- Files Optimized:
src/istat_mcp_server/tools/get_data.pysrc/istat_mcp_server/tools/discover_dataflows.pysrc/istat_mcp_server/tools/get_cache_diagnostics.pysrc/istat_mcp_server/api/client.py
- Features:
- MCP tool call logging: Arguments (JSON), execution time, response size
- HTTP request logging: Visual symbols (→/←/✗), timing, response size
- Structured format for easy parsing and analysis
- Documentation: Created
LOGGING_FORMAT.md - Files Modified:
src/istat_mcp_server/server.py(tool call wrapper)src/istat_mcp_server/api/client.py(_get method enhancement)
- Status: All 22 tests passing
- Execution Time: 0.27 seconds
- Coverage: API client, cache system, all tools including get_constraints
- New Tests: 4 tests for get_constraints tool
- Files:
tests/directory
Issue ID: CLAUDE-CONFIG-001 Priority: High Status: Active Investigation
Description:
Claude Desktop rewrites %APPDATA%\Claude\claude_desktop_config.json on startup, removing the mcpServers section that configures the ISTAT MCP server.
Impact:
- Server fails to load automatically when Claude Desktop starts
- User must manually reconfigure after each restart
Evidence:
- Server worked correctly on March 12, 2026 21:50 (log files confirm)
- Log file size: 5.2 MB (
mcp-server-istat.log) - All tools executed successfully in previous sessions
- Configuration file consistently reset to defaults
Root Cause Analysis:
- Claude Desktop writes config file multiple times during startup
mcpServerssection is either:- Stored in a different location (database, registry, UI-managed)
- Managed through Claude Desktop UI (not yet discovered)
- Subject to a bug in current Claude Desktop version
Current Workarounds:
-
PowerShell Scripts (preferred):
setup_claude_config.ps1- Configure before startingverify_claude_config.ps1- Verify after startup
-
Manual Testing:
.venv\Scripts\python.exe -m istat_mcp_server
-
Read-only Flag (risky):
- Makes config file read-only
- May prevent Claude Desktop from saving other settings
Documentation Created:
CONFIGURAZIONE_CLAUDE.md- Complete setup guideTROUBLESHOOTING_CLAUDE.md- Detailed troubleshooting procedures- Updated
SKILLS.md- User-facing workflow guide - Updated
copilot-instructions.md- Developer reference
Next Steps:
- ✅ Document the issue thoroughly
- ✅ Create setup/verification scripts
- ⏳ Check Claude Desktop UI for MCP server management
- ⏳ Investigate SQLite database (
DIPSfile) for configurations - ⏳ Check Windows Registry for MCP server settings
- ⏳ Contact Anthropic support if issue persists
- Lines of Code: ~1,800 (after get_constraints addition)
- Test Coverage: Core functionality covered (22 tests)
- Type Hints: 100% of public APIs
- Docstrings: Google-style for all public functions
- API Rate Limit: 3 calls/minute (enforced)
- Cache Hit Rate: High (24h for dataflows, 1 month for metadata/constraints)
- Average Tool Execution: < 1 second (cached), 1-3 seconds (API call)
- Test Suite Execution: 0.27 seconds
- Total Tools: 7
- discover_dataflows: Find datasets by keywords (with blacklist filtering)
- get_structure: Get dimension definitions and codelists
- get_constraints: Get available values for dimensions with descriptions (NEW)
- get_codelist_description: Get codelist value descriptions
- get_concepts: Get all concept schemes
- get_data: Fetch actual statistical data (with blacklist validation)
- get_cache_diagnostics: Debug cache system (cached), 1-3 seconds (API call)
- Test Suite Execution: 0.19 seconds
- Python 3.11+
- MCP SDK 0.9.0+
- 11 runtime dependencies (see
pyproject.toml) - All dependencies up-to-date
src/istat_mcp_server/server.py- MCP server initialization (7 tools)src/istat_mcp_server/api/client.py- ISTAT API clientsrc/istat_mcp_server/api/models.py- Pydantic models (including constraint models)src/istat_mcp_server/cache/manager.py- Cache managementsrc/istat_mcp_server/tools/*.py- 7 tool implementations:- discover_dataflows.py
- get_structure.py
- get_constraints.py (NEW)
- get_codelist_description.py
- get_concepts.py
- get_data.py
- get_cache_diagnostics.py
src/istat_mcp_server/utils/blacklist.py- Dataflow blacklist manager
README.md- Project overview and installation (updated for get_constraints)SKILLS.md- User workflow guideBLACKLIST_GUIDE.md- Blacklist configuration guide.github/instructions/copilot-instructions.md- Developer referenceLOGGING_FORMAT.md- Logging documentationCONFIGURAZIONE_CLAUDE.md- Claude Desktop setupTROUBLESHOOTING_CLAUDE.md- Troubleshooting procedures
setup_claude_config.ps1- Configure Claude Desktopverify_claude_config.ps1- Verify configuration
tests/conftest.py- Test fixtures (including mock_cache_manager)tests/test_*.py- 7 test modules (22 tests total):- test_blacklist.py (12 tests)
- test_cache.py (4 tests)
- test_get_constraints.py (4 tests, NEW)
- test_validators.py (2 tests)
pytest.ini- Test configuration
pyproject.toml- Project metadata and dependencies.env.example- Environment variables templateruff.toml- Code formatter configuration
Added:
- get_constraints tool - New MCP tool combining constraints, structure, and codelist descriptions
- Mock cache manager fixture for testing
- 4 comprehensive tests for get_constraints
- DimensionConstraintWithDescriptions and TimeConstraintOutput models
Updated:
- README.md with get_constraints examples and workflow
- PROJECT_STATUS.md with latest metrics (22 tests, 7 tools)
- Server tool count from 6 to 7
Testing:
- All 22 tests passing (18 existing + 4 new)
- Execution time: 0.27 seconds
Added:
- Dataflow blacklist system with environment variable configuration
- Empty dimension filtering in datastructure parser
- Enhanced logging for MCP tools and HTTP requests
- Configuration management scripts for Claude Desktop
- Comprehensive troubleshooting documentation
- 12 tests for blacklist functionality
Fixed:
- ISTAT API query string format for empty dimensions
- Double slash issue when dimension path is empty
- Cache key construction for data queries
Add get_constraints tool- ✅ COMPLETED (March 14, 2026)
- Verify constraint ordering - Ensure dimensions maintain correct order
- Add Resources capability - Expose cached data as MCP resources
- Implement Prompts capability - Pre-built analysis prompts
- Add data format conversion - CSV output option
- Added
BLACKLIST_GUIDE.md - Added
LOGGING_FORMAT.md - Added
CONFIGURAZIONE_CLAUDE.md - Added
TROUBLESHOOTING_CLAUDE.md - Updated
SKILLS.mdwith configuration section - Updated
copilot-instructions.mdwith recent changes and lessons learned
- Resolve Claude Desktop configuration issue - Blocks automatic loading
- Add get_concepts tool tests - Currently missing from test suite
- Verify dataflow discovery filtering - Ensure keywords work correctly
- Add Resources capability - Expose cached data as MCP resources
- Implement Prompts capability - Pre-built analysis prompts
- Add data format conversion - TSV/CSV output in get_data
- Enhance error messages - More user-friendly error descriptions
- Add progress indicators - For long-running API calls
- Implement partial caching - Cache query filters separately
- Add data validation - Verify SDMX XML structure
- Performance profiling - Identify bottlenecks
Developer: [Your Name]
Repository: [GitHub Link]
Issues: [GitHub Issues Link]
Documentation: See README.md and SKILLS.md
For questions about:
- Usage: See
SKILLS.md - Development: See
.github/instructions/copilot-instructions.md - Claude Desktop: See
CONFIGURAZIONE_CLAUDE.mdandTROUBLESHOOTING_CLAUDE.md - Logging: See
LOGGING_FORMAT.md