# 🏦 FRED + Treasury Auctions Macro Data MCP for AI Agents (`nexgendata/fred-treasury-macro-data-mcp`) Actor

MCP server for AI agents to fetch FRED macro data (CPI, GDP, unemployment, fed funds) + US Treasury yield curve and auction calendar in one tool-call. Premium fixed-income data for LLM trading assistants.

- **URL**: https://apify.com/nexgendata/fred-treasury-macro-data-mcp.md
- **Developed by:** [NexGenData](https://apify.com/nexgendata) (community)
- **Categories:** Business
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, NaN 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 a software tools running on the Apify platform, for all kinds of web data extraction and automation use cases.
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.

In JavaScript/TypeScript projects, use official [JavaScript/TypeScript client](https://docs.apify.com/api/client/js.md):

```bash
npm install apify-client
```

In Python projects, use official [Python client library](https://docs.apify.com/api/client/python.md):

```bash
pip install apify-client
```

In shell scripts, use [Apify CLI](https://docs.apify.com/cli/docs.md):

````bash
# MacOS / Linux
curl -fsSL https://apify.com/install-cli.sh | bash
# Windows
irm https://apify.com/install-cli.ps1 | iex
```bash

In AI frameworks, you might use the [Apify MCP server](https://docs.apify.com/platform/integrations/mcp.md).

If your project is in a different language, use 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 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?fpr=2ayu9b>.

🏠 Home: [thenextgennexus.com](https://thenextgennexus.com)
📦 Full catalog: [apify.com/nexgendata](https://apify.com/nexgendata?fpr=2ayu9b)

# 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

```json
{
    "openapi": "3.0.1",
    "info": {
        "title": "🏦 FRED + Treasury Auctions Macro Data MCP for AI Agents",
        "description": "MCP server for AI agents to fetch FRED macro data (CPI, GDP, unemployment, fed funds) + US Treasury yield curve and auction calendar in one tool-call. Premium fixed-income data for LLM trading assistants.",
        "version": "0.0",
        "x-build-id": "GQiB6iw6MYgHgkvGx"
    },
    "servers": [
        {
            "url": "https://api.apify.com/v2"
        }
    ],
    "paths": {
        "/acts/nexgendata~fred-treasury-macro-data-mcp/run-sync-get-dataset-items": {
            "post": {
                "operationId": "run-sync-get-dataset-items-nexgendata-fred-treasury-macro-data-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        },
        "/acts/nexgendata~fred-treasury-macro-data-mcp/runs": {
            "post": {
                "operationId": "runs-sync-nexgendata-fred-treasury-macro-data-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor and returns information about the initiated run in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "content": {
                            "application/json": {
                                "schema": {
                                    "$ref": "#/components/schemas/runsResponseSchema"
                                }
                            }
                        }
                    }
                }
            }
        },
        "/acts/nexgendata~fred-treasury-macro-data-mcp/run-sync": {
            "post": {
                "operationId": "run-sync-nexgendata-fred-treasury-macro-data-mcp",
                "x-openai-isConsequential": false,
                "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
                "tags": [
                    "Run Actor"
                ],
                "requestBody": {
                    "required": true,
                    "content": {
                        "application/json": {
                            "schema": {
                                "$ref": "#/components/schemas/inputSchema"
                            }
                        }
                    }
                },
                "parameters": [
                    {
                        "name": "token",
                        "in": "query",
                        "required": true,
                        "schema": {
                            "type": "string"
                        },
                        "description": "Enter your Apify token here"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK"
                    }
                }
            }
        }
    },
    "components": {
        "schemas": {
            "inputSchema": {
                "type": "object",
                "properties": {
                    "fred_api_key": {
                        "title": "FRED API Key",
                        "type": "string",
                        "description": "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": {
                        "title": "Default lookback window (days)",
                        "minimum": 1,
                        "maximum": 3650,
                        "type": "integer",
                        "description": "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.",
                        "default": 30
                    }
                }
            },
            "runsResponseSchema": {
                "type": "object",
                "properties": {
                    "data": {
                        "type": "object",
                        "properties": {
                            "id": {
                                "type": "string"
                            },
                            "actId": {
                                "type": "string"
                            },
                            "userId": {
                                "type": "string"
                            },
                            "startedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "finishedAt": {
                                "type": "string",
                                "format": "date-time",
                                "example": "2025-01-08T00:00:00.000Z"
                            },
                            "status": {
                                "type": "string",
                                "example": "READY"
                            },
                            "meta": {
                                "type": "object",
                                "properties": {
                                    "origin": {
                                        "type": "string",
                                        "example": "API"
                                    },
                                    "userAgent": {
                                        "type": "string"
                                    }
                                }
                            },
                            "stats": {
                                "type": "object",
                                "properties": {
                                    "inputBodyLen": {
                                        "type": "integer",
                                        "example": 2000
                                    },
                                    "rebootCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "restartCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "resurrectCount": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "computeUnits": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "options": {
                                "type": "object",
                                "properties": {
                                    "build": {
                                        "type": "string",
                                        "example": "latest"
                                    },
                                    "timeoutSecs": {
                                        "type": "integer",
                                        "example": 300
                                    },
                                    "memoryMbytes": {
                                        "type": "integer",
                                        "example": 1024
                                    },
                                    "diskMbytes": {
                                        "type": "integer",
                                        "example": 2048
                                    }
                                }
                            },
                            "buildId": {
                                "type": "string"
                            },
                            "defaultKeyValueStoreId": {
                                "type": "string"
                            },
                            "defaultDatasetId": {
                                "type": "string"
                            },
                            "defaultRequestQueueId": {
                                "type": "string"
                            },
                            "buildNumber": {
                                "type": "string",
                                "example": "1.0.0"
                            },
                            "containerUrl": {
                                "type": "string"
                            },
                            "usage": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "integer",
                                        "example": 1
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            },
                            "usageTotalUsd": {
                                "type": "number",
                                "example": 0.00005
                            },
                            "usageUsd": {
                                "type": "object",
                                "properties": {
                                    "ACTOR_COMPUTE_UNITS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATASET_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "KEY_VALUE_STORE_WRITES": {
                                        "type": "number",
                                        "example": 0.00005
                                    },
                                    "KEY_VALUE_STORE_LISTS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_READS": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "REQUEST_QUEUE_WRITES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_INTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "DATA_TRANSFER_EXTERNAL_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                                        "type": "integer",
                                        "example": 0
                                    },
                                    "PROXY_SERPS": {
                                        "type": "integer",
                                        "example": 0
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}
```
