Authentication
Access to the FRED API requires a free API key. This guide covers how to obtain and configure your API key securely.Getting an API Key
Registration Process
1
Create Account
Visit FRED API Registration and create a free account
2
Request API Key
Click “Request API Key” and fill out the brief application form
3
Instant Approval
Your API key will be generated immediately and displayed on screen
4
Save Securely
Store your key securely - you’ll need it for configuration
API keys are completely free with no usage fees. Rate limits apply but are generous for most use cases.
API Key Format
Keys are 32-character alphanumeric strings:Configuration
Environment Variables (Recommended)
The most secure method is using environment variables.- Claude Desktop (macOS)
- Claude Desktop (Windows)
- System Environment
- .env File
Edit
~/Library/Application Support/Claude/claude_desktop_config.json:Verification
Test your configuration:Security Best Practices
Key Protection
Never Commit Keys
Never Commit Keys
❌ Don’t:✅ Do:
Restrict File Permissions
Restrict File Permissions
Limit who can read configuration files:
Use Separate Keys
Use Separate Keys
Create different keys for:
- Development environments
- Production systems
- Different applications
Regular Rotation
Regular Rotation
Periodically generate new keys and update your configuration
Access Control
The FRED MCP Server never:- Logs API keys
- Exposes keys in responses
- Stores keys persistently
- Transmits keys except to FRED API
api.stlouisfed.org.
Rate Limits
FRED API implements rate limiting to ensure fair usage.Current Limits
| Limit Type | Restriction | Notes |
|---|---|---|
| Requests per Minute | 120 | Across all endpoints |
| Series Observations | 40/min | Specific to data retrieval |
| Daily Requests | Varies | Based on account tier |
Handling Rate Limits
The MCP server implements automatic handling:Best Practices
1
Batch Requests
Group related queries to minimize API calls
2
Use Date Ranges
Request only the time periods you need
3
Avoid Unnecessary Requests
Plan queries carefully to minimize redundant API calls
4
Off-Peak Usage
Schedule heavy queries during off-peak hours
Troubleshooting
Common Issues
Authentication Failed (401)
Authentication Failed (401)
Symptoms: “Bad Request. The value for variable api_key is not registered.”Solutions:
- Verify API key is correct (check for typos)
- Ensure environment variable is set
- Restart the MCP server after changing config
- Check key hasn’t been revoked
Rate Limited (429)
Rate Limited (429)
Symptoms: “Too many requests”Solutions:
- Wait 60 seconds before retrying
- Reduce request frequency
- Use date ranges to limit data size
- Use fewer concurrent requests
Environment Variable Not Found
Environment Variable Not Found
Symptoms: Server starts but requests failSolutions:
- Check variable name is exactly
FRED_API_KEY - Verify it’s set in the correct profile file
- Restart terminal/application after setting
- Use absolute paths in configuration
Invalid Response Format
Invalid Response Format
Symptoms: JSON parsing errorsSolutions:
- Verify API key format (32 hex characters)
- Check for special characters in key
- Ensure no whitespace in environment variable
Debug Mode
Enable detailed logging:- Request URLs (with key redacted)
- Response status codes
- Rate limit status
- Error details
Key Management
Regenerating Keys
If your key is compromised:1
Login to FRED Account
Visit your API Keys page
2
Revoke Old Key
Click “Delete” next to the compromised key
3
Generate New Key
Click “Request API Key” to create a replacement
4
Update Configuration
Replace the old key in all your configurations
5
Restart Services
Restart MCP server and any dependent applications
Multiple Keys
You can have multiple API keys:Terms of Use
By using the FRED API, you agree to:Attribution
Credit Federal Reserve Bank of St. Louis and FRED
Non-Commercial
Free for research, education, and personal use
No Resale
Don’t redistribute raw data commercially
Respect Limits
Adhere to rate limits and usage guidelines
For commercial use or higher limits, contact the FRED team directly.