# FRED & Treasury Macro MCP — Rates & Yields for AI Agents (`nexgendata/fred-treasury-macro-data-mcp`) Actor

MCP server exposing FRED economic series, Treasury yields and auction data as agent tools. Connect Claude, Cursor, n8n or the OpenAI Agents SDK. Not investment advice.

- **URL**: https://apify.com/nexgendata/fred-treasury-macro-data-mcp.md
- **Developed by:** [NexGenData](https://apify.com/nexgendata) (community)
- **Categories:** Business, AI, MCP servers
- **Stats:** 1 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $50.00 / 1,000 tool calls

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/platform/actors/running/actors-in-store#pay-per-event

## What's an Apify Actor?

Actors are web data automations that power AI and operations. They run on the Apify platform to scrape websites, process data, connect APIs, and automate workflows.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.
Actors are written with capital "A".

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.
The best way to integrate Actors is as follows.

- **AI agents and MCP clients** — the [Apify MCP server](https://docs.apify.com/integrations/mcp.md) at `https://mcp.apify.com` (remote, streamable HTTP, OAuth on first use).
- **Agentic workflows and local Actor development** — [Agent Skills](https://apify.com/.well-known/agent-skills/index.json) with the [Apify CLI](https://docs.apify.com/cli/docs.md): `npm install -g apify-cli`, then `apify login`.
- **JavaScript/TypeScript projects** — the official [JS/TS client](https://docs.apify.com/api/client/js/docs.md): `npm install apify-client`.
- **Python projects** — the official [Python client](https://docs.apify.com/api/client/python/docs.md): `pip install apify-client`.
- **Any other language** — the [REST API](https://docs.apify.com/api/v2.md).

For usage examples, see the [API](#api) section below.

For more details, see Apify documentation as [Markdown index](https://docs.apify.com/llms.txt) and [Markdown full-text](https://docs.apify.com/llms-full.txt).

# README

## FRED & Treasury Macro MCP

A Model Context Protocol server that gives AI agents macro data — FRED series, Treasury yield curve and auction results — as callable tools. For macro-research and economics agents. Factual public data — not financial or investment advice.

### 🛠 Tools (5)

- `get_auction_results` — US Treasury auction results.
- `get_fred_series` — FRED economic data series by ID.
- `get_macro_dashboard` — Composite macro-indicator dashboard.
- `get_treasury_yield_curve` — US Treasury yield curve.
- `get_upcoming_treasury_auctions` — Upcoming Treasury auction schedule.

### 🔌 Connect (Claude Desktop / Cursor / n8n / OpenAI Agents SDK)

Add this MCP server to your client config:

```json
{
  "mcpServers": {
    "fred-treasury-macro-data": {
      "url": "https://nexgendata--fred-treasury-macro-data-mcp.apify.actor/mcp"
    }
  }
}
```

**Sample agent prompt:**

```
Get the current Treasury yield curve and the latest CPI series from FRED.
```

**Pricing:** $0.05 per tool call (Pay-Per-Event). Runs in Standby mode.

***

## 🏦 FRED + Treasury Auctions Macro Data MCP for AI Agents

**One MCP that answers macro questions end-to-end** — FRED economic series + US Treasury yield curve + Treasury auction calendar in a single tool-call. Stop wiring three separate API integrations into your LLM trading agent — point Claude / Cursor / Windsurf at this MCP server and your agent can answer "what's the 10Y, what's CPI YoY, what's this week's auction calendar, what did the last 30Y bond auction stop out at?" in one prompt.

### Why this MCP server exists

Macro AI agents — LLM-powered trader assistants, fixed-income copilots, hedge-fund research bots — are exploding as a buyer category. But every macro-aware agent needs the same three data feeds: FRED for the macro indicators, the Treasury par yield curve for the rates picture, and the Treasury auction calendar for the supply picture. Today those are three different APIs with three different auth schemes, three different rate limits, and three different data shapes.

This MCP server collapses them into five tools:

| Tool | What it returns |
|---|---|
| `get_fred_series(series_id, start_date, end_date)` | Any FRED series — CPIAUCSL, GDP, UNRATE, FEDFUNDS, DGS10, T10Y2Y, M2SL, PAYEMS, ... — with series metadata + observations |
| `get_treasury_yield_curve(date)` | Full 1mo / 2mo / 3mo / 4mo / 6mo / 1y / 2y / 3y / 5y / 7y / 10y / 20y / 30y par yield curve for a date, plus the 10y-2y spread |
| `get_upcoming_treasury_auctions(security_type, days_ahead)` | Bill / Note / Bond / TIPS / FRN / CMB auction calendar — auction date, issue date, maturity, offering amount, CUSIP |
| `get_auction_results(auction_id_or_recent, security_type, days_back, limit)` | Historical auction results — stop-out high yield, bid-to-cover ratio, total tendered/accepted, primary-dealer/direct/indirect allotments |
| `get_macro_dashboard()` | **One-call snapshot** — latest 10Y yield, full curve, CPI YoY, headline unemployment, effective fed funds rate, last 5 auction results |

### Buyer personas

- **Fixed-income portfolio managers** running an LLM copilot for daily desk briefings
- **Macro hedge fund analysts** who want the same data point + auction surprise scoring in 10 seconds, not 30 minutes
- **AI trading agents** — ChatGPT/Claude agents that need real-time macro context to answer customer questions
- **LLM-powered trader assistants** wired into broker dashboards, where the macro picture is one of N tools
- **Quant data ops** prototyping a Bloomberg-replacement stack on top of public data

### Quick start — wire it into Claude Desktop / Cursor / Windsurf

This is a Standby MCP server. Once published it lives at `https://nexgendata--fred-treasury-macro-data-mcp.apify.actor/mcp` and responds to the standard streamable-HTTP MCP transport. Add this to your client config:

```json
{
  "mcpServers": {
    "fred-treasury-macro": {
      "url": "https://nexgendata--fred-treasury-macro-data-mcp.apify.actor/mcp",
      "transport": "http",
      "headers": {
        "Authorization": "Bearer YOUR_APIFY_TOKEN"
      }
    }
  }
}
```

(Cursor / Windsurf use the same shape; n8n's MCP node accepts a URL + bearer too.)

To use the FRED tools you need a free FRED API key — grab one in 30 seconds at <https://fredaccount.stlouisfed.org/apikeys> and paste it into the actor input `fred_api_key`. The Treasury tools (`get_treasury_yield_curve`, `get_upcoming_treasury_auctions`, `get_auction_results`) work without any key.

### Example agent prompts

Once wired in, your agent can answer questions like:

- *"What's the current Treasury yield curve and the 10y-2y spread?"* → `get_treasury_yield_curve`
- *"Give me CPI year-over-year as of the latest print"* → `get_fred_series(series_id="CPIAUCSL", start_date="2025-01-01")`
- *"What Treasury auctions are coming up in the next 14 days?"* → `get_upcoming_treasury_auctions(days_ahead=14)`
- *"How did the last 10Y note auction stop out — was there a tail?"* → `get_auction_results(security_type="Note", days_back=21)`
- *"What's the macro picture right now?"* → `get_macro_dashboard()` (one call, full snapshot)

### What `get_macro_dashboard()` returns (sample)

```json
{
  "as_of": "2026-05-30",
  "yield_curve": {
    "record_date": "2026-05-30",
    "curve_pct": { "1M": 4.92, "3M": 4.85, "2Y": 4.32, "5Y": 4.18, "10Y": 4.41, "30Y": 4.68 },
    "spread_10y2y_pct": 0.09
  },
  "cpi": { "series_id": "CPIAUCSL", "latest": {"date":"2026-04-01","value":318.4}, "yoy_pct": 2.7 },
  "unemployment": { "series_id": "UNRATE", "latest": {"date":"2026-04-01","value":4.1} },
  "fed_funds_rate": { "series_id": "FEDFUNDS", "latest": {"date":"2026-04-01","value":4.33} },
  "ten_year_yield": { "series_id": "DGS10", "latest": {"date":"2026-05-29","value":4.41} },
  "recent_auctions": [
    {"cusip":"912797PN0","security_type":"Bill","security_term":"4-Week","auction_date":"2026-05-28","high_yield_pct":"4.825","bid_to_cover_ratio":"2.94"}
  ]
}
```

That's one tool-call. The same agent prompt against three separate APIs is six round-trips and a custom join.

### Data sources

- **FRED** — Federal Reserve Economic Data, St. Louis Fed (<https://api.stlouisfed.org/fred/>). 800K+ economic series. Free with API key. License: CC0 / public domain.
- **US Treasury Fiscal Data** — <https://fiscaldata.treasury.gov/>. Daily par yield curves, upcoming auctions, securities auction results. No key required. License: public domain.

### How it works under the hood

- Apify Standby HTTP transport — the actor stays warm and answers MCP requests in milliseconds once spun up
- Five tools, all `async`, all charge `tool-call` on successful invocation
- `get_macro_dashboard()` fans out 6 parallel upstream calls (1 yield curve + 1 auctions + 4 FRED series) using `asyncio.gather`, so the dashboard latency is dominated by the slowest single upstream
- Graceful error envelopes — when FRED rate-limits or Treasury is briefly down, the tool returns a structured error rather than crashing the MCP session
- 240-second no-client watchdog exits cleanly if no MCP client ever connects (so you don't pay for an idle container)

### 🔗 Related Actors

Pair this with these other NexGenData MCP servers and data feeds:

- [🤖 Finance MCP Server — AI-Native Stock & Market Data](https://apify.com/nexgendata/finance-mcp-server) — Yahoo Finance + Finviz + CoinGecko quotes for LLM trading agents. The equity-side complement to this macro/fixed-income MCP.
- [📊 Regulatory Filings MCP Server](https://apify.com/nexgendata/regulatory-filings-mcp) — SEC EDGAR + regulator filings for the same LLM agent stack. Pair with this macro MCP for top-down + bottom-up coverage.

### About NexGenData

NexGenData publishes 250+ buyer-intent actors covering SEC filings, regulatory enforcement, real-estate, lead generation, competitive intelligence, fundamentals across 30+ exchanges, and a growing fleet of MCP servers purpose-built for AI agents. All actors are pay-per-event. Browse the full catalog at <https://apify.com/nexgendata>.

🏠 Home: [thenextgennexus.com](https://thenextgennexus.com)
📦 Full catalog: [apify.com/nexgendata](https://apify.com/nexgendata)

# Actor input Schema

## `fred_api_key` (type: `string`):

Your free FRED API key from https://fredaccount.stlouisfed.org/apikeys. Required for FRED series lookups (CPI, GDP, unemployment, fed funds, etc.). Treasury tools work without this key.

## `default_lookback_days` (type: `integer`):

Default number of days of history to fetch when a tool call omits an explicit start\_date. Applies to FRED series and Treasury yield-curve lookups.

## Actor input object example

```json
{
  "default_lookback_days": 30
}
```

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "fred_api_key": "",
    "default_lookback_days": 30
};

// Run the Actor and wait for it to finish
const run = await client.actor("nexgendata/fred-treasury-macro-data-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = {
    "fred_api_key": "",
    "default_lookback_days": 30,
}

# Run the Actor and wait for it to finish
run = client.actor("nexgendata/fred-treasury-macro-data-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print("💾 Check your data here: https://console.apify.com/storage/datasets/" + run["defaultDatasetId"])
for item in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "fred_api_key": "",
  "default_lookback_days": 30
}' |
apify call nexgendata/fred-treasury-macro-data-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "command": "npx",
            "args": [
                "mcp-remote",
                "https://mcp.apify.com/?tools=nexgendata/fred-treasury-macro-data-mcp",
                "--header",
                "Authorization: Bearer <YOUR_API_TOKEN>"
            ]
        }
    }
}

```

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/poaMUgWqsrzTDExQW/builds/cguCHBS5jAH5XlD2f/openapi.json
