Skip to main content
Glama
kevinkda

fred-macro-mcp

by kevinkda

fred-macro-mcp

CI CodeQL License: MIT

A read-only Model Context Protocol (MCP) server that wraps the FRED (Federal Reserve Economic Data, St. Louis Fed) public API.

FRED is the canonical free source for US macroeconomic time series — GDP, CPI, unemployment, policy and market interest rates, and the Treasury yield curve. This server lets an LLM agent overlay macro context on equity / fixed-income research: "what is CPI doing", "where is the 10y-2y spread", "when is the next jobs print".

Read-only by design. Every tool performs HTTPS GET requests against the single fixed host https://api.stlouisfed.org. There is no write, mutation, or order-placement path of any kind.

Tools

Tool

Purpose

get_series

Observation values for one series over an optional date window.

search_series

Keyword-search the FRED catalog to find the right series_id.

get_series_latest

The single most-recent observation for a series.

get_release_calendar

Upcoming FRED data releases in the next N days.

health_check

Local health probe (key configured? rate limit?). Never calls FRED.

get_server_info

Version, MCP SDK version, tool list. Never calls FRED.

get_series

  • When to use: pull a macro time series (e.g. CPI, GDP, 10y Treasury).

  • Input: series_id (e.g. CPIAUCSL), optional start / end (YYYY-MM-DD), optional limit.

  • Output: { series_id, start, end, units, observation_count, observations: [{date, value}, ...] }. Missing points ("." in FRED) surface as value: null.

  • Example: get_series(series_id="DGS10", start="2024-01-01").

search_series

  • When to use: you know the concept ("unemployment rate") but not the id.

  • Input: query (free text), optional limit.

  • Output: { query, result_count, results: [{id, title, frequency, units, observation_start, observation_end, popularity}, ...] }, most popular first.

  • Example: search_series(query="real gdp").

get_series_latest

  • When to use: "what is the current value of X" without the full history.

  • Input: series_id.

  • Output: { series_id, latest: {date, value} | null, units }.

  • Example: get_series_latest(series_id="UNRATE").

get_release_calendar

  • When to use: flag upcoming macro event risk (next CPI / GDP / jobs).

  • Input: days (1-180, default 14).

  • Output: { days, from_date, to_date, release_count, releases: [{release_id, release_name, date}, ...] }.

  • Example: get_release_calendar(days=30).

Related MCP server: FRED Economic MCP Server

Common series ids

Concept

series_id

Real GDP

GDPC1

CPI (all urban)

CPIAUCSL

Core PCE

PCEPILFE

Unemployment rate

UNRATE

Fed funds (effective)

DFF

10-year Treasury

DGS10

2-year Treasury

DGS2

10y-2y spread

T10Y2Y

Install

uv sync --extra dev

A FRED API key (free) is required. Copy .env.example to .env and set FRED_API_KEY.

Configure your MCP host

Add to your MCP host config (e.g. Cursor ~/.cursor/mcp.json):

{
  "mcpServers": {
    "fred-macro": {
      "command": "uv",
      "args": ["run", "fred-macro-mcp"],
      "cwd": "/opt/workspace/code/kevinkda/fred-macro-mcp",
      "env": { "FRED_API_KEY": "<your-fred-key>" }
    }
  }
}

FRED_API_KEY may also be set in .env instead of inline env.

Configuration

Env var

Default

Purpose

FRED_API_KEY

(required)

32-char FRED key. Never logged.

FRED_RATE_LIMIT_PER_MIN

120

Client throttle (≤ FRED's 120/min ceiling).

FRED_CACHE_ENABLED

false

Opt-in read-through cache.

FRED_CACHE_BYPASS

false

Force fresh reads while still writing.

FRED_CACHE_BACKEND

memory

memory (zero-dep) or clickhouse (opt-in extra).

FRED_CLICKHOUSE_URL

(unset)

DSN used only when backend is clickhouse.

LOG_LEVEL

WARNING

Log verbosity.

The cache is off by default and uses an in-process memory LRU when enabled — zero external dependencies. ClickHouse is an opt-in extra (pip install fred-macro-mcp[clickhouse]) for durable history.

Security

  • API key is the only secret. It is read from the environment, passed to FRED only as a bound query parameter, and redacted from every log line and exception message (api_key=… and bare 32-char keys are masked).

  • SSRF-safe. The host is a hard-coded constant; callers supply an endpoint path + params only and can never redirect to another host. Redirects are not followed.

  • Injection-safe. series_id and dates are validated with anchored regexes and passed as bound query parameters — never string-concatenated into a URL.

  • Rate-limited. A sliding-60-second token bucket keeps requests within FRED's documented 120 req/min budget.

See docs/SECURITY.md and docs/THREAT_MODEL.md.

Development

uv run pytest --cov=src --cov-fail-under=100
uv run ruff check src tests && uv run ruff format --check src tests
uv run mypy --strict src

Tests use respx to mock FRED — no real FRED API calls are made in the test suite.

License

MIT — see LICENSE.

Data © Federal Reserve Bank of St. Louis (FRED). Subject to FRED's terms of use. This server is for interactive single-user research.

Available Tools

6 tools
get_release_calendarA

Return upcoming FRED data releases in the next days days.

Useful for macro overlay: knowing when the next CPI / GDP / jobs print lands lets an agent flag event risk on the calendar.

ParametersJSON Schema
NameRequiredDescriptionDefault
daysNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.9/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully disclose behavioral traits. It indicates a read operation (return) but does not mention any potential side effects, auth requirements, or rate limits. For a simple calendar lookup, this is adequate but minimal.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is extremely concise with two sentences: one stating the primary function and one adding context. No unnecessary words or repetition.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple tool with one parameter and an output schema present, the description is largely complete. It could briefly mention the output format or typical release examples, but it covers the essential use case adequately.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema description coverage is 0%, so the description must compensate. It mentions 'days' but only repeats the parameter name ('next *days* days') without explaining its meaning, format, or constraints beyond the schema's default.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action (Return), the resource (upcoming FRED data releases), and the scope (next *days* days). It distinguishes itself from siblings like get_series or search_series by being a calendar tool.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description provides explicit context for when to use the tool (macro overlay, event risk flagging) and distinguishes from siblings implicitly. However, it does not mention when not to use it or provide alternative tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_seriesB

Return the observation series for a FRED economic data series.

series_id is a FRED identifier (e.g. GDP, CPIAUCSL, UNRATE, DGS10). start / end optionally bound the window as ISO YYYY-MM-DD dates.

ParametersJSON Schema
NameRequiredDescriptionDefault
endNo
limitNo
startNo
series_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

B3.3/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries full burden. It explains parameters and return type (observation series), but does not disclose behavior like pagination, error handling, rate limits, or the effect of the limit parameter on results.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three concise sentences with a clear structure: core purpose, then parameter details. No unnecessary information.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Output schema exists (context shows has_output_schema=true), so return values are covered. However, missing details about limit parameter behavior and potential data truncation limit completeness. Also no mention of how the series data is structured (e.g., frequency, units).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 0% schema description coverage, the description must explain all parameters. It covers series_id (with examples), start/end (ISO format), but omits the limit parameter. This leaves ambiguity about its purpose and default behavior.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it returns observation series for a FRED economic data series, with examples of series IDs. However, it does not explicitly differentiate from siblings like get_series_latest or search_series.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explains that series_id is required and start/end are optional, but it lacks guidance on when to use this tool versus alternatives like get_series_latest or search_series. No when-not or context for selecting this tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_series_latestA

Return the single most-recent observation for a FRED series.

Cheaper than get_series when an agent only needs the current value of a macro indicator.

ParametersJSON Schema
NameRequiredDescriptionDefault
series_idYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.1/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It mentions 'cheaper' as a behavioral trait but does not disclose error handling, rate limits, or prerequisites like series existence. The presence of an output schema reduces the need to explain return format, but more context on behavior is needed.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences, no wasted words. First sentence states purpose, second provides usage guidance. Front-loaded and efficient.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (one parameter, output schema present), the description covers the core purpose and usage. However, it omits minor but helpful details like error handling or validation, but overall is fairly complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, yet the description adds no extra meaning to the single parameter series_id beyond its name. While the usage implies it's a FRED series identifier, no format or examples are given, making it less helpful for an agent.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool returns the single most-recent observation for a FRED series, using specific verb 'Return' and resource. It also distinguishes itself from the sibling tool get_series by noting it's cheaper.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly says 'Cheaper than get_series when an agent only needs the current value of a macro indicator', providing a clear when-to-use and when-not-to-use directive.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_server_infoA

Local server metadata. Never calls FRED.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description effectively discloses the key behavioral trait: it is a local operation with no FRED calls, which is sufficient for this simple tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two short sentences that are front-loaded and contain no unnecessary words, efficiently conveying purpose and a key differentiator.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity and the presence of an output schema, the description fully covers what the tool does, its context (local metadata), and its distinct behavior (no FRED calls).

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

There are zero parameters, so the baseline score of 4 applies; the description adds value by specifying the tool's scope beyond the schema.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it retrieves local server metadata and explicitly distinguishes itself by noting 'Never calls FRED,' which separates it from siblings that likely rely on FRED.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for local metadata without external calls but does not explicitly state when to use this tool versus alternatives like get_series or search_series.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

health_checkA

Local health probe. Never calls FRED.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations provided, so description carries burden. Mentions it doesn't call FRED, but does not describe what the probe does, what it returns, or side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Extremely concise: two short sentences with no waste. Front-loaded with purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given no parameters and output schema exists, description covers the essential purpose but lacks detail on what the health check entails.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

No parameters, schema coverage 100%. Description adds no further parameter info, but baseline for 0 params is 4.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it is a local health probe, and 'Never calls FRED' distinguishes it from sibling tools that might call external services. The verb 'probe' and resource 'health' are specific.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit when-to-use or when-not-to-use guidance. The phrase 'Never calls FRED' implies it is safe to call frequently, but no alternatives are mentioned.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_seriesA

Search the FRED catalog for series matching query keywords.

Returns the most popular matches with their frequency, units, and observation range so an agent can pick the right series_id.

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description must fully convey behavioral traits. It mentions returning 'most popular matches' (sorting) and includes frequency, units, and observation range. However, it does not explain pagination, error handling, or how the 'limit' parameter affects results. The description adds value beyond the schema but is not fully transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no extraneous information. It front-loads the core action and purpose, then adds value by specifying the output purpose ('so an agent can pick the right series_id'). Efficient and well-structured.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given two parameters and the existence of an output schema (not shown), the description adequately covers the tool's purpose and main output. It could include more on how search results are ordered or pagination, but overall it is fairly complete for a search tool.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must clarify parameters. It explains that 'query' is a keyword search, but does not describe the 'limit' parameter beyond its schema presence. For a tool with 2 parameters, this is partial but sufficient for basic understanding.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb 'Search' and resource 'FRED catalog for series'. It clearly states the output: 'most popular matches with their frequency, units, and observation range', which helps distinguish from siblings like 'get_series' that retrieve a single series by ID.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies this tool is for finding a series_id when you don't know it, but it doesn't explicitly state when not to use or compare to alternatives like 'get_series' or 'get_series_latest'. The phrase 'so an agent can pick the right series_id' gives context, but lacks explicit exclusion guidelines.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: release calendar, series data retrieval (full or latest), search, and server info/health. No overlapping functionality.

Naming Consistency5/5

All tools use consistent snake_case with a verb_noun pattern (get_*, search_*, health_check). The pattern is predictable and easy to understand.

Tool Count5/5

6 tools is well-scoped for a FRED macro data server. It covers essential operations without being too many or too few.

Completeness4/5

Covers search, retrieval (full and latest), release calendar, and server metadata. Minor gap: no bulk data retrieval for multiple series in one call, but the core workflow is complete.

Maintenance

ActivityStale
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Provides access to Federal Reserve Economic Data (FRED) through Claude and other LLM clients, enabling users to search for, retrieve, and visualize economic indicators like GDP, employment, and inflation data.
    8
  • A
    license
    Not graded
    quality
    D
    maintenance
    Provides access to 800,000+ Federal Reserve Economic Data (FRED) time series, enabling users to search, retrieve, and analyze economic indicators like GDP, unemployment, inflation, and interest rates through natural language queries.
    MIT
  • A
    license
    A
    quality
    A
    maintenance
    Enables AI agents to search and retrieve FRED economic time series, including vintage (as-published) data, with tools for series search, observation retrieval, release calendar, revision history, and more.
    9
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    Enables users to search, retrieve, and explore economic data series from the Federal Reserve Economic Data (FRED) API using natural language.
    11
    MIT

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/kevinkda/fred-macro-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server