Home / MCP / FRED MCP Server

FRED MCP Server

Provides access to Federal Reserve FRED time series data via MCP for AI assistants and Cursor workflows.

python
Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
    "mcpServers": {
        "fredapi": {
            "command": "uv",
            "args": [
                "run",
                "--with",
                "mcp",
                "--with",
                "httpx",
                "mcp",
                "run",
                "server.py"
            ],
            "env": {
                "FRED_API_KEY": "YOUR_API_KEY"
            }
        }
    }
}

You set up the MCP-FREDAPI server to retrieve Federal Reserve economic time series data directly into your AI workflows. This MCP server acts as a bridge between the FRED API and your MCP-enabled client, letting you query series observations and use the results in conversations or analyses.

How to use

You connect to the MCP-FREDAPI server from your MCP client. Use the provided tool get_fred_series_observations to request data for a specific economic series (for example GDP or CPI). You can specify the desired series_id, how you want the results ordered, and the units you want the data transformed into. The tool returns time series observations that you can then incorporate into your analysis, charts, or summaries.

How to install

Prerequisites you need before installing include Python and a runtime command for starting the MCP server. You will also rely on a MCP client that can load and use MCP servers.

pip install "mcp[cli]" httpx python-dotenv
```

```terminal
git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi
```

```terminal
pip install uv
```

```terminal
uv run --with mcp --with httpx mcp run server.py

Configuration

Provide your FRED API key and configure how you run and connect to the MCP server from your client.

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

Set the FRED API key in an environment file at the project root so the server can authenticate with the FRED API.

FRED_API_KEY=your_api_key_here

Configuration: Claude/Cursor setup

To connect Cursor to this MCP server, add an MCP server entry pointing at the local server you started. The example shows how to reference the server via the uv runtime and the directory where you placed the MCP server.

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

Available tools

get_fred_series_observations retrieves economic time series observations from FRED. You use it by asking for the desired series_id and optional parameters such as sort_order, units, and frequency.

Parameters

The tool accepts parameters to customize the data retrieval. Only a subset is guaranteed to work in this MCP integration. Key parameters include series_id, sort_order, units, frequency, and output_type.

Examples

Getting US GDP data in ascending order with default units.

{
  "series_id": "GDP"
}

Notes and limitations

Certain parameters may not be fully implemented yet. Use the working parameters (series_id, sort_order, units, frequency, aggregation_method, output_type) for best results. Expect future updates to broaden support.

Security and maintenance

Keep your FRED API key secure. Do not commit it into public repositories. Use environment variables and secure storage for credentials. Regularly update dependencies and monitor the server for access and usage.

Troubleshooting

If the server fails to start, verify that Python and uv are installed, the FRED_API_KEY is set, and the path to the MCP server directory is correct in the run command. Check that the server.py file exists in the specified directory.

Notes on usage patterns

You can ask for GDP, CPI, or other indicators and adjust how you want the data aggregated and displayed. Use the provided tool name and parameters to shape responses in your analytics or dashboards.

Contributing

Contributions are welcome. Add features, improve documentation, or expand supported parameters. Follow standard collaboration practices for this project.

License

This project is released under the MIT License. See the license file for details.

Available tools

get_fred_series_observations

Retrieves economic time series observations from FRED with configurable parameters such as series_id, sort_order, units, frequency, and output_type.