Data360 MCP

World Bank development data through Data360 MCP

Poverty, growth, gender, climate, health, and thousands of other indicators come from the Data360 Platform—the Bank's catalog for development data.

The server uses the Model Context Protocol (MCP). Point Cursor, VS Code, or a custom app at this server so an AI agent can search indicators, pull time series, read definitions, and request chart specs on your behalf.

Overview

The Data360 MCP Server exposes the World Bank's Data360 Platform to any MCP-capable client. LLMs and agents need a structured way to search indicators, check metadata and disaggregation, fetch time-series data, and produce charts—without embedding Data360-specific logic inside each client. This server fills that role: it implements the Model Context Protocol so clients can discover and call a fixed set of tools, read contextual resources (system prompts, codelists, schemas), and optionally render tool results in interactive app UIs.

Every value returned by the server comes from the Data360 platform. The server is stateless with respect to user sessions—it acts as a bridge between MCP clients and the Data360 HTTP API.

Who this is for

Click an audience to see typical setup, tools, and resources.

What your agent can do

An AI agent connected over MCP can query official World Bank series from Data360: search the catalog, pull time series, read indicator metadata, and request charts. Every value comes from the Data360 platform, mitigating the risk of hallucination.

  • Countries

    Search indicators and confirm coverage for the countries named in the prompt.

  • Time series

    Retrieve values by country, year, and breakdowns such as sex, age, or urban/rural.

  • Metadata

    Surface source, definition, methodology, and known limitations for an indicator.

  • Charts

    Build line, bar, or other charts and return a URL the MCP client can display.

Example questions

Sample prompts for a connected agent in Cursor, VS Code, or another MCP client. The agent resolves countries, selects indicators, and checks coverage before answering.

Click a question to see the likely MCP tool sequence an agent would run.

Charts and visualizations

For charts, the agent calls data360_get_viz_spec (single indicator) or data360_get_multi_indicator_viz_spec (2–4 indicators). The server loads series from Data360 and returns Vega-Lite JSON plus a chart URL. For tables or numbers in text, use data360_get_data or the aggregation tools listed under Technical reference—they are separate calls.

Chart flow: Search for the indicator, call data360_get_disaggregation for valid years and breakdowns, then request the chart spec.

  • Line and area — trends over years or periods
  • Bar — discrete periods or categories when appropriate
  • Scatter / point — relationships when the data supports it

Charts use Vega-Lite. Your MCP client opens the URL the server returns.

Data sources and databases

The server's only persistent data source is the World Bank Data360 HTTP API. All indicator search, metadata, disaggregation, and time-series data are fetched from Data360 endpoints. There is no local database—the server is stateless aside from in-memory caches (e.g. codelists). All Data360 databases are supported. Use data360_list_indicators to discover indicators in any database, or load data360://databases for a reference list.

Agent-safe design

The server is designed to reduce common LLM data errors through composable tools, coverage validation, and curated resources.

  • Coverage checks

    Use required_country in search and data360_get_disaggregation before fetching data so the agent only requests series that exist.

  • Composable tools

    Small, focused tools validate codes, filters, and dimensions before returning data—search first, then refine.

  • Bundled resources

    System prompt, codelists, and usage notes under data360:// keep client logic in sync with server conventions.

  • Payload trimming

    Use select_fields on metadata calls to limit response size; data payloads are pre-filtered to essential columns for LLM consumption.

  • Aggregation helpers

    data360_summarize_data, data360_rank_countries, and data360_compare_countries return compact summaries instead of raw series when the question is about trends, rankings, or cross-country comparison.

Technical reference

MCP tools, bundled resources, and connection details for developers wiring Cursor, Claude Desktop, LangGraph, or a custom client.

Server capabilities

Search, metadata, series retrieval, code lists, and bundled prompt resources exposed to MCP clients.

  • Indicator search

    Full-text search with metadata; optional country filter to limit results to series that actually exist.

  • Metadata

    Methodology, definitions, limitations, and statistical concepts for each indicator.

  • Time series

    Historical values with filters for country, period, sex, age, urbanization, and other dimensions.

  • Bundled resources

    System prompt, codelists, and usage notes exposed as MCP resources under data360://.

  • Composable tools

    Small, focused tools that validate coverage, codes, and filters before returning data.

MCP tools

Typical order: search (or search datasets), optional disaggregation, then get_data, aggregation tools, or viz specs. Do not guess database_id or indicator_id—obtain them from search results first.

Discovery and data

Tool Description
data360_search_indicators Search indicators with enriched metadata. Use required_country for coverage checks. Supports single query, multi-topic queries, or scoped query_groups. Returns covers_country, latest_data, dimensions.
data360_search_datasets Search Data360 dataset catalogs (e.g. WDI, Findex) when the user asks about sources or databases by name.
data360_get_metadata Indicator metadata and optional disaggregation preview; use select_fields to limit payload.
data360_get_disaggregation Available filter values (countries, years, dimensions) per indicator. Call before get_data or chart tools.
data360_get_data Fetch observations with country, year, and dimension filters (SEX, AGE, URBANISATION, etc.). Paginated.
data360_find_codelist_value Resolve names to codes (e.g. "Kenya" → KEN, "female" → F).
data360_expand_country_group Expand a REF_AREA group (region, income, lending) into constituent country codes (e.g. SAS, LIC).
data360_list_indicators List all indicator IDs for a database.
data360_get_data_api_url Low-level: build a direct Data360 data API URL.

Analysis and visualization

Tool Description
data360_summarize_data Summary statistics grouped by dimensions—use for trend or change-over-time questions without pulling full series.
data360_rank_countries Rank countries by indicator value for a year (top/bottom performers, leaderboards).
data360_compare_countries Compare 2–8 countries on one indicator (snapshot or aligned time series).
data360_get_viz_spec Vega-Lite spec and chart URL for one indicator. Call get_disaggregation first. Fetches its own data; does not consume get_data output.
data360_get_multi_indicator_viz_spec Chart comparing 2–4 indicators (scatter, dual-axis line, etc.).
data360_get_supported_chart_types List supported chart types and data requirements.

Recommended agent workflow

Tables / numbers in text:
1. data360_search_indicators(query, required_country="Kenya")
2. data360_get_disaggregation(database_id, indicator_id)  — years and dimensions
3. data360_get_data(database_id, indicator_id, country_code="KEN", ...)

Rankings / comparisons (prefer over raw get_data when possible):
1. data360_search_indicators(...)
2. data360_get_disaggregation(...)
3. data360_rank_countries(...) or data360_compare_countries(...)

Charts (single indicator):
1. data360_search_indicators(...)
2. data360_get_disaggregation(...)
3. data360_get_viz_spec(database_id, indicator_id, country_code, ...)

Charts (multiple indicators):
1. data360_search_indicators(...) for each topic
2. data360_get_multi_indicator_viz_spec(indicator_ids=[...], ...)

MCP resources

Read-only URIs for prompts and reference data. Most integrations load data360://system-prompt and data360://context in the system message; larger references can be fetched on demand.

Resource Description
data360://system-prompt Required. Workflow and tool-use guidance for the system message.
data360://context Recommended. Runtime context (current date and year) for time-aware queries.
data360://agent-recipe Host integration recipe for LangGraph / data360-mcp-agent (resource + prompt composition).
data360://k360-narrative-style Optional markdown response contract for staged narrative renderers.
data360://databases Available databases (live mapping from Data360)
data360://codelists Codelist reference (REF_AREA, SEX, AGE, UNIT_MEASURE, …)
data360://metadata-fields Field mapping for smart question routing
data360://data-filters Available filters and usage guidance
data360://data-schema Standard columns and visualization guidance
data360://search-usage Search examples and best practices

MCP prompts

Parameterized playbooks registered with prompts/list and prompts/get. Hosts fetch a prompt by name and prepend the returned text to the conversation for a specific user turn.

Prompt When to use
indicator_search Pick one indicator among search hits
indicator_details Methodology, definition, or limitation questions
country_data One country + theme → data and optional chart
gate_classifier Decide in/out of scope before the tool loop
thematic_to_data Rewrite a broad development question into a data task
k360_research_compiler Build a JSON content packet from a tool trace
k360_narrative Convert a content packet into narrative markdown

See data360://agent-recipe for recommended composition order with LangGraph and data360-mcp-agent.

How the server works

MCP clients connect to the Data360 MCP server over streamable HTTP. The server does not store user sessions; each request is independent. It calls the Data360 API for search, metadata, disaggregation, and data, and optionally an external Charts API for persisting Vega-Lite specs.

  MCP clients (Cursor, LangGraph, custom apps)
              │
              ▼ streamable HTTP /mcp
  ┌───────────────────────────────┐
  │     Data360 MCP Server        │
  │  FastMCP · Tools · Resources  │
  │  · Prompts · MCP Apps         │
  └───────────┬───────────────────┘
              │
     ┌────────┴────────┐
     ▼                 ▼
 Data360 HTTP API   Charts API (optional)
 search · metadata  Vega-Lite spec storage
 disagg · data
Layer Technology Purpose
MCP FastMCP, MCP SDK Tools, resources, prompts, apps
Transport Streamable HTTP (stateless) Production and local development
API client httpx (async) Data360 search, metadata, data, codelists
Visualization Draco, Altair, Vega-Lite Chart generation from time-series data

For the full architecture document, see architecture-data360-mcp.md.

MCP Apps

MCP Apps allow hosts to render tool results in interactive iframes instead of plain JSON. Tools attach a resourceUri in their metadata so the host can open the corresponding app and pass the tool result.

App URI Tool
Chart view ui://data360/chart-view.html data360_get_viz_spec
Search results ui://data360/search-results.html data360_search_indicators
QR view ui://data360/qr-view.html (example)

See MCP Apps implementation notes for alignment with the official MCP ext-apps extension.

Client libraries and examples

The repository includes packages and examples for common integration patterns.

  • data360-mcp-agent — Python client for LangGraph agents; load data360://agent-recipe for multi-agent nodes. Package README
  • LangChain minimal example — one-shot agent with data360://system-prompt. Example
  • LangGraph multi-agent example — gated tool node with relevance check. Example
  • @data360/mcp-ui — React components for MCP tool output (Vega charts, search results). Package README
  • @data360/mcp-ui-angular — Angular counterpart for host-embeddable chart UI. Package README
  • @data360/mcp-viz-core — Shared Vega-Lite prep and World Bank chart theme. Package README
  • @data360/tool-types — Zod schemas and parsers for MCP tool JSON contracts. Package README

Connect your agent

Required for external MCP clients (Cursor, Claude Desktop, LangGraph, and similar). Follow the steps below to wire your client to the public endpoint or a self-hosted instance.

1. Choose an endpoint

Use streamable HTTP at the /mcp path (default). For SSE, set MCP_TRANSPORT=sse on the server and point clients at /sse (example: http://localhost:8021/sse). Other org-specific hosts and paths are documented in the GitHub repository.

Environment HTTP URL
Public (external) https://maimcpext.worldbank.org/ext/data360/mcp

Recommended for Cursor, Claude Desktop, and custom agents.

Local dev http://localhost:8000/mcp

Port matches your server (see README).

2. Configure your MCP client

Add the server to your client config. Streamable HTTP (type: "http") is the recommended transport for Cursor and compatible hosts.

{
  "mcpServers": {
    "data360-mcp": {
      "url": "https://maimcpext.worldbank.org/ext/data360/mcp",
      "type": "http"
    }
  }
}

3. Load MCP resources in your agent

  1. Load data360://system-prompt in your agent system context (required for reliable tool use).
  2. Load data360://context for current date/year (recommended).
  3. Optionally load data360://search-usage, data360://codelists, or data360://agent-recipe for LangGraph hosts.
  4. Tables: search → get_disaggregation → get_data (or aggregation tools). Charts: search → get_disaggregation → get_viz_spec / get_multi_indicator_viz_spec.

4. Authentication (hosted / APIM)

World Bank–hosted endpoints may require a Bearer token or Azure AD client credentials. On the server, set MCP_INTERNAL=true and MCP_AUTH_SCOPE for APIM; clients may pass an Authorization header in mcp.json when required. See DEVELOPMENT.md for environment-specific setup.

6. Docker and containers

From a container, use host.docker.internal instead of localhost to reach an MCP server on the host machine.

7. LangGraph / Python agents

Set environment variables before running your agent (see data360-mcp-agent package in the repo):

DATA360_MCP_URL=https://maimcpext.worldbank.org/ext/data360/mcp
DATA360_MCP_TRANSPORT=streamable_http
OPENAI_API_KEY=your-key

8. Self-host locally

Install and run the server on your machine: see the GitHub README.

Databases (examples)

All Data360 databases are supported; list indicators with data360_list_indicators.

  • WB_WDI — World Development Indicators
  • WB_SSGD — Social Sustainability and Global Database
  • WB_POVERTY — Poverty and inequality indicators
  • IPC_IPC — International Poverty Comparison

Health and operations

The FastAPI wrapper exposes HTTP probes for deployment and load balancers. See DEVELOPMENT.md for environment variables and configuration.

Route Purpose Status
GET /mcp/health Liveness — process is running (no outbound I/O) Always 200
GET /mcp/ready Readiness — Data360 API, database mapping, and viz storage are usable 200 or 503

Toggle readiness checks with MCP_READINESS_ENABLED (default true). Per-check timeout: MCP_HEALTH_CHECK_TIMEOUT (default 5 seconds).