MCP-FREDAPI
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP-FREDAPI-RENDER
FRED (Federal Reserve Economic Data) API MCP Server for Render Deployment
Table of Contents
Related MCP server: fred-mcp
Introduction
This is an MCP (Model Context Protocol) server for accessing FRED (Federal Reserve Economic Data), designed to be deployable on Render while maintaining full MCP functionality. It provides economic data from the Federal Reserve Bank of St. Louis through the MCP protocol.
The server integrates with the official FRED API, focusing specifically on the series_observations endpoint which provides time series data for economic indicators.
How It Works
This server is designed to work in two modes:
Local MCP Mode: When run locally without a
PORTenvironment variable, it runs as a standard MCP server using stdio transport (perfect for Cursor integration)Render Deployment Mode: When deployed on Render (with
PORTenv var), it runs a simple HTTP health check server to keep the service alive, while still being an MCP server at its core
The clever part is that it remains a true MCP server in both modes - the HTTP server is just for Render's health checks.
Render Deployment
Quick Deploy
Fork this repository
Connect your GitHub account to Render
Create a new Web Service on Render
Connect your forked repository
Set the environment variable
FRED_API_KEYwith your API keyDeploy!
Manual Configuration
If you prefer manual setup:
Build Command:
pip install -r requirements.txtStart Command:
python app.pyEnvironment Variables:
FRED_API_KEY: Your FRED API key (required)PORT: Port number (automatically set by Render)
Using render.yaml
This repository includes a render.yaml file for Infrastructure as Code deployment:
services:
- type: web
name: mcp-fredapi
env: python
plan: free
buildCommand: pip install -r requirements.txt
startCommand: python app.py
envVars:
- key: PYTHON_VERSION
value: 3.9.18
- key: PORT
value: 10000
- key: FRED_API_KEY
sync: falseEnvironment Variables
Required
FRED_API_KEY: Your FRED API key. Get one from FRED API.
Optional
PORT: Port number for health check server (automatically set by Render)RENDER: Set by Render automatically to indicate cloud deployment
Local MCP Usage
When running locally (without PORT env var), the server runs in pure MCP mode:
# Local MCP server mode
python app.pyThis starts the MCP server using stdio transport, perfect for integration with Cursor or other MCP clients.
Cursor Integration
To use this MCP server with Cursor, add this to your ~/.cursor/mcp.json:
If Running Locally
{
"mcpServers": {
"mcp-fredapi": {
"command": "python",
"args": ["/path/to/mcp-fredapi-render/app.py"]
}
}
}If Using Deployed Version
For now, MCP works best with local servers. The deployed version is mainly for hosting/health checks. However, you could potentially create a proxy that connects to your deployed server.
Health Check Endpoints
When deployed on Render, these endpoints are available for monitoring:
GET
/- Root endpoint with service informationGET
/health- Health check endpoint
Testing
Health Check Testing
Test the deployed service health endpoints:
# Test health check
curl https://your-render-app.onrender.com/health
# Test root endpoint
curl https://your-render-app.onrender.com/Local MCP Testing
Run the test suite to verify MCP functionality:
# Run comprehensive test suite
python test_api.pyThis will test:
Health check endpoints (for Render)
Local MCP mode functionality
Direct MCP server communication (if FRED_API_KEY is set)
MCP Usage Examples
When using this server with Cursor or other MCP clients, you can call the get_fred_series_observations tool:
Getting GDP Data
Can you get the latest GDP data from FRED?The MCP client will automatically call:
{
"tool": "get_fred_series_observations",
"arguments": {
"series_id": "GDP"
}
}Getting GDP Data with Parameters
Can you get the last 5 GDP observations in descending order?The MCP client will call:
{
"tool": "get_fred_series_observations",
"arguments": {
"series_id": "GDP",
"limit": 5,
"sort_order": "desc"
}
}Getting Inflation Data
What's the recent monthly inflation rate?The MCP client will call:
{
"tool": "get_fred_series_observations",
"arguments": {
"series_id": "CPIAUCSL",
"units": "pch",
"frequency": "m",
"sort_order": "desc",
"limit": 12
}
}Response Format
The MCP tool returns an array of observations:
[
{
"realtime_start": "2024-01-01",
"realtime_end": "2024-01-01",
"date": "2023-10-01",
"value": "27000.000"
}
]Local Development
Prerequisites
Python 3.9 or higher
FRED API key
Setup
Clone the repository:
git clone <your-repo-url>
cd mcp-fredapi-renderCreate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activateInstall dependencies:
pip install -r requirements.txtCreate a
.envfile:
FRED_API_KEY=your_api_key_hereRun the development server:
python app.pyThe API will be available at http://localhost:8000
API Documentation
Visit http://localhost:8000/docs for interactive API documentation.
Parameters
The API supports all FRED API parameters:
Parameter | Type | Description | Default |
series_id | str | The ID of the economic series | Required |
realtime_start | str | Start of real-time period (YYYY-MM-DD) | None |
realtime_end | str | End of real-time period (YYYY-MM-DD) | None |
limit | int | Maximum number of observations | 10 |
offset | int | Number of observations to skip | 0 |
sort_order | str | Sort order ('asc' or 'desc') | 'asc' |
observation_start | str | Start date of observations (YYYY-MM-DD) | None |
observation_end | str | End date of observations (YYYY-MM-DD) | None |
units | str | Data transformation | 'lin' |
frequency | str | Frequency aggregation | None |
aggregation_method | str | Aggregation method | 'avg' |
output_type | int | Output format (1-4) | 1 |
vintage_dates | str | Comma-separated vintage dates | None |
Common Economic Series IDs
GDP- Gross Domestic ProductUNRATE- Unemployment RateCPIAUCSL- Consumer Price IndexFEDFUNDS- Federal Funds RateDGS10- 10-Year Treasury Constant Maturity RateDEXUSEU- US/Euro Foreign Exchange Rate
Contributing
Contributions are welcome! Please follow these steps:
Fork the repository
Create a feature branch (
git checkout -b feature/amazing-feature)Make your changes
Commit your changes (
git commit -m 'Add amazing feature')Push to the branch (
git push origin feature/amazing-feature)Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
References
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
FRED macro data, Treasury yields, FX rates & macro indicators for AI agents. Pay-per-query via x402.
GDP, unemployment, CPI, interest rates, and 800K+ economic time series from the Federal Reserve
Treasury/FRED financial data over x402: pay-per-call US yields, macro and forex in USDC on Base
Equip AI with tools for researching economic data from Federal Reserve Economic Data (FRED).
Related MCP Servers
- AlicenseBqualityBmaintenanceEnables querying and retrieving Federal Reserve Economic Data (FRED) including series, categories, releases, sources, and tags, with support for stdio and HTTP transports and bring-your-own-key authentication.3184 PyPI2MIT
- AlicenseAqualityDmaintenanceEnables users to search, retrieve, and explore economic data series from the Federal Reserve Economic Data (FRED) API using natural language.11MIT
- AlicenseNot gradedqualityBmaintenanceSearch and fetch ~800K Federal Reserve economic time-series from the FRED API via MCP, with STDIO or Streamable HTTP transport.310 npm1Apache 2.0
- AlicenseNot gradedqualityCmaintenanceEnables natural language access to 800,000+ economic time series from FRED, including GDP, inflation, unemployment, and interest rates, with built-in transforms and frequency aggregation.72 npmMIT