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

Implementation

How-To Guides

How to Connect FXMacroData to Windsurf AI (MCP)

Connect FXMacroData to Windsurf AI via MCP and query live macro announcements, release calendars, and COT data from inside Cascade — in natural language.

By the end of this guide your Windsurf IDE 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 your editor without leaving the AI coding flow.

What you will achieve

  • Ask macro questions in Cascade chat — “What is the latest EUR CPI print?”, “When is the next Fed decision?”, “Show me COT positioning for JPY”
  • Pull live indicator data into notebooks and scripts — Windsurf fetches the series, you stay in the coding flow
  • Two connection paths — a zero-install hosted MCP endpoint and a local Python package via uvx

Prerequisites

  • Windsurf IDE — download the latest version from windsurf.com (version 1.0+ recommended for full MCP support)
  • A FXMacroData API key for non-USD data — sign up at fxmacrodata.com/subscribe (USD data is free, no key needed 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 Windsurf matters

Building an FX strategy or macro model in Windsurf usually means switching to a browser, pulling data from a calendar site, copying numbers into a notebook, and then switching back. With FXMacroData wired into Windsurf as an MCP server, all of that disappears. You ask a question in the Cascade panel, the tool call happens in the background, and the result lands in your conversation — ready to be inserted into your code or interpreted further.

Windsurf’s Cascade agent is one of the most capable AI coding assistants available, and pairing it with live macro data means one prompt can fetch the policy-rate history for two currencies, pull the corresponding spot-rate series, and scaffold a correlation analysis — without you writing a single HTTP call.


Path A — Connect via MCP Recommended

Model Context Protocol (MCP) is the native way to add external tools to Windsurf’s Cascade agent. One JSON config block and Cascade auto-discovers every tool the FXMacroData server exposes — no schema definitions, no HTTP boilerplate.

Step 1 — Open the MCP configuration file

Windsurf stores MCP server definitions in a JSON file at:

~/.codeium/windsurf/mcp_config.json

You can open this file directly in Windsurf via the command palette (Ctrl+Shift+P / Cmd+Shift+P) and searching for Windsurf: Open MCP Config, or by navigating to Windsurf Settings → MCP and clicking Edit config. If the file does not exist yet, create it.

Step 2 — Add the FXMacroData server entry

Add an entry for FXMacroData inside the mcpServers object. Choose the option that best fits your setup:

Option A — Hosted endpoint (zero install, simplest)

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

This points Cascade at the production FXMacroData MCP server using the Streamable HTTP transport. USD data and the ping tool work immediately with no API key. For non-USD currencies, append your API key to the URL:

{
  "mcpServers": {
    "fxmacrodata": {
      "serverUrl": "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 if your network restricts outbound HTTP streaming. The uvx runner downloads and executes the mcp-server-fxmacrodata PyPI package automatically.

{
  "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 ~/.codeium/windsurf/mcp_config.json to your global 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 — Reload Windsurf MCP servers

After saving the config file, reload MCP servers so Windsurf picks up the new entry. Open the command palette (Ctrl+Shift+P / Cmd+Shift+P) and run:

Windsurf: Refresh MCP Servers

Alternatively, navigate to Windsurf Settings → MCP and click the refresh icon next to your server list. You should see fxmacrodata appear in the active server list with a green connected indicator.

Step 4 — Verify the connection in Cascade

Open the Cascade panel and make sure you are in Agent mode (not Edit or Chat). Type:

Run the FXMacroData ping tool.

Cascade calls the ping tool in the background. 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, Cascade registers all tools the server exposes. Here is the full set:

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.”

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

Step 6 — Try a real analyst workflow

You are building a carry-trade signal in a Python notebook and want to compare the USD–AUD policy-rate differential with AUD/USD spot movement over the last year. In Cascade Agent mode, prompt Windsurf:

“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.”

Cascade calls indicator_query twice (once per currency) and forex once, then writes the plotting code directly in your open file. The equivalent REST calls that back these 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 and forex series in hand, Cascade can scaffold the full comparison chart without you writing a single HTTP call. 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 Cascade

  • 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 inside a Jupyter notebook open in Windsurf, or when building a custom Cascade context provider — 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}

A full list of available currencies and indicators is at /api-data-docs. Each indicator 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 Windsurf in two steps: added an entry to ~/.codeium/windsurf/mcp_config.json pointing at the FXMacroData MCP server, and confirmed the connection with a ping call in Cascade Agent mode. From here, every macro question you type in Cascade triggers a live data call — no browser tab-switching, no manual data imports.

Quick-start recap
1. Open ~/.codeium/windsurf/mcp_config.json via Windsurf: Open MCP Config.
2. Add the fxmacrodata entry with the hosted URL or local uvx command.
3. Reload via Windsurf: Refresh MCP Servers.
4. Switch to Agent mode in the Cascade panel.
5. Type “Run the FXMacroData ping tool” to verify the connection.
6. Start asking macro questions — or have Cascade 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.