How to Connect FXMacroData to Cursor AI (MCP) banner image

Implementation

How-To Guides

How to Connect FXMacroData to Cursor AI (MCP)

Connect FXMacroData to Cursor AI via MCP and query live macro announcements, release calendars, COT data, and FX spot rates from inside your editor — in natural language.

By the end of this guide Cursor will have live access to macroeconomic indicator series, release calendars, CFTC COT positioning, precious-metals prices, and FX spot rates across 18 currencies — all queryable in plain English from inside the editor without leaving your development workflow.

What you will achieve

  • Ask macro questions in Cursor Agent — “What is the current EUR CPI?”, “When is the next Fed decision?”, “Show me COT positioning for JPY”
  • Pull live macro data directly into your code — Cursor fetches the series and writes it into your open file, without you leaving the editor
  • Two connection paths — a zero-install hosted MCP endpoint and a local Python package via uvx

Prerequisites

  • Cursor — download from cursor.com (version 0.43+ recommended for full MCP support)
  • A FXMacroData API key for non-USD data — sign up at fxmacrodata.com/subscribe (USD data is free and works without a key for testing)
  • Network access from your machine to fxmacrodata.com
  • Optional (local path only): uv installed — run pip install uv or see docs.astral.sh/uv

Why macro data inside Cursor matters

Cursor is already the AI coding assistant of choice for developers who want an AI that deeply understands their codebase. Add FXMacroData as an MCP server and you extend that capability to live macroeconomic data — so when you are building an FX strategy, backtesting a carry-trade signal, or prototyping a macro dashboard, the data is a single prompt away inside the same editor window.

Without this integration, pulling indicator data means switching to a browser, copying numbers into your notebook, and switching back. With FXMacroData wired in, you ask the question in the Cursor Agent panel and the result lands ready for use in your code.


Path A — Connect via MCP Recommended

Model Context Protocol (MCP) is Cursor’s native mechanism for connecting external tools. One JSON config block and Cursor auto-discovers every tool the FXMacroData server exposes — no custom plugin code, no HTTP boilerplate.

Agent mode only: MCP tools in Cursor are available when the model selector is set to Agent. Make sure you are in Agent mode before running any macro queries (the mode selector appears at the top of the Cursor chat panel).

Step 1 — Open MCP settings in Cursor

Cursor reads MCP server definitions from a JSON file. There are two scopes you can use:

  • Global (recommended) — available across all your projects. Open Cursor Settings (Cmd+Shift+J on macOS or Ctrl+Shift+J on Windows/Linux), navigate to MCP, and click Add new global MCP server. This opens ~/.cursor/mcp.json.
  • Project-level — scoped to a single workspace. Create a .cursor/mcp.json file at the root of your project directory.

Either way, the JSON structure is the same. Choose the option that suits your workflow.

Step 2 — Add the FXMacroData MCP server config

Open ~/.cursor/mcp.json (global) or .cursor/mcp.json (project) and add the FXMacroData entry. Two options are available depending on whether you prefer a hosted endpoint or a local process.

Option A — Hosted endpoint (zero install, simplest)

Points Cursor directly at the production FXMacroData MCP server over Streamable HTTP. USD data and the ping tool work immediately without an API key.

{
  "mcpServers": {
    "fxmacrodata": {
      "url": "https://fxmacrodata.com/mcp"
    }
  }
}

For full multi-currency access, append your API key to the URL:

{
  "mcpServers": {
    "fxmacrodata": {
      "url": "https://fxmacrodata.com/mcp?api_key=YOUR_API_KEY"
    }
  }
}

Option B — Local MCP server via uvx

Use this if you prefer a local process or your network restricts outbound HTTP streaming. The uvx runner downloads and runs the mcp-server-fxmacrodata PyPI package automatically — no manual pip install needed.

{
  "mcpServers": {
    "fxmacrodata": {
      "command": "uvx",
      "args": ["mcp-server-fxmacrodata"],
      "env": {
        "FXMACRODATA_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}
Security note: Do not commit your API key directly in a file tracked by Git. Either add .cursor/ to your .gitignore, or reference a shell environment variable: replace YOUR_API_KEY with ${FXMACRODATA_API_KEY} and export the variable in your shell profile.

Step 3 — Restart Cursor and verify the server appears

After saving the JSON file, restart Cursor (or reload the window with Cmd+Shift+P / Ctrl+Shift+PDeveloper: Reload Window). Cursor will parse the MCP config and register any servers it finds.

To confirm the server loaded, open Cursor Settings → MCP. You should see fxmacrodata listed with a green status indicator. If the status shows an error, double-check the JSON syntax and ensure uvx is installed (for Option B).

Step 4 — Verify the connection with a ping

Open the Cursor chat panel, switch to Agent mode, and type:

Run the FXMacroData ping tool.

Cursor calls the ping tool. A pong response confirms the server is reachable and your credentials are valid. You are ready to query live data.

Step 5 — Explore the available tools

Once connected, Cursor Agent has access to all tools the FXMacroData server exposes:

Tool What it does Example prompt
indicator_query Fetch historical announcement series for any currency + indicator “What is the latest AUD policy rate?”
data_catalogue List available indicators and currencies “What indicators are available for NZD?”
release_calendar Upcoming macro releases with scheduled dates “What USD data is coming out this week?”
forex FX spot rates with optional technical overlays “What is EUR/USD trading at?”
cot_data CFTC Commitments of Traders positioning “Show me the latest COT report for JPY.”
commodities Precious-metals prices (gold, silver, platinum) “What is the current gold price?”
market_sessions Live FX session windows (Sydney, Tokyo, London, New York) “Which FX sessions are open right now?”
indicator_visual_artifact Generate chart-ready data artifacts for supported clients “Chart USD inflation over the last 2 years.”
ping Verify the connection is live “Run the FXMacroData ping tool.”

Cursor Agent resolves which tool to call from your natural-language prompt. You never need to specify a tool name or write JSON — just ask the question.

Step 6 — Try a real developer workflow

You are building a carry-trade signal in a Python file and want to compare the USD–AUD policy-rate differential against AUD/USD spot movement over the last year. With the FXMacroData server connected, ask Cursor Agent:

“Fetch the USD and AUD policy rates for the last 12 months, then pull the AUD/USD spot rate for the same window and write Python code to plot the rate differential alongside the exchange rate.”

Cursor calls indicator_query twice (once per currency) and forex once, then writes the plotting code directly into your open file. The equivalent REST calls behind those tool invocations are:

# USD policy rate
curl "https://fxmacrodata.com/api/v1/announcements/usd/policy_rate?api_key=YOUR_API_KEY"

# AUD policy rate
curl "https://fxmacrodata.com/api/v1/announcements/aud/policy_rate?api_key=YOUR_API_KEY"

# AUD/USD spot rate
curl "https://fxmacrodata.com/api/v1/forex/AUD/USD?api_key=YOUR_API_KEY"

Representative indicator_query response:

{
  "currency": "AUD",
  "indicator": "policy_rate",
  "data": [
    { "date": "2026-04-01", "val": 4.10, "announcement_datetime": 1743483000 },
    { "date": "2026-02-18", "val": 4.10, "announcement_datetime": 1739862600 },
    { "date": "2025-12-10", "val": 4.35, "announcement_datetime": 1733806200 },
    { "date": "2025-11-05", "val": 4.35, "announcement_datetime": 1730793000 }
  ]
}

With the policy-rate series and spot-rate data in hand, Cursor can scaffold the full comparison chart without you writing a single HTTP call or leaving the editor. The AUD policy rate indicator page and USD policy rate docs show the full indicator schema if you want to extend the analysis.

More things to try in Agent mode

  • Show me EUR inflation over the last 6 months
  • What macro releases are due this week for GBP?
  • What is the COT net position for EUR futures?
  • Which FX sessions overlap right now?

Combining tools in one prompt

  • Fetch EUR CPI and the next ECB calendar date
  • Pull NZD employment + NZD/USD spot and summarise
  • Get gold price and COT for JPY in one message
  • List indicators for CAD and fetch the latest policy rate

Path B — Direct REST API calls Alternative

If you prefer explicit HTTP calls — for example in a Jupyter notebook run through Cursor, or when building a custom context tool — you can query FXMacroData directly via REST. All endpoints accept a query-parameter API key.

Fetching indicator data

import requests

BASE = "https://fxmacrodata.com/api/v1"
KEY  = "YOUR_API_KEY"

# Latest AUD inflation series
resp = requests.get(
    f"{BASE}/announcements/aud/inflation",
    params={"api_key": KEY},
    timeout=10,
)
data = resp.json()
for row in data["data"][:5]:
    print(row["date"], row["val"])

Checking the release calendar

# Upcoming USD releases
resp = requests.get(
    f"{BASE}/calendar/usd",
    params={"api_key": KEY},
    timeout=10,
)
events = resp.json()
for event in events["data"][:3]:
    print(event["indicator"], event["release_date"])

Pulling FX spot rates

# EUR/USD last 30 trading days
resp = requests.get(
    f"{BASE}/forex/EUR/USD",
    params={"api_key": KEY},
    timeout=10,
)
rates = resp.json()["data"]
print(rates[0])  # {"date": "2026-04-15", "rate": 1.1342}

The full indicator catalogue is at /api-data-docs. Each page includes the exact endpoint path, field descriptions, and example responses — for example EUR inflation or USD non-farm payrolls.


Summary

You have wired FXMacroData into Cursor in two steps: added the server config to ~/.cursor/mcp.json (or the project-level equivalent) and confirmed the connection with a ping call in Agent mode. From here, every macro question you type in the Cursor Agent panel triggers a live data call — no browser tabs, no manual data imports, no context-switching.

Quick-start recap
1. Open ~/.cursor/mcp.json (global) or .cursor/mcp.json (project).
2. Add the fxmacrodata entry with the hosted URL or uvx command.
3. Restart Cursor or reload the window.
4. Switch to Agent mode in the chat panel.
5. Type “Run the FXMacroData ping tool” to verify the connection.
6. Start asking macro questions — or let Cursor pull data directly into your code.

Ready to explore what data is available? Browse the FXMacroData API docs for the full indicator catalogue, or check the MCP server reference for authentication options and advanced tool schemas. If you do not yet have an API key, subscribe to unlock all 18 currencies and the complete indicator set.