EU Parliament Monitor โ€” API Documentation - v0.8.39
    Preparing search index...

    Module MCP/IMFMCPClient

    Native TypeScript IMF Data client โ€” calls the IMF SDMX 3.0 REST API at https://dataservices.imf.org/REST/SDMX_3.0/ directly via fetch(), with no external MCP server process.

    Historical note: the first Wave-1 iteration delegated to the Python c-cf/imf-data-mcp MCP server. That dependency blocked Wave 0 rollout because the upstream project is a Python git-URL package (not npm) and could not be pinned to an integrity hash per the ISMS Secure Development Policy ยง7. This module replaces the Python transport with a direct, typed HTTP client โ€” the public API is preserved so callers (src/utils/imf-data.ts, validator fingerprints, workflow probes) are untouched.

    The return envelope of every method is MCPToolResult ({ content: [{ type: "text", text: "<json>" }] }) so downstream code that already calls parseSDMXJSON(response.content[0]?.text) continues to work unmodified.

    • Uses the native Node 25 fetch() โ€” no extra runtime dependency.
    • Every call has an independent AbortController with a configurable timeout (IMF_API_TIMEOUT_MS, default 30 s).
    • Errors (HTTP 4xx/5xx, network faults, JSON parse failures, abort) are caught and converted to the IMF_FALLBACK envelope. Callers upstream can therefore treat "no IMF" as "empty data" without defensive try/catch, matching the WorldBankMCPClient pattern.

    Environment variables:

    • IMF_API_BASE_URL โ€” override base URL (default https://dataservices.imf.org/REST/SDMX_3.0).
    • IMF_API_TIMEOUT_MS โ€” per-request timeout (default 30000).

    Legacy env vars (IMF_MCP_GATEWAY_URL, IMF_MCP_GATEWAY_API_KEY, IMF_MCP_SERVER_PATH) are no longer consulted โ€” no gateway is needed because the IMF SDMX 3.0 API is an unauthenticated public endpoint.

    Functions

    getIMFMCPClient
    closeIMFMCPClient

    Classes

    IMFMCPClient

    Interfaces

    IMFClientOptions

    Variables

    IMF_MCP_TOOLS
    IMFClient