WO

World Bank Indicators API MCP Server

Fetch World Bank indicators with this MCP server for fast API access, filtering, and format-ready results.

Quick Install
npx -y @anshumax/world_bank_mcp_server

Overview

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

  1. Clone the repository:
git clone https://github.com/anshumax/world_bank_mcp_server.git
cd world_bank_mcp_server
  1. Choose a runtime based on files in the repo:
  • If you see package.json, use Node.js:
    # install dependencies
    npm install
    
    # start server
    npm start
    
  • If you see requirements.txt or pyproject.toml, use Python:
    python -m venv venv
    source venv/bin/activate
    pip install -r requirements.txt
    
    # start server (example)
    python app.py
    
  1. Or run with Docker:
# build
docker build -t wb-mcp-server .

# run
docker run -p 8080:8080 \
  -e PORT=8080 \
  -e CACHE_TTL=300 \
  wb-mcp-server
  1. Common environment variables
VariableDefaultPurpose
PORT8080HTTP port to listen on
CACHE_TTL300Cache 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):

{
  "name": "world_bank_indicators",
  "description": "Fetch World Bank indicators by country, indicator, and date range",
  "actions": [
    {
      "name": "get_indicator",
      "description": "Retrieve time series for a specific indicator",
      "parameters": ["indicator_id","country_codes","start_year","end_year","format"]
    }
  ]
}

Use Cases

  1. Quick fetch of a single indicator (GDP) for the United States between 2010–2020:
curl "http://localhost:8080/indicator/NY.GDP.MKTP.CD?country_codes=USA&start_year=2010&end_year=2020&format=json"

A typical JSON response will include: indicator id & name, country metadata, and an array of {year, value} objects suitable for charting or prompt injection.

  1. Export CSV for a list of countries (population indicator):
curl -o population.csv "http://localhost:808