World Bank Indicators API MCP Server
Fetch World Bank indicators with this MCP server for fast API access, filtering, and format-ready results.
npx -y @anshumax/world_bank_mcp_serverOverview
This MCP (Model Context Protocol) server exposes World Bank indicators through a lightweight HTTP API designed for fast access, convenient filtering, and format-ready responses that are easy to consume by developer tooling and LLM-driven agents. Instead of querying the World Bank REST API directly from every client, the MCP server acts as a focused middle layer that translates common query patterns (country, indicator, date ranges, formats) into optimized responses and a small manifest that describes available operations for model-context integrations.
The server is useful when you want reproducible, low-latency retrieval of macroeconomic and development indicators (GDP, population, etc.), standardized result shapes for downstream processing, and optional output formats such as JSON or CSV. It is particularly handy for applications that integrate data into prompts or tools for LLMs via a Model Context Protocol manifest or for building dashboards and analytic scripts that need uniform, cached access.
Features
- REST endpoints that mirror common World Bank indicator queries (by indicator, country, and date range)
- Filtering and pagination (country, country code, start/end year, per-page, page)
- Multiple output formats: JSON (default), CSV, and simple table-friendly JSON
- Lightweight manifest for MCP-compatible tooling and agent discovery
- Optional caching and rate limiting to reduce direct World Bank API load
- Docker-friendly for quick deployment and local development
- Minimal configuration via environment variables
Installation / Configuration
- Clone the repository:
- Choose a runtime based on files in the repo:
- If you see package.json, use Node.js:
# install dependencies # start server - If you see requirements.txt or pyproject.toml, use Python:
# start server (example)
- Or run with Docker:
# build
# run
- Common environment variables
| Variable | Default | Purpose |
|---|---|---|
| PORT | 8080 | HTTP port to listen on |
| CACHE_TTL | 300 | Cache lifetime in seconds for fetched indicator results |
| WB_BASE_URL | (World Bank API) | Base URL for World Bank API (override for proxies/testing) |
| RATE_LIMIT | (disabled) | Requests per minute cap (optional) |
Adjust these values as needed in your runtime environment or Docker container.
Available Resources
The server exposes a small set of endpoints intended for programmatic consumption. Exact paths may vary by release; common endpoints include:
- GET /.well-known/mcp or GET /mcp/manifest
- Returns an MCP-style manifest describing the available tools/operations and parameters.
- GET /indicators
- List available indicators (supports filtering and pagination).
- Query params: q (search), page, per_page, format
- GET /indicator/{indicator_id}
- Fetch time series for a particular indicator.
- Query params: countries, country_codes, start_year, end_year, format (json|csv)
- GET /country/{country_code}/indicators
- Fetch multiple indicators for a single country (with same query params as above).
Response formats:
- application/json — default hierarchical JSON
- text/csv — CSV table with year, value, country, indicator
- application/vnd.table+json — simple row-array format for table renderers
Example manifest excerpt (conceptual):
Use Cases
- Quick fetch of a single indicator (GDP) for the United States between 2010–2020:
A typical JSON response will include: indicator id & name, country metadata, and an array of {year, value} objects suitable for charting or prompt injection.
- Export CSV for a list of countries (population indicator):