fred-mcp-server

nimar2/fred-mcp-server

3.2

If you are the rightful owner of fred-mcp-server and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

The FRED MCP Server provides AI assistants with access to the Federal Reserve Economic Data (FRED) API, offering over 800,000 economic time series.

Tools
3
Resources
0
Prompts
0

FRED MCP Server

An MCP (Model Context Protocol) server that provides AI assistants with access to the Federal Reserve Economic Data (FRED) API. Access over 800,000+ economic time series including GDP, unemployment, inflation, interest rates, and more.

Features

This server exposes three powerful tools:

ToolDescriptionFRED API Endpoint
fred_searchSearch for economic data series by keywords, tags, or filtersseries/search
fred_get_seriesRetrieve observation data with transformations and date rangesseries/observations
fred_browseBrowse the complete catalog via categories, releases, or sourcescategory/*, releases, sources

Prerequisites

  1. Python >= 3.10
  2. FRED API Key - Get one free at: https://fred.stlouisfed.org/docs/api/api_key.html

Installation

# Clone the repository
git clone https://github.com/nimar2/fred-mcp-server.git
cd fred-mcp-server

# Create virtual environment (recommended)
python3.12 -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate

# Install dependencies
pip install -r requirements.txt

Configuration

Claude Desktop

Add to your Claude Desktop configuration file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json Linux: ~/.config/Claude/claude_desktop_config.json Windows: %APPDATA%/Claude/claude_desktop_config.json

{
  "mcpServers": {
    "fred": {
      "command": "python",
      "args": ["/absolute/path/to/fred-mcp-server/server.py"],
      "env": {
        "FRED_API_KEY": "your-api-key-here"
      }
    }
  }
}

Claude Code

claude mcp add fred -s user -- python /path/to/fred-mcp-server/server.py -e FRED_API_KEY=your-api-key

Or add to ~/.claude/settings.json:

{
  "mcpServers": {
    "fred": {
      "command": "python3.12",
      "args": ["/absolute/path/to/fred-mcp-server/server.py"],
      "env": {
        "FRED_API_KEY": "your-api-key-here"
      }
    }
  }
}

Tools Reference

fred_search

Search for FRED economic data series by keywords, tags, or filters.

Parameters:

ParameterTypeRequiredDescription
search_textstringNoText to search in series titles/descriptions
search_typestringNo"full_text" or "series_id"
tag_namesstringNoSemicolon-separated tags (e.g., "usa;m2")
exclude_tag_namesstringNoTags to exclude
limitintNoMax results (default: 1000)
offsetintNoSkip results for pagination
order_bystringNo"search_rank", "popularity", "last_updated", etc.
sort_orderstringNo"asc" or "desc"
filter_variablestringNo"frequency", "units", or "seasonal_adjustment"
filter_valuestringNoValue to filter by

Examples:

# Search for GDP series
search_text: "gross domestic product"
limit: 10

# Search with tags
search_text: "money supply"
tag_names: "usa;m2"
order_by: "popularity"

# Filter by frequency
search_text: "inflation"
filter_variable: "frequency"
filter_value: "Monthly"

fred_get_series

Retrieve observation data for any FRED series with optional transformations.

Parameters:

ParameterTypeRequiredDescription
series_idstringYesFRED series ID (e.g., "GDP", "UNRATE")
observation_startstringNoStart date (YYYY-MM-DD)
observation_endstringNoEnd date (YYYY-MM-DD)
limitintNoMax observations
offsetintNoSkip observations
sort_orderstringNo"asc" or "desc"
unitsstringNoData transformation (see below)
frequencystringNoFrequency aggregation (see below)
aggregation_methodstringNo"avg", "sum", or "eop"

Units Transformations:

  • lin - Levels (no transformation)
  • chg - Change from previous period
  • ch1 - Change from year ago
  • pch - Percent change
  • pc1 - Percent change from year ago
  • pca - Compounded annual rate of change
  • cch - Continuously compounded rate of change
  • cca - Continuously compounded annual rate
  • log - Natural logarithm

Frequency Aggregation:

  • d (Daily), w (Weekly), bw (Biweekly), m (Monthly), q (Quarterly), sa (Semiannual), a (Annual)

Examples:

# Get unemployment rate
series_id: "UNRATE"

# Get GDP with date range
series_id: "GDP"
observation_start: "2020-01-01"
observation_end: "2024-01-01"

# Get percent change in CPI
series_id: "CPIAUCSL"
units: "pch"

# Aggregate daily Fed Funds to monthly
series_id: "DFF"
frequency: "m"
aggregation_method: "avg"

fred_browse

Browse FRED's complete catalog through categories, releases, or sources.

Parameters:

ParameterTypeRequiredDescription
browse_typestringYes"categories", "releases", "sources", "category_series", "release_series"
category_idintNoCategory ID (default: 0 for root)
release_idintNo*Release ID (*required for release_series)
limitintNoMax results
offsetintNoSkip results
order_bystringNoField to order by
sort_orderstringNo"asc" or "desc"

Examples:

# Browse root categories
browse_type: "categories"

# Browse Money, Banking & Finance subcategories
browse_type: "categories"
category_id: 32991

# List all releases
browse_type: "releases"
order_by: "name"

# List all data sources
browse_type: "sources"

# Get series in GDP release
browse_type: "release_series"
release_id: 53

Common Series IDs

Series IDDescription
GDPGross Domestic Product
GDPC1Real GDP
UNRATEUnemployment Rate
CPIAUCSLConsumer Price Index
DFFFederal Funds Effective Rate
T10Y2Y10-Year Treasury Minus 2-Year
M2SLM2 Money Supply

Development

# Run tests
pytest test_server.py -v

# Test with MCP Inspector
FRED_API_KEY=your-key mcp dev server.py

API Documentation

License

MIT