fred-mcp

fred-mcp

Enables querying and retrieving Federal Reserve Economic Data (FRED) including series, categories, releases, sources, and tags, with support for stdio and HTTP transports and bring-your-own-key authentication.

Category
访问服务器

README

Federal Reserve Economic Data MCP Server

[!NOTE] This open-source project is not affiliated with, sponsored by, or endorsed by the Federal Reserve or the Federal Reserve Bank of St. Louis. "FRED" is a registered trademark of the Federal Reserve Bank of St. Louis, used here for descriptive purposes only.

A production-grade Model Context Protocol server for FRED® economic data. Covers all 31 endpoints exposed by fred-py-api.

Features

  • Full FRED API v1 coverage: series, categories, releases, sources, and tags
  • FastMCP 3.x with structured tool output and proper ToolError handling
  • Dual-mode credentials: environment variable (stdio) or per-client HTTP header (remote BYOK)
  • Transports: stdio, streamable-http, and sse
  • Docker image published to GHCR

Installation

pip install fred-mcp

Requires Python 3.10+.

Get a free FRED API key at fredaccount.stlouisfed.org/apikey.

Setup

Remote hosted server (recommended)

Use the public hosted server with bring your own key (BYOK): no install and no shared server-side API key. Each client sends its own FRED API key in the X-FRED-API-Key header.

Transport: streamable HTTP. Endpoint: https://fred-mcp-prod.fly.dev/mcp.

Add this to your MCP client's configuration file and restart the client:

{
  "mcpServers": {
    "fred-mcp": {
      "url": "https://fred-mcp-prod.fly.dev/mcp",
      "headers": {
        "X-FRED-API-Key": "<your fred api key>"
      }
    }
  }
}

Programmatic example with the FastMCP client:

from fastmcp import Client
from fastmcp.client.transports import StreamableHttpTransport

transport = StreamableHttpTransport(
    "https://fred-mcp-prod.fly.dev/mcp",
    headers={"X-FRED-API-Key": "your_fred_api_key"},
)
async with Client(transport=transport) as client:
    await client.ping()

Local (stdio)

For clients that spawn a local process, install fred-mcp and use:

{
  "mcpServers": {
    "fred-mcp": {
      "command": "fred-mcp",
      "env": {
        "FRED_API_KEY": "<your fred api key>"
      }
    }
  }
}

Or run directly from the terminal:

export FRED_API_KEY=your_api_key
fred-mcp

Self-hosted HTTP

Deploy your own instance and use the same url + headers configuration, substituting your host for the endpoint above. No shared server-side key is required when clients send X-FRED-API-Key.

For public internet deployment, terminate TLS at a reverse proxy (nginx, Caddy, Cloudflare). Do not expose plain HTTP with API keys.

Docker

Run the server:

docker run -d -p 8000:8000 \
  --name fred-mcp-server \
  ghcr.io/zachspar/fred-mcp/fred-mcp-server:latest

Connect with your FRED API key in the X-FRED-API-Key header (same JSON shape as the remote hosted example, with url set to your deployment).

For stdio via Docker:

{
  "mcpServers": {
    "fred-mcp": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "MCP_SERVER_TRANSPORT=stdio",
        "-e", "FRED_API_KEY=<your fred api key>",
        "ghcr.io/zachspar/fred-mcp/fred-mcp-server:latest"
      ]
    }
  }
}

Optional server-side fallback key

Set FRED_API_KEY on the server for clients that cannot send custom headers. Header takes precedence when both are present.

Variable Default Description
FRED_API_KEY FRED API key (required for stdio; optional HTTP fallback)
FRED_API_KEY_HEADER X-FRED-API-Key HTTP header name for BYOK
MCP_SERVER_TRANSPORT stdio stdio, streamable-http, or sse
MCP_SERVER_HOST localhost Bind host for HTTP transports
MCP_SERVER_PORT 8000 Bind port for HTTP transports

Tools (31)

Series

Tool Description
get_series Series metadata
get_series_categories Categories for a series
get_series_observations Data values / observations
get_series_release Release that publishes a series
search_series Search series by text or ID
search_series_tags Tags for a series search
search_series_related_tags Related tags for a series search
get_series_tags Tags on a series
get_series_updates Recently updated series
get_series_vintage_dates Vintage / revision dates

Categories

Tool Description
get_category Category metadata
get_category_children Child categories
get_category_related Related categories
get_category_series Series in a category
get_category_tags Tags in a category
get_category_related_tags Related tags in a category

Releases

Tool Description
list_releases All releases
list_release_dates Release dates across releases
get_release Release metadata
get_release_dates Dates for one release
get_release_series Series in a release
get_release_sources Sources for a release
get_release_tags Tags for a release
get_release_related_tags Related tags for a release
get_release_tables Release tables

Sources

Tool Description
list_sources All data sources
get_source Source metadata
get_source_releases Releases from a source

Tags

Tool Description
list_tags Search / list tags
get_related_tags Related tags
get_tags_series Series matching tags

Migration from 0.x

Version 1.0.0 renames tools to snake_case and upgrades to FastMCP 3.x.

Old name (0.x) New name (1.0)
FREDSeries get_series
FREDSeriesCategories get_series_categories
FREDSeriesObservations get_series_observations
FREDSeriesRelease get_series_release
FREDSeriesSearch search_series
FREDSeriesSearchTags search_series_tags
FREDSeriesSearchRelatedTags search_series_related_tags
FREDSeriesTags get_series_tags
FREDSeriesUpdates get_series_updates
FREDSeriesVintageDates get_series_vintage_dates

21 additional tools were added for categories, releases, sources, and tags.

Error responses now use MCP ToolError (isError: true) instead of {"error": ...} payloads.

Development

python3.13 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
pytest
ruff check src tests

License

MIT

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选