# U.S. Government Open Data

Connect an AI agent to U.S. government APIs covering topics from the economy to health and legislation. Useful when a question calls for combining records from multiple agencies.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 113
- Author: lzinga
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/lzinga/us-gov-open-data-mcp
- Updated: 2026-10-13
- HTML: https://affpapa.org/en/nevibecode/mcp/us-government-open-data

## What it does

The server gives an agent tools for querying more than 40 U.S. government APIs. It covers economic indicators, public spending, legislation, health, the environment, and other areas. Built-in guidance helps the model relate information from different agencies, and results include details of the API requests behind them.

Connections can use stdio or HTTP Stream, and large responses can be handled with JavaScript in a WASM sandbox. Load only the modules or domains you need. Node.js 22 or later is required. Claude Code setup passes `DATA_GOV_API_KEY`, `FRED_API_KEY`, `CENSUS_API_KEY`, `BLS_API_KEY`, and `BEA_API_KEY`; some APIs can be queried without a key. Individual endpoints can return unexpected results, so check the cited sources when the details matter.

## Requirements
- Needs: Node.js (commands run via npx)
- Environment variables: `DATA_GOV_API_KEY`, `FRED_API_KEY`, `CENSUS_API_KEY`, `BLS_API_KEY`, `BEA_API_KEY`, `EIA_API_KEY`, `NOAA_API_KEY`, `USDA_NASS_API_KEY`, `HUD_USER_TOKEN`, `DOL_API_KEY` — keys and tokens: ask the human for the values, never commit them or put them in shared files.

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add --env DATA_GOV_API_KEY=<DATA_GOV_API_KEY> --env FRED_API_KEY=<FRED_API_KEY> --env CENSUS_API_KEY=<CENSUS_API_KEY> --env BLS_API_KEY=<BLS_API_KEY> --env BEA_API_KEY=<BEA_API_KEY> --transport stdio us-government-open-data -- npx -y us-gov-open-data-mcp
```
Replace <…> with your own values. 16 more environment variables are in the server README

### Codex

**Platform CLI**
```bash
codex mcp add us-government-open-data --env DATA_GOV_API_KEY=<DATA_GOV_API_KEY> --env FRED_API_KEY=<FRED_API_KEY> --env CENSUS_API_KEY=<CENSUS_API_KEY> --env BLS_API_KEY=<BLS_API_KEY> --env BEA_API_KEY=<BEA_API_KEY> -- npx -y us-gov-open-data-mcp
```
Replace <…> with your own values. 16 more environment variables are in the server README

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "us-government-open-data": {
            "command": "npx",
            "args": [
                "-y",
                "us-gov-open-data-mcp"
            ],
            "env": {
                "DATA_GOV_API_KEY": "<DATA_GOV_API_KEY>",
                "FRED_API_KEY": "<FRED_API_KEY>",
                "CENSUS_API_KEY": "<CENSUS_API_KEY>",
                "BLS_API_KEY": "<BLS_API_KEY>",
                "BEA_API_KEY": "<BEA_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. 16 more environment variables are in the server README

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "us-government-open-data": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "us-gov-open-data-mcp"
            ],
            "env": {
                "DATA_GOV_API_KEY": "<DATA_GOV_API_KEY>",
                "FRED_API_KEY": "<FRED_API_KEY>",
                "CENSUS_API_KEY": "<CENSUS_API_KEY>",
                "BLS_API_KEY": "<BLS_API_KEY>",
                "BEA_API_KEY": "<BEA_API_KEY>"
            }
        }
    }
}
```
Replace <…> with your own values. 16 more environment variables are in the server README

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add -e DATA_GOV_API_KEY=<DATA_GOV_API_KEY> -e FRED_API_KEY=<FRED_API_KEY> -e CENSUS_API_KEY=<CENSUS_API_KEY> -e BLS_API_KEY=<BLS_API_KEY> -e BEA_API_KEY=<BEA_API_KEY> us-government-open-data npx -y us-gov-open-data-mcp
```
Replace <…> with your own values. 16 more environment variables are in the server README

## When to use it
- compare economic indicators from separate government APIs
- look up a bill and examine its vote by party
- review FDA reports alongside clinical-trial records
- trace federal spending in a chosen area
- find lobbying and campaign contribution records

## Example prompts
- Compare U.S. GDP, unemployment, inflation, and interest rates using government data.
- Find information on the Inflation Reduction Act and explain how the vote split by party.
- Compare federal healthcare spending with health outcome data.

## Similar
- [World Monitor](https://affpapa.org/en/nevibecode/mcp/world-monitor.md) — MCP server · ★ 89408
- [Scrapling MCP Server](https://affpapa.org/en/nevibecode/mcp/scrapling-mcp-server.md) — MCP server · ★ 89433
- [MCP Toolbox for Databases](https://affpapa.org/en/nevibecode/mcp/googleapis-mcp-toolbox-for-databases.md) — MCP server · ★ 16717
- [PostHog MCP Server](https://affpapa.org/en/nevibecode/mcp/posthog-mcp-server.md) — MCP server · ★ 40409
- [dbx](https://affpapa.org/en/nevibecode/mcp/dbx.md) — MCP server · ★ 27669
- [Metabase](https://affpapa.org/en/nevibecode/mcp/metabase.md) — MCP server · ★ 49845

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
