FRED (Federal Reserve Economic Data) MCP server

Integrates with the Federal Reserve Economic Data (FRED) API to retrieve economic time series data with customizable parameters for date ranges, frequency aggregation, and data transformations.
Back to servers
Provider
Jon Aldekoa
Release date
Apr 04, 2025
Language
Python
Stats
2 stars

MCP-FREDAPI provides access to economic data from the Federal Reserve Bank of St. Louis (FRED) through the Model Context Protocol. This integration enables AI assistants like Claude to retrieve economic time series data directly when used with Cursor or other MCP-compatible environments.

Installation

There are two ways to install and set up the MCP-FREDAPI server:

Method 1: Using pip

pip install "mcp[cli]" httpx python-dotenv
git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi

Method 2: Using uv (Recommended)

pip install uv
git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi
uv run --with mcp --with httpx mcp run server.py

Configuration

FRED API Key

  1. Obtain a FRED API key from FRED API
  2. Create a .env file in the project root:
FRED_API_KEY=your_api_key_here

Claude/Cursor Configuration

Add the following to your ~/.cursor/mcp.json file:

{
  "mcpServers": {
    "mcp-fredapi": {
      "command": "uv",
      "args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
    }
  }
}

Replace /path/to/mcp-fredapi with the actual path to the repository on your system.

Available Tools

get_fred_series_observations

This tool retrieves economic time series observations from FRED. When using Claude in Cursor, access this tool directly with:

@mcp-fredapi:get_fred_series_observations

Parameters

The get_fred_series_observations tool accepts the following parameters:

Parameter Type Description Allowed Values Default Value Status
series_id str The ID of the economic series - (Required) ✅ Works
sort_order str Sort order of observations 'asc', 'desc' 'asc' ✅ Works
units str Data value transformation 'lin', 'chg', 'ch1', 'pch', 'pc1', 'pca', 'cch', 'cca', 'log' 'lin' ✅ Works
frequency str Frequency of observations 'd', 'w', 'bw', 'm', 'q', 'sa', 'a', 'wef', 'weth', 'wew', 'wetu', 'wem', 'wesu', 'wesa', 'bwew', 'bwem' None ✅ Works
aggregation_method str Aggregation method for frequency 'avg', 'sum', 'eop' 'avg' ✅ Works
output_type int Output type of observations 1, 2, 3, 4 1 ✅ Works

Currently, only the parameters marked with ✅ are working properly. Other parameters (realtime_start, realtime_end, limit, offset, observation_start, observation_end, and vintage_dates) are not working.

Usage Examples

Getting US GDP Data

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP"
}

Getting GDP Data in Descending Order

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP",
  "sort_order": "desc"
}

Getting Annual GDP Data

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP",
  "frequency": "a"
}

Getting Inflation Rate

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "CPIAUCSL",
  "units": "pch",
  "frequency": "m"
}

Different Output Format

@mcp-fredapi:get_fred_series_observations
{
  "series_id": "GDP",
  "output_type": 2
}

Common Economic Series IDs

Here are some commonly used FRED economic data series:

  • GDP: Gross Domestic Product
  • CPIAUCSL: Consumer Price Index for All Urban Consumers
  • UNRATE: Unemployment Rate
  • FEDFUNDS: Federal Funds Effective Rate
  • M2: M2 Money Stock
  • HOUST: Housing Starts
  • INDPRO: Industrial Production Index
  • PAYEMS: All Employees, Total Nonfarm

How to add this MCP server to Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later