Federal Reserve Economic Data MCP Server
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 4 with structured tool output and proper
ToolErrorhandling - Dual-mode credentials: environment variable (stdio) or per-client HTTP header (remote BYOK)
- Transports:
stdio,streamable-http, andsse - 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.list_tools()
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
The image is published only when a GitHub Release is published. That push tags latest, the release's git tag, and the released commit SHA.
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 |
MCP_LOG_LEVEL |
INFO |
Level for structlog JSON lines |
MCP_LOG_MAX_BODY |
65536 |
Max bytes of a tool's arguments or result kept in one log line. 0 keeps the full payload |
Each MCP tool call writes one JSON line to stderr. The line includes the tool name, the arguments, the result or error, and the duration. On HTTP it also includes the method, path, and mcp-session-id when that header is present. The FRED API key is not logged. Stderr is used so stdio transport keeps its protocol frames on stdout.
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 |
Development
python3.13 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
make check
License
MIT
Metadata
Release files for fred-mcp 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| fred_mcp-1.2.0.tar.gz | 19.5 kB | With provenance | Details for fred_mcp-1.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| fred_mcp-1.2.0-py3-none-any.whl | Python 3 | none | any | Details for fred_mcp-1.2.0-py3-none-any.whl |
Total release size: 37.4 kB
Release files / fred_mcp-1.2.0.tar.gz
| Download URL | fred_mcp-1.2.0.tar.gz |
|---|---|
| Size | 19.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
33d89f6d0399aeae0221d325106972c88ec8df6e85785401f6564595f4a88a13
|
|
BLAKE2b-256 checksum How to use checksums |
e5f5abb77b2d76ca7f6240ddbfd53550a2ce0bb1cc54ff101f75cfd3905e3878
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logRelease files / fred_mcp-1.2.0-py3-none-any.whl
| Download URL | fred_mcp-1.2.0-py3-none-any.whl |
|---|---|
| Size | 17.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
92b8322512da235bd5106e326f4565d5914d96d0f88103fa9f31372368bf153c
|
|
BLAKE2b-256 checksum How to use checksums |
38da4bff15608051049c7f5ee55172e7fca49cda4b06586a579f947e5374a3cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logSecurity for fred-mcp 1.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for fred_mcp-1.2.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 2, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.