BDL MCP Server
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
BDL MCP Server
MCP (Model Context Protocol) Server for Bank Danych Lokalnych (BDL) API running on Cloudflare Workers.
Overview
This server exposes the Polish Central Statistical Office (GUS) Local Data Bank API as MCP tools, allowing AI assistants like Claude to query statistical data about Poland's territorial units, demographics, economy, and more.
Related MCP server: mcp-csu
Features
🚀 Runs on Cloudflare Workers (edge computing, global distribution)
📊 Full BDL API coverage with 25+ tools
🌐 Supports both Polish and English language responses
🔄 SSE and Streamable HTTP transport
✅ Type-safe with TypeScript and Zod validation
Available Tools
Aggregates
get_aggregates- List aggregation levels (voivodeship, county, commune, etc.)get_aggregate- Get specific aggregation level details
Attributes
get_attributes- List data attributes/flagsget_attribute- Get specific attribute details
Levels
get_levels- List territorial levelsget_level- Get specific level details
Measures
get_measures- List measurement unitsget_measure- Get specific measure details
Subjects (Statistical Categories)
get_subjects- List statistical subjects/categoriesget_subject- Get specific subject detailssearch_subjects- Search subjects by name
Units (Territorial Divisions)
get_units- List territorial units (voivodeships, counties, communes)get_unit- Get specific unit by TERYT codesearch_units- Search units by name
Localities
get_localities- List localities (cities, towns, villages)get_locality- Get specific locality detailssearch_localities- Search localities by name
Variables (Statistical Indicators)
get_variables- List statistical variablesget_variable- Get variable details including available yearssearch_variables- Search variables by name
Data
get_data_by_variable- Get data for a variable across unitsget_data_by_unit- Get data for a unit across variablesget_locality_data_by_variable- Get locality-level data by variableget_locality_data_by_unit- Get locality-level data by unit
Years
get_years- List available years in databaseget_year- Get specific year details
Meta
get_api_version- Get API version information
Installation
Prerequisites
Node.js 18+
Cloudflare account
Wrangler CLI
Setup
# Clone or copy the project
cd bdl-mcp-server
# Install dependencies
npm install
# Run locally
npm run dev
# Deploy to Cloudflare Workers
npm run deployConfiguration
Edit wrangler.toml to customize:
[vars]
BDL_API_BASE_URL = "https://bdl.stat.gov.pl/api/v1"
DEFAULT_LANGUAGE = "pl" # or "en"Usage
Connecting with Claude Desktop
Add to your Claude Desktop config (claude_desktop_config.json):
{
"mcpServers": {
"bdl": {
"url": "https://your-worker.your-subdomain.workers.dev/sse"
}
}
}Connecting with MCP Inspector
Start the server locally:
npm run devOpen MCP Inspector at
http://localhost:5173Connect to
http://localhost:8787/sse
Direct API Usage
Health Check:
curl https://your-worker.workers.dev/MCP Request (Streamable HTTP):
curl -X POST https://your-worker.workers.dev/mcp \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/list"
}'Example Queries
Get Population Data for Warsaw
{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_units",
"arguments": {
"name": "Warszawa",
"lang": "en"
}
}
}Get Available Statistical Variables for Demographics
{
"jsonrpc": "2.0",
"id": 2,
"method": "tools/call",
"params": {
"name": "search_variables",
"arguments": {
"name": "population",
"lang": "en"
}
}
}Get Data for a Specific Variable
{
"jsonrpc": "2.0",
"id": 3,
"method": "tools/call",
"params": {
"name": "get_data_by_variable",
"arguments": {
"varId": 72305,
"unitLevel": 2,
"year": 2023,
"lang": "en"
}
}
}Project Structure
bdl-mcp-server/
├── src/
│ ├── index.ts # Cloudflare Workers entry point
│ ├── mcp-server.ts # MCP protocol implementation
│ ├── tools.ts # Tool definitions with Zod schemas
│ ├── tool-handler.ts # Tool execution logic
│ ├── bdl-client.ts # BDL API client
│ └── types.ts # TypeScript types from Swagger
├── package.json
├── tsconfig.json
├── wrangler.toml # Cloudflare Workers config
└── README.mdDevelopment
# Start development server with hot reload
npm run dev
# Type check
npm run build
# Deploy to production
npm run deployAPI Reference
This server implements the Model Context Protocol specification, exposing the BDL API through MCP tools.
Endpoints
GET /- Health check and server infoGET /sse- SSE connection for MCP clientsPOST /mcp- Streamable HTTP endpoint for JSON-RPC requests
Transport
Supports both:
SSE (Server-Sent Events) - For real-time bidirectional communication
Streamable HTTP - For request/response style communication
License
MIT
Links
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Experimental MCP exploring Polish administrative units and BDL statistics.
Polish public statistics (GUS, NBP, Eurostat) with unit, period and source. Data tools only read.
Access European statistics: GDP, unemployment, inflation, population data.
Public Data Ukraine Mcp connects AI agents to real public APIs via MCP. Tools include
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server providing AI assistants access to Polish public registries (KRS, CEIDG) and statistical data (GUS BDL) for querying companies, sole proprietorships, and regional statistics.67MIT
- AlicenseAqualityDmaintenanceProvides AI assistants direct access to 700+ statistical datasets about the Czech Republic, including population, economy, prices, wages, employment, industry, agriculture, trade, tourism, environment, and more.122MIT
- AlicenseAqualityDmaintenanceMCP server that provides AI agents with Polish business data tools: identifier validation (NIP, PESEL, REGON, KRS, IBAN), VAT whitelist checks, EU VIES lookups, and NBP exchange rates.513 npmMIT
- AlicenseAqualityCmaintenanceLocal MCP server for querying Polish socioeconomic statistics from the GUS Bank Danych Lokalnych (BDL), letting AI find variables and units and pull data.5MIT