
FRED (Federal Reserve Economic Data) API integration with Model Context Protocol (MCP)
概览
MCP-FREDAPI provides access to economic data from the Federal Reserve Bank of St. Louis (FRED) through the Model Context Protocol. This integration allows AI assistants like Claude to retrieve economic time series data directly when used with Cursor or other MCP-compatible environments. This package integrates with the official FRED API, focusing specifically on the series_observations endpoint which provides time series data for economic indicators. This method is recommended as it matches the configuration shown in mcp.json. 1. First, install uv if you don't have it yet: 3. Use uv to run the server (no need to install dependencies separately): You'll need a FRED API key, which you can obtain from FRED API. To configure Cursor to use this MCP server, add the following to your ~/.cursor/mcp.json file: Replace /path/to/mcp-fredapi with the actual path to the repository on your system. For example:
README
以下为原文 README 节选,完整内容请查看原文。
MCP-FREDAPI
FRED (Federal Reserve Economic Data) API integration with Model Context Protocol (MCP)
Table of Contents
- Introduction
- Installation
- Configuration
- Available Tools
- Parameters
- Examples
- Contributing
- License
- References
Introduction
MCP-FREDAPI provides access to economic data from the Federal Reserve Bank of St. Louis (FRED) through the Model Context Protocol. This integration allows AI assistants like Claude to retrieve economic time series data directly when used with Cursor or other MCP-compatible environments.
This package integrates with the official FRED API, focusing specifically on the series_observations endpoint which provides time series data for economic indicators.
Installation
There are two installation methods:
Method 1: Using pip
Install the required dependencies:
pip install "mcp[cli]" httpx python-dotenv
Clone this repository:
git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi
Method 2: Using uv (Recommended)
This method is recommended as it matches the configuration shown in mcp.json.
- First, install uv if you don’t have it yet:
pip install uv
- Clone this repository:
git clone https://github.com/Jaldekoa/mcp-fredapi.git
cd mcp-fredapi
- Use uv to run the server (no need to install dependencies separately):
uv run --with mcp --with httpx mcp run server.py
Configuration
FRED API Key
You’ll need a FRED API key, which you can obtain from FRED API.
Create a .env file in the project root:
FRED_API_KEY=your_api_key_here
Claude/Cursor Configuration
To configure Cursor to use this MCP server, add the following to your ~/.cursor/mcp.json file:
{
"mcpServers": {
"mcp-fredapi": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
}
}
}
Replace /path/to/mcp-fredapi with the actual path to the repository on your system. For example:
{
"mcpServers": {
"mcp-fredapi": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
}
}
}
Note: On Windows, you can use either forward slashes / or double backslashes \\ in the path.
Available Tools
get_fred_series_observations
Retrieves economic time series observations from FRED.
安装
This server does not publish a one-line install command.
Open the repository installation guide 新手?先看 mcpskill.org 教程 →配置
{
"mcpServers": {
"mcp-fredapi": {
"command": "uv",
"args": ["--directory", "/path/to/mcp-fredapi", "run", "--with", "mcp", "--with", "httpx", "mcp", "run", "server.py"]
}
}
}