@fxmacrodata/client
v0.1.0
Published
JavaScript/TypeScript client for the FXMacroData REST API and MCP connection helpers
Maintainers
Readme
npm Package
@fxmacrodata/client is a lightweight TypeScript/JavaScript client for the FXMacroData REST API, plus small helpers for constructing the production MCP URL and auth headers.
What ships
- Typed wrappers for the public REST endpoints:
announcementscalendardataCataloguecotcommodities
- MCP helper utilities for:
- the default production MCP URL
- bearer auth headers for protected MCP access
- TypeScript declarations for package consumers
Install
npm install @fxmacrodata/clientREST client example
import { FXMacroDataClient } from "@fxmacrodata/client";
const client = new FXMacroDataClient({ apiKey: "YOUR_API_KEY" });
const result = await client.announcements("aud", "policy_rate");
console.log(result.data);The production API base URL defaults to https://fxmacrodata.com/api.
MCP helper example
import { createMcpHeaders, createMcpUrl } from "@fxmacrodata/client";
const url = createMcpUrl();
const headers = createMcpHeaders({ apiKey: "YOUR_API_KEY" });Local development
npm install
npm run typecheck
npm testNotes
- The package currently publishes as ESM.
- Node.js 18+ is recommended because the client uses the native
fetchAPI. - Public REST examples in this repo use query-parameter authentication.
