FRED Macroeconomic Data MCP server

Connects to the FRED API to retrieve real-time economic data series including GDP, employment statistics, inflation metrics, and monetary policy indicators for data-driven analyses and visualizations.
Back to servers
Setup instructions
Provider
Son Hung Nguyen
Release date
Apr 06, 2025
Language
Python
Stats
9 stars

The FRED Macroeconomic Data MCP Server provides access to Federal Reserve Economic Data (FRED) through Claude and other LLM clients. It allows you to search for and retrieve economic indicators like GDP, employment statistics, and inflation data in a format optimized for language models.

Prerequisites

  • Python 3.11 or higher
  • uv - Modern Python package installer
  • Claude Desktop for local usage
  • FRED API Key (get one from FRED API)

Installation

Set Up the Server

  1. Clone the repository:

    git clone https://github.com/yourusername/WM_mcp.git
    cd WM_mcp
    
  2. Create and activate a virtual environment:

    uv venv
    source .venv/bin/activate  # On Windows, use `.venv\Scripts\activate`
    
  3. Install dependencies:

    uv pip install "mcp[cli]>=1.6.0" "colorama>=0.4.6" "numpy>=2.2.4" "pandas>=2.2.3" "python-dotenv>=1.1.0" "requests>=2.32.3"
    
  4. Set up environment variables:

    cp .env.example .env
    
  5. Edit the .env file and add your FRED API key:

    FRED_API_KEY=your_fred_api_key_here
    

Configure Claude Desktop

  1. Make sure Claude Desktop is installed and running

  2. Open Claude Desktop settings by navigating to Settings > Developer > Edit Config

  3. Add the following configuration to your claude_desktop_config.json:

    {
      "mcpServers": {
        "FRED Macroeconomic Data Server": {
          "command": "/path/to/your/.local/bin/uv",
          "args": [
            "--directory",
            "/path/to/your/WM_mcp",
            "run",
            "fred_macroeco_server.py"
          ]
        }
      }
    }
    

    Replace /path/to/your/ with your actual paths. You can find uv's path by running which uv in terminal.

Using FRED Data in Claude

After setting up the MCP server and configuring Claude Desktop:

  1. Start a new conversation in Claude Desktop
  2. Click on the "+" button to add an MCP resource
  3. Select "FRED Macroeconomic Data Server" from the list
  4. You can now ask Claude to work with FRED data in your conversations

Example Prompts

  • "Use FRED APIs to get US GDP data for the last 20 years and create a chart"
  • "Show me inflation trends over the past 5 years using FRED data"
  • "Search for employment-related data series in FRED"

Available Resources and Tools

Resources

  • file://series/available - Lists all available FRED series and their details

Tools

  • fetch_series_data - Retrieves data for any FRED series
  • search_series - Searches for FRED series by description

Troubleshooting

API Key Issues

  • Verify your FRED API key is correctly set in the .env file
  • Check that the .env file is in the correct directory

Server Not Appearing in Claude Desktop

  • Double-check your claude_desktop_config.json paths
  • Ensure uv and all dependencies are installed correctly
  • Try restarting Claude Desktop

Testing the Server

To verify the server is working correctly:

mcp dev fred_macroeco_server.py

This launches the MCP Inspector where you can test resources and tools directly.

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "FRED-Macroeconomic-Data-Server" '{"command":"/path/to/your/.local/bin/uv","args":["--directory","/path/to/your/WM_mcp","run","fred_macroeco_server.py"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "FRED Macroeconomic Data Server": {
            "command": "/path/to/your/.local/bin/uv",
            "args": [
                "--directory",
                "/path/to/your/WM_mcp",
                "run",
                "fred_macroeco_server.py"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "FRED Macroeconomic Data Server": {
            "command": "/path/to/your/.local/bin/uv",
            "args": [
                "--directory",
                "/path/to/your/WM_mcp",
                "run",
                "fred_macroeco_server.py"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later