Submit

US Government Open Data MCP

@Lzinga

MCP server with 188 tools for 36 U.S. government APIs. Access Treasury, FRED, Congress, FDA, CDC, FEC, lobbying disclosures, SEC, USGS, and many more. Cross-references data automatically across sources. 18 APIs need no key.
Overview

US Government Open Data MCP

An MCP server + TypeScript SDK for 37 U.S. government and international data APIs — 198 tools covering economic, fiscal, health, education, energy, environment, lobbying, housing, patents, safety, banking, consumer protection, workplace safety, transportation, seismic, clinical trials, pharma payments, and legislative data.

Works with any MCP client (VS Code Copilot, Claude Desktop, Cursor) via stdio or HTTP Stream. Supports selective module loading and standalone SDK imports for use without MCP.

Built with FastMCP. Disk-cached, rate-limited, retries with backoff.

I did collapse all older commits into a single commit hence the large initial commit. This was to consolidate as well as get rid of many old files that were no longer relevant to the project when I made it public.

Data Sources

APIWhat it coversAuth
Treasury Fiscal Data53 datasets, 181 endpoints: national debt, revenue, spending, interest rates, exchange rates, gold reservesNone
FRED800K+ economic time series: GDP, CPI, unemployment, interest rates, money supply, housing, S&P 500FRED_API_KEY
BLSEmployment by industry, wages, CPI by component, PPI, JOLTS, labor productivityBLS_API_KEY (optional)
BEAState GDP, GDP by industry, personal income by state, national accounts (NIPA)BEA_API_KEY
EIAPetroleum, electricity, natural gas prices; state energy profilesEIA_API_KEY
Census BureauPopulation, demographics, income, housing from ACS and Decennial CensusCENSUS_API_KEY
OpenFECCampaign finance: candidates, committees, contributions, expendituresDATA_GOV_API_KEY
Congress.govBills, members, laws, amendments, House & Senate roll call votes (1990+)DATA_GOV_API_KEY
Federal RegisterExecutive orders, presidential documents, rules, agency notices, document detail, 470+ agency directoryNone
USAspendingFederal contracts, grants, loans — $6T+ annually by agency, recipient, stateNone
SEC EDGARCompany filings, XBRL financials, full-text searchSEC_CONTACT_EMAIL
FBI Crime DataCrime statistics by state, national estimates, arrestsDATA_GOV_API_KEY
GovInfoFull text of bills, laws, CBO reports, Federal RegisterDATA_GOV_API_KEY
NOAA ClimateWeather observations, temperature, precipitation from U.S. stationsNOAA_API_KEY
USDA NASSCrop production, livestock, farm prices, Census of AgricultureUSDA_NASS_API_KEY
World BankInternational indicators: GDP, population, health spending for 200+ countriesNone
CDC Health DataLeading causes of death, life expectancy, mortality rates, county/city health indicators (PLACES), drug overdose, obesity, disability, birth indicators, weekly death surveillance, COVID-19 — 13 tools across 12 datasetsNone
NAEP (Nation's Report Card)Reading, math, science test scores by state, grade, race, gender, poverty — the gold standard for U.S. education measurementNone
College ScorecardCollege costs, graduation rates, post-graduation earnings, student debt, admission rates for every U.S. collegeDATA_GOV_API_KEY
NREL (Clean Energy)EV charging stations, alt fuel infrastructure, electricity rates, solar resource dataDATA_GOV_API_KEY
FDA (OpenFDA)Drug adverse events (20M+ reports), drug recalls, FDA-approved drugs (Drugs@FDA), drug labels, food recalls, food adverse events (CAERS), medical device events, device recalls — 8 toolsNone
EPAAir quality data, facility compliance/violations, UV index forecastsNone
Senate Lobbying DisclosuresLobbying filings, expenditures by issue, campaign contributions, individual lobbyist search — follow the moneyNone
Regulations.govFederal rulemaking: proposed rules, final rules, public comments, regulatory docketsDATA_GOV_API_KEY
USDA FoodData CentralNutritional data for 300K+ foods: calories, macros, vitamins, minerals for branded and reference foodsDATA_GOV_API_KEY
FEMADisaster declarations, housing assistance, public assistance, NFIP flood claims, hazard mitigationNone
NHTSAVehicle safety recalls, consumer complaints, NCAP 5-star safety ratings, VIN decoding, make/model lookupNone
CMS Provider DataHospital quality ratings, nursing home inspections, home health, hospice, dialysis facility dataNone
HUDFair Market Rents by bedroom count, income limits by household size, county/metro area housing dataHUD_USER_TOKEN
USPTO PatentsViewU.S. patent search by keyword, assignee, inventor, CPC class; inventor and assignee lookupNone
CFPBConsumer complaint database: 13M+ complaints against financial companies, searchable by company/product/state/issue with trend analysisNone
FDICBank data: 5,000+ insured institutions, failures since 1934, quarterly financials, branch deposits, merger historyNone
DOLOSHA inspections/violations/accidents, WHD wage theft enforcement, weekly unemployment insurance claims (national + state)DOL_API_KEY
Open PaymentsCMS Sunshine Act data: 15M+ payments/year from pharma/device companies to doctors. Search by company, doctor, state, specialtyNone
USGSEarthquake events (magnitude, location, depth, tsunami risk), water resources monitoring (real-time and daily historical streamflow, water levels) from 13,000+ stationsNone
ClinicalTrials.gov400K+ clinical trials: search by condition, drug, sponsor, phase, status, location. Track pharma drug pipelinesNone
BTSBureau of Transportation Statistics: monthly transport stats (airline traffic, transit, rail, safety, fuel), border crossings at U.S. ports of entryNone

Quick Start

npx us-gov-open-data-mcp

VS Code / Copilot

Add to .vscode/mcp.json:

{
  "servers": {
    "us-gov-open-data": {
      "command": "npx",
      "args": ["-y", "us-gov-open-data-mcp"],
      "env": {
        "FRED_API_KEY": "your_key",
        "DATA_GOV_API_KEY": "your_key"
      }
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "us-gov-open-data": {
      "command": "npx",
      "args": ["-y", "us-gov-open-data-mcp"],
      "env": {
        "FRED_API_KEY": "your_key"
      }
    }
  }
}

HTTP Stream (for web apps, remote access)

# Start on port 8080
node dist/server.js --transport httpStream --port 8080

# Or via npm script
npm run start:http

The HTTP Stream endpoint will be at http://localhost:8080/mcp. Works with any MCP client that supports HTTP transport.

Selective Module Loading

Load only the modules you need for faster startup and smaller tool lists:

# Via CLI flag
node dist/server.js --modules fred,treasury,congress

# Via environment variable
MODULES=fred,bls,treasury node dist/server.js

# Combine with HTTP transport
node dist/server.js --modules fred,treasury --transport httpStream --port 8080

Available module names: treasury, fred, bls, bea, eia, census, fec, congress, federal-register, usaspending, sec, fbi, govinfo, noaa, usda-nass, world-bank, cdc, naep, college-scorecard, nrel, fda, epa, senate-lobbying, regulations, usda-fooddata, fema, nhtsa, cms, hud, uspto, cfpb, fdic, dol, usgs, clinical-trials, bts, open-payments

API Keys

19 APIs require no key at all (Treasury, Federal Register, USAspending, World Bank, CDC, FDA, EPA, NAEP, Senate Lobbying, FEMA, NHTSA, CMS, USPTO, CFPB, FDIC, USGS, ClinicalTrials.gov, BTS, Open Payments). The rest need free keys — most take under a minute to get:

KeyWhere to get itUsed by
DATA_GOV_API_KEYapi.data.gov/signupCongress, FEC, FBI, GovInfo, College Scorecard, NREL, Regulations.gov, USDA FoodData
FRED_API_KEYfredaccount.stlouisfed.org/apikeysFRED
CENSUS_API_KEYapi.census.gov/data/key_signup.htmlCensus
BLS_API_KEYbls.gov/developersBLS (optional — works without, higher limits with)
BEA_API_KEYapps.bea.gov/API/signupBEA
EIA_API_KEYeia.gov/opendata/register.phpEIA
NOAA_API_KEYncei.noaa.gov/cdo-web/tokenNOAA
USDA_NASS_API_KEYquickstats.nass.usda.gov/apiUSDA NASS
HUD_USER_TOKENhuduser.gov/hudapi/public/registerHUD
SEC_CONTACT_EMAILAny valid emailSEC EDGAR
DOL_API_KEYdata.dol.gov/registrationDOL (OSHA, WHD, UI Claims)

Set keys via environment variables or a .env file in the project root.

Using as a TypeScript SDK

Every API is importable as a standalone typed client — no MCP server required:

// Individual module imports
import { getObservations } from "us-gov-open-data-mcp/sdk/fred";
import { getIndicator } from "us-gov-open-data-mcp/sdk/world-bank";
import { getLeadingCausesOfDeath } from "us-gov-open-data-mcp/sdk/cdc";
import { searchBills } from "us-gov-open-data-mcp/sdk/congress";

// Or barrel import everything
import * as sdk from "us-gov-open-data-mcp/sdk";
const gdp = await sdk.fred.getObservations("GDP", { sort: "desc", limit: 5 });
// FRED
const gdp = await getObservations("GDP", { sort: "desc", limit: 5 });
console.log(gdp.observations); // [{ date: "2025-10-01", value: "31490.07" }, ...]

// World Bank — compare U.S. to Germany
const health = await getIndicator("SH.XPD.CHEX.PC.CD", { country: "US;DE", dateRange: "2015:2023" });

// CDC
const deaths = await getLeadingCausesOfDeath({ state: "California", year: 2017 });

All SDK functions include disk-backed caching, retry with exponential backoff, and token-bucket rate limiting. See docs/sdk.md for the full API reference.

Architecture

src/
  client.ts              # createClient() factory — cache, retry, rate-limit
  server.ts              # FastMCP bootstrap — stdio + HTTP, selective loading
  instructions.ts        # Cross-referencing guide for MCP clients
  sdk/
    index.ts             # Barrel export for all SDK modules
    fred.ts, bls.ts, ... # Typed API clients (no MCP dependency)
  modules/
    fred.ts, bls.ts, ... # MCP tool definitions + metadata

Each API is 2 files:

  • sdk/*.ts — typed async functions, usable anywhere (no MCP/Zod dependency)
  • modules/*.ts — MCP tool definitions wrapping the SDK, with metadata for client instructions

Adding a new API: create sdk/new-api.ts + modules/new-api.ts, add 2 lines to server.ts. See docs/adding-modules.md.

Documentation

Disclaimer

This project was built with the assistance of AI tools. All data is sourced from official U.S. government and international APIs — the server does not generate, modify, or editorialize any data. It returns raw results from federal databases exactly as provided.

Important:

  • Data accuracy depends on the upstream government APIs. Numbers may lag days to years behind reality depending on the source.
  • Correlation does not imply causation. Cross-referencing data sources (e.g., campaign finance + legislative votes) shows documented patterns, not proven cause-and-effect.
  • This tool is for research and informational purposes. It is not legal, financial, medical, or policy advice.
  • API rate limits and availability vary. Some endpoints may be temporarily unavailable or return incomplete data.
  • The example analyses in the examples/ folder demonstrate the server's capabilities and should not be treated as investigative conclusions.

License

MIT

Server Config

{
  "command": "npx",
  "args": [
    "-y",
    "us-gov-open-data-mcp"
  ],
  "env": {
    "DATA_GOV_API_KEY": "",
    "FRED_API_KEY": "",
    "CENSUS_API_KEY": "",
    "BEA_API_KEY": "",
    "EIA_API_KEY": "",
    "BLS_API_KEY": "",
    "NOAA_API_KEY": "",
    "USDA_NASS_API_KEY": "",
    "HUD_USER_TOKEN": "",
    "SEC_CONTACT_EMAIL": "",
    "DOL_API_KEY": ""
  }
}
© 2025 MCP.so. All rights reserved.

Build with ShipAny.