FR

FRED MCP Server for Economic Data

Query FRED with the MCP server to retrieve, analyze, and integrate Federal Reserve Economic Data via a community-developed GitHub project.

Quick Install
npx -y @stefanoamorelli/fred-mcp-server

Overview

FRED MCP Server for Economic Data is a community-developed bridge between the Federal Reserve Economic Data (FRED) API and applications or language models that use the Model Context Protocol (MCP). It wraps common FRED operations (searching series, fetching time series, metadata) in an HTTP interface that follows MCP conventions for discoverable tools, enabling automated agents, notebooks, or backend services to query economic indicators programmatically.

This server is useful when you want to integrate authoritative economic time series into pipelines that expect tool-like endpoints (for example, LLM tool calling), dashboards, or automated analysis scripts. By centralizing FRED access behind a simple, documented API, the MCP server reduces direct dependency on the FRED client in downstream code and provides optional features such as caching, rate-management, and a standardized tool manifest.

Features

  • Exposes FRED data through MCP-compatible HTTP endpoints (tool metadata + callable actions)
  • Search FRED series by keyword and retrieve series metadata
  • Fetch time-series observations for any FRED series ID (date ranges, frequency)
  • Simple environment-based configuration (API key, host/port, cache TTL)
  • Optional caching to reduce FRED API calls and improve latency
  • Health, metrics, and basic logging endpoints for operational use
  • Designed to be embedded into LLM toolchains or backend services

Installation / Configuration

Clone the repository and run it locally or in a container. The repository contains source and instructions; the examples below show common patterns for running from source and via Docker.

Clone the repo:

git clone https://github.com/stefanoamorelli/fred-mcp-server.git
cd fred-mcp-server

Run from source (language/runtime depends on project files)

  • If the project is Python-based:
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
# set environment variables and start
export FRED_API_KEY=your_fred_api_key
export PORT=8080
python -m fred_mcp_server  # or the repo's start command
  • If the project is Node-based:
npm install
export FRED_API_KEY=your_fred_api_key
export PORT=8080
npm start

Run with Docker:

# build image
docker build -t fred-mcp-server .

# run container (example)
docker run -d \
  -e FRED_API_KEY=your_fred_api_key \
  -e PORT=8080 \
  -p 8080:8080 \
  --name fred-mcp-server \
  fred-mcp-server

Common environment variables

FRED_API_KEY    # (required) Your FRED API key
PORT            # HTTP port the server listens on (default: 8080)
HOST            # Host bind address (default: 0.0.0.0)
CACHE_TTL       # Cache time-to-live in seconds (optional)
LOG_LEVEL       # Logging verbosity (e.g., INFO, DEBUG)

Check the repository README or source for exact start commands and any platform-specific notes.

Available Resources

The server exposes a small set of endpoints suitable for programmatic use and MCP tool discovery. Typical routes include:

  • GET /mcp/tools
    • Returns an MCP-compatible tools manifest describing available actions and input schemas.
  • GET /series/{series_id}
    • Retrieve metadata and observations for a specific FRED series.
    • Query parameters: start, end, frequency, units
  • GET /search?q={query}
    • Search FRED series by text; returns matching series IDs and short descriptions.
  • POST /query
    • Generic query endpoint that accepts structured requests (e.g., a series id + date-range) and returns results.
  • GET /health
    • Liveness/health check.
  • GET /metrics
    • Server metrics for monitoring (if enabled).

Note: Exact route names and payload schemas are defined in the repository; consult the implemented OpenAPI schema or /mcp/tools for canonical definitions.

Use Cases

  • LLM Tooling — expose FRED operations as MCP tools so a model can fetch CPI, GDP, unemployment, or other series as part of an analysis prompt. Example tool descriptor (simplified):
{
  "name": "fred_get_series",
  "description": "Retrieve time series observations for a FRED series ID",
  "input_schema": {"type":"object","properties":{"series_id":{"type":"string"},"start":{"type":"string"},"end":{"type":"string"}}}
}
  • Time-series analysis pipelines — fetch historical series (e.g., GDPC1, CPIAUCSL, UNRATE) for processing pipelines that compute seasonally-adjusted trends, growth rates, or correlation matrices. Example curl to fetch GDP series:
curl "http://localhost:8080/series/GDPC1?start=