PluginBench
MCP Server
Maintained
MIT

FXMacroData MCP Server

io.github.fxmacrodata/fxmacrodata

Access macroeconomic indicators, FX rates, COT positioning, and commodity prices for AI-driven financial analysis.

What is the FXMacroData MCP server?

The FXMacroData MCP server provides AI agents with access to macroeconomic indicators, forex spot rates, economic release calendars, CFTC Commitment of Traders positioning, and commodity prices across 18 currencies. It supports both synchronous and asynchronous clients and integrates with OpenBB for extended financial data workflows.

FXMacroData exposes 97 distinct macroeconomic indicators across 656 endpoints, covering policy rates, inflation, GDP, unemployment, bond yields, and more. Use it to fetch historical and real-time FX prices with optional technical indicators (SMA, RSI, MACD, Bollinger Bands), discover upcoming economic releases, analyze trader positioning, and track commodity prices—essential for quantitative research, backtesting, and financial AI applications.

How to install FXMacroData

Copy-paste configuration for popular MCP clients.

transport: http
Config generated by PluginBench — verify against the source before use.
~/.cursor/mcp.json
{
  "mcpServers": {
    "fxmacrodata": {
      "url": "https://fxmacrodata.com/mcp"
    }
  }
}

Tools & capabilities

Tools this server exposes to the agent.

  • get_indicator — Fetch macroeconomic indicator time series data (policy rates, inflation, GDP, unemployment, bond yields, etc.) for 18 currencies.
  • get_fx_price — Retrieve daily FX spot rates between currency pairs with optional technical indicators (SMA, RSI, MACD, Bollinger Bands).
  • get_calendar — Fetch upcoming economic data release dates and announcements for a given currency.
  • get_data_catalogue — Discover available macroeconomic indicators and their metadata (name, unit, frequency, forecast availability) for a currency.
  • get_cot — Retrieve CFTC Commitment of Traders positioning data for major currency pairs.
  • get_commodities — Fetch commodity price time series for gold, silver, and platinum.

Use cases

  • Build quantitative trading models using macroeconomic indicators and FX price history with technical analysis.
  • Monitor upcoming economic releases and central bank decisions to anticipate market moves.
  • Analyze trader positioning (COT data) to identify potential trend reversals and sentiment extremes.
  • Backtest trading strategies using historical FX rates, commodity prices, and macro indicators across multiple currencies.
  • Generate financial research reports and dashboards with real-time macro data and technical indicators.

FXMacroData MCP server FAQ

What is the FXMacroData MCP server?

It's an MCP server that exposes macroeconomic indicators, FX prices, economic calendars, COT positioning, and commodity prices via tools your AI agent can call to fetch financial time-series data.

Is FXMacroData free to use?

Public USD macroeconomic data covering the most recent 90 days is free; non-USD indicators, full history, FX spot rates, COT, and commodities require a paid FXMacroData subscription and API key.

How do I install this in Cursor or Claude?

Add the remote MCP server URL (https://fxmacrodata.com/mcp) to your MCP configuration, or install the Python SDK locally and run the MCP server with your API key.

What authentication is required?

An API key from an authorized FXMacroData subscription is required for protected datasets (non-USD indicators, FX history, COT, commodities). Public USD data requires no key.

What currencies and indicators are supported?

18 currencies (USD, EUR, GBP, JPY, AUD, CAD, CHF, and others) with 97 distinct indicators including GDP, inflation, unemployment, policy rates, bond yields, and trade balances.

Can I use technical indicators on FX prices?

Yes, the get_fx_price tool supports optional technical indicators: SMA (20, 50, 200), RSI (14), MACD, EMA (12, 26), Bollinger Bands, or 'all' for all indicators.

README (reference)

Source of truth, from the repository.

FXMacroData Python SDK 🐍📊

PyPI Version Python Versions License Build

The FXMacroData Python SDK provides a simple and efficient interface for fetching macroeconomic indicators, forex prices, release calendars, COT positioning, and commodity prices from FXMacroData.

Use synchronous and asynchronous clients to bring the data into research notebooks, backtests and applications.

Subscribe to FXMacroData for non-USD data, full available history, FX, commodities and positioning. Use the public USD workflow to evaluate the integration before connecting your subscription.


🌟 Features

  • Fetch:
    • Macroeconomic indicators — policy rates, inflation, GDP, unemployment, bond yields, and more: 97 distinct indicators across 656 endpoints
    • FX spot rates with optional technical indicators (SMA, RSI, MACD, Bollinger Bands)
    • Release calendars — upcoming economic data release dates
    • Data catalogue — discover available indicators per currency
    • COT data — CFTC Commitment of Traders positioning
    • Commodity prices — gold, silver, platinum
  • Evaluate with public USD macro data covering the most recent 90 days; connect your FXMacroData subscription for full available history.
  • FX spot-rate history through get_fx_price.
  • A key from an authorized FXMacroData subscription is required for protected datasets, including non-USD indicators, FX spot-rate history, COT, and commodities.
  • Full support for:
    • Synchronous client
    • Asynchronous client
  • Lightweight: depends only on requests and aiohttp.

📦 Installation

Install from PyPI:

pip install fxmacrodata

Or install the latest version from GitHub:

pip install git+https://github.com/fxmacrodata/fxmacrodata.git

🔧 Usage

Synchronous

from fxmacrodata import Client

client = Client(api_key="YOUR_API_KEY")

# Fetch macroeconomic indicators
data = client.get_indicator(
    "aud", "policy_rate",
    start_date="2023-01-01",
    end_date="2023-11-01"
)
print(data)

# Forex price endpoint
fx = client.get_fx_price("usd", "gbp", start_date="2025-01-01")
print(fx)

# Forex with technical indicators
fx = client.get_fx_price("eur", "usd", indicators="sma_20,rsi_14,macd")
print(fx)

# Release calendar
calendar = client.get_calendar("usd")
print(calendar)

# Data catalogue — discover available indicators
catalogue = client.get_data_catalogue("usd")
print(catalogue)

# COT positioning data
cot = client.get_cot("eur", start_date="2025-01-01")
print(cot)

# Commodity prices
gold = client.get_commodities("gold", start_date="2026-01-01")
print(gold)

Asynchronous

import asyncio
from fxmacrodata import AsyncClient

async def main():
    async with AsyncClient(api_key="YOUR_API_KEY") as client:
        # Fetch macroeconomic indicators
        data = await client.get_indicator("eur", "inflation")
        print(data)

        # Forex price endpoint
        fx = await client.get_fx_price("usd", "jpy")
        print(fx)

        # Release calendar
        calendar = await client.get_calendar("usd")
        print(calendar)

        # Data catalogue
        catalogue = await client.get_data_catalogue("usd")
        print(catalogue)

        # COT positioning
        cot = await client.get_cot("jpy")
        print(cot)

        # Commodity prices
        gold = await client.get_commodities("gold")
        print(gold)

asyncio.run(main())

OpenBB Integration

FXMacroData supports all practical OpenBB integration paths from this package:

  • OpenBB Python: installable provider/router extension for obb.fxmacrodata.*.
  • OpenBB REST API: /api/v1/fxmacrodata/* routes through openbb-api.
  • OpenBB Workspace, generated: widgets generated by openbb-api from inline metadata.
  • OpenBB Workspace, custom: standalone backend serving widgets.json, apps.json, and data endpoints.
  • OpenBB MCP: tools exposed through openbb-mcp.
  • OpenBB CLI: commands available after openbb-build.

OpenBB packages require Python 3.10+. Install the OpenBB Python extra:

pip install "fxmacrodata[openbb]"
openbb-build

Then use FXMacroData from the OpenBB Python interface:

from openbb import obb

obb.user.credentials.fxmacrodata_api_key = "YOUR_API_KEY"

catalogue = obb.fxmacrodata.data_catalogue(
    currency="USD",
    provider="fxmacrodata",
).to_df()

inflation = obb.fxmacrodata.macro_indicators(
    currency="USD",
    indicator="inflation",
    start_date="2020-01-01",
    provider="fxmacrodata",
).to_df()

eurusd = obb.fxmacrodata.fx_historical(
    base="EUR",
    quote="USD",
    start_date="2024-01-01",
    provider="fxmacrodata",
).to_df()

Run the OpenBB REST API and generated Workspace backend:

pip install "fxmacrodata[openbb-api]"
openbb-build
fxmacrodata-openbb-api --host 127.0.0.1 --port 6900

Workspace can be connected to http://127.0.0.1:6900. The generated /widgets.json uses FXMacroData's inline OpenBB widget metadata.

Run the OpenBB Workspace custom backend:

pip install "fxmacrodata[workspace]"
fxmacrodata-openbb-backend

Default backend URL:

http://127.0.0.1:7779

Workspace exposes /widgets.json, /apps.json, /catalogue, /release_calendar, /macro_indicator, /forex, /cot, and /commodity. Swagger/OpenAPI docs are disabled by default for this backend. For local debugging only, set FXMACRODATA_OPENBB_ENABLE_DOCS=1 before starting it.

Run OpenBB MCP:

pip install "fxmacrodata[mcp]"
openbb-build
fxmacrodata-openbb-mcp --default-categories fxmacrodata --host 127.0.0.1 --port 8001

Run OpenBB CLI:

pip install "fxmacrodata[openbb-cli]"
openbb-build
openbb

See docs/openbb-integration.md for the full integration matrix and the separate upstream OpenBB repository contribution path.


📘 API Overview

get_indicator(currency, indicator, start_date=None, end_date=None)

Fetches macroeconomic indicator time series data.

  • currency: "usd", "aud", "eur", "gbp", "cad", "nok", "nzd", "jpy", "brl", "cny", "dkk", "pln", "sek", "sgd", etc.
  • indicator: "policy_rate", "inflation", "gdp", "unemployment", "trade_balance", "current_account_balance", "gov_bond_10y", etc.
  • API key required for non-USD.

get_fx_price(base, quote, start_date=None, end_date=None, indicators=None)

Fetches daily FX spot rates between two currencies.

  • indicators: Optional comma-separated technical indicators — "sma_20", "sma_50", "sma_200", "rsi_14", "macd", "ema_12", "ema_26", "bollinger_bands", or "all".
  • API key required.

get_calendar(currency, indicator=None)

Fetches upcoming economic data release dates for a currency.

  • indicator: Optional filter to a specific indicator slug.
  • Returns announcement_datetime (Unix timestamp) and release (indicator slug).

get_data_catalogue(currency, include_capabilities=False, include_coverage=False, indicator=None)

Discovers available macroeconomic indicators for a given currency.

  • Returns a dict keyed by indicator slug with name, unit, frequency, and has_official_forecast.
  • API key required for non-USD.

get_cot(currency, start_date=None, end_date=None)

Fetches CFTC Commitment of Traders (COT) positioning data.

  • Supported currencies: AUD, CAD, CHF, EUR, GBP, JPY, NZD, USD.
  • API key required for non-USD.

get_commodities(indicator, start_date=None, end_date=None)

Fetches commodity price time series.

  • indicator: "gold", "silver", or "platinum".
  • API key required.

💹 Supported Currencies & Indicators

18 currencies supported: AUD, BRL, CAD, CHF, CNH, CNY, DKK, EUR, GBP, ILS, JPY, NGN, NOK, NZD, PEN, SEK, THB, USD.

The table below shows a sample of indicator coverage across four major currencies. Use get_data_catalogue() to discover the full list for any currency.

CategoryMetricUSDEURAUDGBP
EconomyGDP Growth✓✓✓✓
Inflation Rate✓✓✓✓
Trade Balance✓✓✓✓
Current Account Balance✓✓✓✓
Retail Sales✓✓✓✓
Industrial Production✓———
Labor MarketUnemployment Rate✓✓✓✓
Employment Level✓✓✓✓
Full-Time Employment✓✓✓—
Part-Time Employment✓✓✓✓
Participation Rate✓✓✓✓
Non-Farm Payrolls✓———
Monetary PolicyPolicy Rate✓✓✓✓
Risk-Free Rate✓✓✓✓
Central Bank Assets✓—✓—
Government Bond Yields2-Year Govt Bond✓✓✓✓
5-Year Govt Bond✓✓✓✓
10-Year Govt Bond✓✓✓✓
Inflation-Linked Bond✓✓✓✓

📄 License

MIT License © FXMacroData


🌐 Links

Related MCP servers

MCP server for Qubic — balances, prices, transfers, wallets, and more.

3
TypeScript
MIT
View repository →

MCP server for EAD Enterprise Suite - signatures, evidence, notifications, dossiers via AI agents.

0
TypeScript
MIT
View repository →

MCP server for EAD Factory: qualified evidence, signature, notifications and chat via AI agents.

0
TypeScript
MIT
View repository →

MCP server for GoCertius: certified evidence, dossiers, notifications and chats via AI agents.

0
TypeScript
MIT
View repository →
HEHevy Coach logo

Training analytics over your Hevy log: e1RM, PRs, volume, consistency, bodyweight.

1
TypeScript
MIT
View repository →

一个 API Key 调用法律/企业等官方权威数据,每条出处可回溯。