nimar2/fred-mcp-server
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.
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:
| Tool | Description | FRED API Endpoint |
|---|---|---|
fred_search | Search for economic data series by keywords, tags, or filters | series/search |
fred_get_series | Retrieve observation data with transformations and date ranges | series/observations |
fred_browse | Browse the complete catalog via categories, releases, or sources | category/*, releases, sources |
Prerequisites
- Python >= 3.10
- 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
search_text | string | No | Text to search in series titles/descriptions |
search_type | string | No | "full_text" or "series_id" |
tag_names | string | No | Semicolon-separated tags (e.g., "usa;m2") |
exclude_tag_names | string | No | Tags to exclude |
limit | int | No | Max results (default: 1000) |
offset | int | No | Skip results for pagination |
order_by | string | No | "search_rank", "popularity", "last_updated", etc. |
sort_order | string | No | "asc" or "desc" |
filter_variable | string | No | "frequency", "units", or "seasonal_adjustment" |
filter_value | string | No | Value 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
series_id | string | Yes | FRED series ID (e.g., "GDP", "UNRATE") |
observation_start | string | No | Start date (YYYY-MM-DD) |
observation_end | string | No | End date (YYYY-MM-DD) |
limit | int | No | Max observations |
offset | int | No | Skip observations |
sort_order | string | No | "asc" or "desc" |
units | string | No | Data transformation (see below) |
frequency | string | No | Frequency aggregation (see below) |
aggregation_method | string | No | "avg", "sum", or "eop" |
Units Transformations:
lin- Levels (no transformation)chg- Change from previous periodch1- Change from year agopch- Percent changepc1- Percent change from year agopca- Compounded annual rate of changecch- Continuously compounded rate of changecca- Continuously compounded annual ratelog- 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:
| Parameter | Type | Required | Description |
|---|---|---|---|
browse_type | string | Yes | "categories", "releases", "sources", "category_series", "release_series" |
category_id | int | No | Category ID (default: 0 for root) |
release_id | int | No* | Release ID (*required for release_series) |
limit | int | No | Max results |
offset | int | No | Skip results |
order_by | string | No | Field to order by |
sort_order | string | No | "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 ID | Description |
|---|---|
GDP | Gross Domestic Product |
GDPC1 | Real GDP |
UNRATE | Unemployment Rate |
CPIAUCSL | Consumer Price Index |
DFF | Federal Funds Effective Rate |
T10Y2Y | 10-Year Treasury Minus 2-Year |
M2SL | M2 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