Israel Statistics MCP
Israel Statistics MCP
Installation
npx israel-statistics-mcpAsk AI about Israel Statistics MCP
Powered by Claude Β· Grounded in docs
I know everything about Israel Statistics MCP. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Israel Statistics MCP Server
A Model Context Protocol (MCP) server that provides programmatic access to the Israeli Central Bureau of Statistics (CBS) price indices and economic data. Built with TypeScript, this server offers 8 comprehensive tools for retrieving, analyzing, and calculating Israeli economic statistics.
π³ Installation & Usage
Docker (Recommended)
// .mcp.json
{
"israel-statistics-mcp": {
"command": "docker",
"args": ["run", "--rm", "-i", "reuvenaor/israel-statistics-mcp:latest"]
}
}
NPX
// .mcp.json
{
"israel-statistics-mcp": {
"command": "npx",
"args": ["@reuvenorg/israel-statistics-mcp"]
}
}
Claude Desktop Integration
# Quick setup
claude mcp add --scope project israel-statistics-mcp npx @reuvennaor85/israel-statistics-mcp
π Features
π Comprehensive Economic Data Access
- Consumer Price Index (CPI) - General and detailed price indices
- Housing Market Index - Real estate prices with bi-monthly updates
- Producer Price Indices - Industrial, exports, and services
- Specialized Indices - Construction, agriculture, transportation, and more
- Price Linkage Calculator - Inflation adjustment calculations
π‘οΈ Enterprise-Grade Architecture
- Type-Safe Validation - Complete Zod schema validation for all inputs/outputs
- Rate Limiting - Built-in protection (5 concurrent operations max)
- Error Handling - Comprehensive CBS API error handling and retry logic
- Multi-Format Support - JSON and XML response parsing
- Housing Market Warnings - Automatic notifications for bi-monthly provisional data
π Advanced Data Processing
- XML/JSON Transformation - Seamless conversion from CBS API formats
- Statistical Calculations - Automatic averages, counts, and summaries
- Date Range Filtering - Flexible period selection (monthly/quarterly)
- Search & Discovery - Full-text search across indices and topics
- Pagination Support - Handle large datasets efficiently (up to 1000 items/page)
π Available MCP Tools
| Tool | Description | Key Parameters |
|---|---|---|
get_index_topics | Browse all available index categories and topics | period, searchText, lang |
get_catalog_chapters | Get all index chapters (CPI, Housing, etc.) | lang, pagesize |
get_chapter_topics | Get topics within a specific chapter | chapterId, lang |
get_subject_codes | Get index codes for a specific topic | subjectId, searchText |
get_index_data | Retrieve historical price data for an index | code, startPeriod, endPeriod |
get_index_calculator | Calculate inflation-adjusted values | indexCode, value, fromDate, toDate |
get_main_indices | Get current main economic indices | oldFormat, lang |
get_all_indices | Get comprehensive index data with filtering | chapter, oldFormat |
ποΈ Architecture
src/
βββ index.ts # MCP server entry point with tool registration
βββ mcp/
β βββ handlers/ # 8 MCP tool handlers
β β βββ getIndexTopics.ts # Browse available indices
β β βββ getCatalogChapters.ts # Get index chapters
β β βββ getChapterTopics.ts # Topics by chapter
β β βββ getSubjectCodes.ts # Index codes by topic
β β βββ getIndexData.ts # Historical price data
β β βββ getIndexCalculator.ts # Inflation calculator
β β βββ getMainIndices.ts # Main indices (current + by period)
β β βββ getAllIndices.ts # All indices with filtering
β βββ helpers/
β βββ fetcher.ts # Secure CBS API client with XML/JSON parsing
β βββ housingWarnings.ts # Housing market data warnings
βββ schemas/ # Type-safe Zod validation schemas
β βββ request.schema.ts # Input validation schemas
β βββ response.schema.ts # Output validation schemas
β βββ base.schema.ts # Reusable object schemas
β βββ shared.schema.ts # Common enums and types
βββ utils/
βββ registry-security.ts # Security utilities
βββ spinner.ts # MCP progress notifications
π Security Features
- Rate Limiting: Maximum 5 concurrent operations
- Input Validation: Comprehensive Zod schema validation
- URL Validation: Allowlist-based registry URL security
- Error Sanitization: Safe error message handling
- Timeout Protection: 30-second HTTP request timeouts
π Schema Architecture
π CBS API Coverage
The server implements complete coverage of the CBS Israel Statistics API:
Index Discovery Endpoints
GET /index/catalog/treeβget_index_topicsGET /index/catalog/catalogβget_catalog_chaptersGET /index/catalog/chapterβget_chapter_topicsGET /index/catalog/subjectβget_subject_codes
Data Retrieval Endpoints
GET /index/data/priceβget_index_dataGET /index/data/calculator/{id}βget_index_calculatorGET /index/data/price_selectedβget_main_indicesGET /index/data/price_selected_bβget_main_indices_by_periodGET /index/data/price_allβget_all_indices
Supported Index Categories
| Chapter | Description | Examples |
|---|---|---|
a | Consumer Price Index | Food, clothing, housing costs |
aa | Housing Market Index | Real estate prices (bi-monthly) |
b | Producer Price Index - Industrial | Manufacturing output prices |
ba | Producer Price Index - Exports | Export prices for industry |
bb | Producer Price Index - Services | Service industry prices |
c | Residential Building Input | Construction material costs |
ca | Commercial Building Input | Office building costs |
d | Road Construction Input | Infrastructure costs |
e | Agriculture Input | Agricultural input costs |
f | Bus Input | Public transportation costs |
fa | Public Minibus Input | Public transport vehicle costs |
β οΈ Housing Price Index Special Considerations
The server automatically detects and warns about Housing Price Index data:
- Bi-monthly Publication: Updates every 2 months vs. monthly for other indices
- Temporal Lag: Data reflects transactions from 2-3 months ago vs. 3-4 months ago
- Provisional Data: Last 3 indices may be updated when additional reports arrive
- Linkage Warnings: Automatic recommendations against using provisional periods
π§ͺ Testing & Quality Assurance
Comprehensive Test Suite
- Unit Tests: Complete handler coverage with Vitest
- Integration Tests: Real CBS API integration tests
- Mock Testing: Isolated handler testing with mocked dependencies
- Error Handling: Network error and API error simulation
- Schema Validation: Input/output validation testing
Code Quality Tools
- TypeScript: Strict type checking with no
anytypes - ESLint: Modern flat config with TypeScript rules
- Prettier: Consistent code formatting
- Zod: Runtime type validation and inference
Development Commands
# Development
pnpm dev # Watch mode development
pnpm build # Production build
pnpm typecheck # TypeScript validation
# Testing
pnpm test # Run all tests
pnpm test:dev # Development mode testing
# Quality
pnpm lint # Lint code
pnpm lint:fix # Fix linting issues
pnpm format:check # Check formatting
pnpm format:write # Apply formatting
# Docker
docker build -t reuvenaor/israel-statistics-mcp:latest -f Dockerfile .
π§ Development
Project Structure
- TypeScript ESM: Modern ES modules with TypeScript
- pnpm: Fast, efficient package management
- tsup: Fast TypeScript bundler with ESM output
- Docker: Multi-stage builds for optimized containers
- Vitest: Fast unit testing framework
Key Dependencies
@modelcontextprotocol/sdk: MCP server implementationzod: Type-safe validation and schema inferencenode-fetch: HTTP client for CBS API callsxml2js: XML response parsingtypescript: Type system and compilation
Configuration Files
tsconfig.json: TypeScript configuration with strict settingseslint.config.js: Modern ESLint flat configurationprettier.config.cjs: Code formatting rulesvitest.config.ts: Test framework configurationtsup.config.ts: Build tool configurationDockerfile: Multi-stage container build
π Performance & Scalability
- Rate Limiting: 5 concurrent operations maximum
- Efficient Parsing: Optimized XML/JSON transformation
- Memory Management: Streaming for large datasets
- Caching: Schema validation caching
- Error Recovery: Graceful degradation and retry logic
π API Response Examples
Index Topics Discovery
// Input
{ lang: "en", searchText: "housing", period: "M" }
// Output
{
topics: [
{
chapterId: "aa",
chapterName: "Housing Market Index",
subject: [
{
subjectId: 123,
subjectName: "Apartment Prices",
code: [
{
codeId: 180010,
codeName: "Housing Price Index - General"
}
]
}
]
}
],
summary: "Found 15 index codes. β οΈ Housing Price Index: This is a bi-monthly index..."
}
Price Linkage Calculation
// Input
{
indexCode: 120010,
value: 1000,
fromDate: "01-01-2020",
toDate: "01-01-2024"
}
// Output
{
request: { code: 120010, sum: 1000, from_date: "2020-01-01", to_date: "2024-01-01" },
answer: {
from_value: 1000,
to_value: 1155.2,
change_percent: 15.52,
base_year: "2022"
},
summary: "Linked 1000 from 2020-01-01 to 2024-01-01: 1155.2 (15.52% change)"
}
π License
MIT License - see LICENSE file for details.
π Links
- Repository: https://github.com/reuvenaor/israel-statistics-mcp
- Docker Hub: reuvenaor/israel-statistics-mcp
- NPM Package: @reuvenorg/israel-statistics-mcp
- CBS API Documentation: Israel Central Bureau of Statistics
- MCP Protocol: Model Context Protocol Specification
Built with β€οΈ for the Israeli tech community and economic research
