@cyanheads/federal-reserve-mcp-server
Search and fetch ~800K Federal Reserve economic time-series from the FRED API via MCP, with STDIO or Streamable HTTP transport.
README
<div align="center"> <h1>@cyanheads/federal-reserve-mcp-server</h1> <p><b>Search and fetch ~800K Federal Reserve economic time-series from the FRED API via MCP. STDIO or Streamable HTTP.</b> <div>8 Tools</div> </p> </div>
<div align="center">
</div>
Tools
Five FRED tools plus three DataCanvas tools for querying spilled observation results via SQL:
| Tool | Description |
|---|---|
fedreserve_search_series |
Full-text search across FRED series titles, units, frequency, and tags — returns matching series IDs with metadata |
fedreserve_get_series |
Fetch metadata for one or more series (title, units, frequency, seasonal adjustment, observation range) |
fedreserve_get_observations |
Fetch date+value observation data for one or more series with date-range filtering and unit transformations |
fedreserve_browse_categories |
Navigate the FRED category tree; drill into a category to see child categories and a series sample |
fedreserve_get_release |
Look up a FRED release by ID or name search — returns release metadata and its associated series list |
fedreserve_dataframe_describe |
List active DataCanvas dataframes registered by this server (canvas IDs, row counts, schemas) |
fedreserve_dataframe_query |
Run a SELECT query against a registered DataCanvas dataframe |
fedreserve_dataframe_drop |
Drop a DataCanvas dataframe by name (opt-in via FRED_DATAFRAME_DROP_ENABLED=true) |
fedreserve_search_series
Search for FRED series by free-text query across titles, tags, and notes.
- Full-text and series-ID search modes
- Post-search filtering by frequency, units, or seasonal adjustment status
- Tag-name filtering (semicolon-delimited list)
- Pagination via
limitandoffset - To find series for a specific release, use
fedreserve_get_releaseinstead
fedreserve_get_series
Fetch metadata for one or more FRED series.
- Accepts up to 50 series IDs in a single call
- Returns title, units, frequency, seasonal adjustment, observation range, popularity, and notes
- Fires parallel upstream requests (no FRED batch endpoint exists); partial success reported per ID
fedreserve_get_observations
Fetch observation data (date + value pairs) for one or more series.
- Accepts up to 10 series IDs; fires one upstream request per series in parallel
- Date-range filtering with ISO 8601 dates (
observation_start,observation_end) - FRED's native unit transformations:
lin,chg,ch1,pch,pc1,pca,cch,cca,log - Frequency downsampling with configurable aggregation method (
avg,sum,eop) - Multi-series or >500-row results spill to a DataCanvas table; response includes a
dataset.namehandle for SQL querying viafedreserve_dataframe_query - Degrades gracefully when DataCanvas is unavailable — returns inline preview with row count
fedreserve_browse_categories
Navigate the FRED category hierarchy.
- Omit
category_idto start at the root (ID 0) - Provide a
category_idto see child categories and a series sample for leaf categories - Covers all FRED domains: Money & Banking, National Accounts, Employment, Prices, Housing, Trade, and more
fedreserve_get_release
Inspect a FRED data release and its associated series.
- Look up by
release_id(integer) orrelease_search(case-insensitive substring match) - Name search fetches all releases and filters client-side (FRED has no server-side release search)
- Returns release name, link, scheduled dates, and a paginated series list
- Use
series_limitandseries_offsetto page through large releases
Features
Built on @cyanheads/mcp-ts-core:
- Declarative tool definitions — single file per tool, framework handles registration and validation
- Unified error handling across all tools
- Pluggable auth (
none,jwt,oauth) - Swappable storage backends:
in-memory,filesystem,Supabase,Cloudflare KV/R2/D1 - Structured logging with optional OpenTelemetry tracing
- STDIO and Streamable HTTP transports
FRED-specific:
- Read-only access to the St. Louis Fed's FRED API (
api.stlouisfed.org/fred) - Parallel multi-series fetching via
Promise.allSettledwith partial success reporting - DataCanvas spillover for multi-series or large observation results — spilled tables queryable via
fedreserve_dataframe_query - Retry with backoff and 429 rate-limit detection against FRED's 120 req/min limit
- FRED's native unit transformations delegated server-side for precision against the full series history
Getting started
Add the following to your MCP client configuration file. Obtain a free FRED API key at research.stlouisfed.org/docs/api/api_key.html.
{
"mcpServers": {
"federal-reserve-mcp-server": {
"type": "stdio",
"command": "bunx",
"args": ["@cyanheads/federal-reserve-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"FRED_API_KEY": "your-api-key"
}
}
}
}
Or with npx (no Bun required):
{
"mcpServers": {
"federal-reserve-mcp-server": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@cyanheads/federal-reserve-mcp-server@latest"],
"env": {
"MCP_TRANSPORT_TYPE": "stdio",
"MCP_LOG_LEVEL": "info",
"FRED_API_KEY": "your-api-key"
}
}
}
}
Or with Docker:
{
"mcpServers": {
"federal-reserve-mcp-server": {
"type": "stdio",
"command": "docker",
"args": [
"run", "-i", "--rm",
"-e", "MCP_TRANSPORT_TYPE=stdio",
"-e", "FRED_API_KEY=your-api-key",
"ghcr.io/cyanheads/federal-reserve-mcp-server:latest"
]
}
}
}
For Streamable HTTP, set the transport and start the server:
MCP_TRANSPORT_TYPE=http MCP_HTTP_PORT=3010 FRED_API_KEY=... bun run start:http
# Server listens at http://localhost:3010/mcp
Prerequisites
- Bun v1.3.2 or higher.
- A free FRED API key from stlouisfed.org. The key grants 120 requests/minute.
Installation
- Clone the repository:
git clone https://github.com/cyanheads/federal-reserve-mcp-server.git
- Navigate into the directory:
cd federal-reserve-mcp-server
- Install dependencies:
bun install
- Configure environment:
cp .env.example .env
# edit .env and set FRED_API_KEY
Configuration
All configuration is validated at startup via Zod schemas in src/config/server-config.ts.
| Variable | Description | Default |
|---|---|---|
FRED_API_KEY |
Required. API key from stlouisfed.org. | — |
FRED_BASE_URL |
Override the FRED API base URL. | https://api.stlouisfed.org/fred |
FRED_DATASET_TTL_SECONDS |
Sliding TTL for DataCanvas-registered observation tables (seconds). | 86400 |
FRED_DATAFRAME_DROP_ENABLED |
Set true to expose the fedreserve_dataframe_drop tool. |
false |
CANVAS_PROVIDER_TYPE |
Set to duckdb to enable DataCanvas SQL querying for observation results. |
— |
MCP_TRANSPORT_TYPE |
Transport: stdio or http. |
stdio |
MCP_HTTP_PORT |
Port for HTTP server. | 3010 |
MCP_AUTH_MODE |
Auth mode: none, jwt, or oauth. |
none |
MCP_LOG_LEVEL |
Log level (RFC 5424). | info |
LOGS_DIR |
Directory for log files (Node.js only). | <project-root>/logs |
STORAGE_PROVIDER_TYPE |
Storage backend. | in-memory |
OTEL_ENABLED |
Enable OpenTelemetry instrumentation. | false |
See .env.example for the full list of optional overrides.
Running the server
Local development
-
Build and run:
# One-time build bun run rebuild # Run the built server bun run start:stdio # or bun run start:http -
Run checks and tests:
bun run devcheck # Lint, format, typecheck, security bun run test # Vitest test suite bun run lint:mcp # Validate MCP definitions against spec
Docker
docker build -t federal-reserve-mcp-server .
docker run --rm -e FRED_API_KEY=your-key -e MCP_TRANSPORT_TYPE=http -p 3010:3010 federal-reserve-mcp-server
The Dockerfile defaults to HTTP transport, stateless session mode, and logs to /var/log/federal-reserve-mcp-server. OpenTelemetry peer dependencies are installed by default — build with --build-arg OTEL_ENABLED=false to omit them.
Project structure
| Directory | Purpose |
|---|---|
src/index.ts |
createApp() entry point — registers tools and inits services. |
src/config |
Server-specific environment variable parsing and validation with Zod. |
src/mcp-server/tools |
Tool definitions (*.tool.ts). Eight tools across FRED domain and DataCanvas. |
src/services/fred |
FRED API service — HTTP client, retry, 429 handling, key injection. |
src/services/canvas-bridge |
DataCanvas adapter — table naming, TTL/provenance tracking, SQL gate extras. |
tests/ |
Unit and integration tests mirroring src/. |
docs/ |
Design and planning documents. |
Development guide
See CLAUDE.md for development guidelines and architectural rules. The short version:
- Handlers throw, framework catches — no
try/catchin tool logic - Use
ctx.logfor request-scoped logging,ctx.statefor tenant-scoped storage - Register new tools in
src/mcp-server/tools/definitions/index.ts - Wrap FRED API calls: validate raw response → normalize to domain type → return output schema; never fabricate missing fields
Contributing
Issues and pull requests are welcome. Run checks and tests before submitting:
bun run devcheck
bun run test
License
Apache-2.0 — see LICENSE for details.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。