Provides access to Federal Reserve FRED time series data via MCP for AI assistants and Cursor workflows.
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.
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.
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.pyProvide 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_hereTo 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"]
}
}
}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.
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.
Getting US GDP data in ascending order with default units.
{
"series_id": "GDP"
}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.
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.
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.
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.
Contributions are welcome. Add features, improve documentation, or expand supported parameters. Follow standard collaboration practices for this project.
This project is released under the MIT License. See the license file for details.
Retrieves economic time series observations from FRED with configurable parameters such as series_id, sort_order, units, frequency, and output_type.