Create a new World Bank MCP client. Always supplies an explicit World Bank server path, gateway URL, and label so the base class never falls back to European Parliament defaults.
Connection options. serverPath / gatewayUrl /
gatewayApiKey / serverLabel are filled from WB_* environment
variables when not provided explicitly.
Check if client is connected
Connection status
Check if using gateway HTTP transport
True if gateway mode is active
Get the configured gateway URL
Gateway URL or null if using stdio transport
Get the configured gateway API key
Gateway API key or null if not set
Get the current MCP session ID
Session ID returned by the gateway, or null if not yet connected
Get connection health metrics for telemetry
Object with timeout count, reconnection count, and current connection status
Connect to the MCP server with retry logic
Disconnect from the MCP server
Handle incoming messages from MCP server (stdio mode only). Delegates to handleIncomingMessage in process.ts.
JSON message line from server
Send a request to the MCP server
RPC method name
Method parameters
Server response
List available MCP tools
List of available tools
Call an MCP tool
Tool name
Tool arguments (must be a plain object, non-null, not an array)
Tool execution result
Attempt to reconnect to the MCP server. Deduplicates concurrent calls — only one reconnect runs at a time.
Resolves when reconnect succeeds or all attempts are exhausted
Call an MCP tool with automatic retry on timeout or connection loss. Reconnects automatically if the connection was lost between attempts.
Only transient failures are retried (see isRetriableError). Non-retriable
errors — rate-limit (429), session-expired (401), and programmer errors such
as TypeError — are re-thrown immediately without consuming any retry budget.
Tool name
Tool arguments (plain object, non-null, not an array)
OptionalmaxRetries: numberOverride the default retry count from options
Tool execution result
Get economic indicator data for a specific country.
Calls the get_indicator_for_country tool on the World Bank MCP server.
World Bank country code (e.g., 'DEU' for Germany, 'FRA' for France)
World Bank indicator ID (e.g., 'NY.GDP.MKTP.CD' for GDP)
MCP tool result with CSV-formatted indicator data, or empty text on error
Aggregate a World Bank indicator across EU-27 member states.
This is a client-side fallback for aggregate codes such as EUU that are
rejected by the upstream worldbank-mcp server.
Important: This method uses simple summation (aggregation: "sum"),
which is only meaningful for additive flow/stock metrics (e.g.,
absolute GDP in USD, total population, total exports). For ratios,
percentages, rates, or per-capita indicators (e.g., GDP growth %,
GDP per capita, school enrollment %, health expenditure as % of GDP),
a plain sum is mathematically incorrect. Callers must verify the
indicator is additive before using the result.
World Bank MCP tool (get-economic-data, get-social-data, get-education-data, get-health-data)
Indicator key accepted by the selected tool (must be an additive metric — not a ratio or percentage)
Number of years to request (default 10)
MCP-like JSON payload with summed year-series across EU-27 (includes aggregation: "sum" field)
MCP Client for World Bank economic data access. Extends MCPConnection with World Bank-specific tool wrapper methods.
Always supplies an explicit World Bank server path so the base class never falls back to the European Parliament MCP server defaults.