U.S. Government Open Data
LocalAbout U.S. Government Open Data
U.S. Government Open Data is an MCP server and TypeScript SDK covering more than 40 U.S. government APIs with over 300 tools. It spans economic, fiscal, health, legislative, energy and disaster data, and more than 20 of the APIs need no key. Each API can also be used as a standalone typed client.
Key features
- 01300+ tools across 40+ government APIs
- 02Selective loading by module or domain
- 03Discovery mode exposing four search tools
- 04Upstream request sources listed in each result
- 05Standalone typed TypeScript SDK
- 06Disk caching with rate limiting and retry
Use cases
- 01Retrieving GDP, unemployment and inflation indicators
- 02Combining FDA adverse events, lobbying and campaign finance data
- 03Searching government data on demand without loading every tool
MCP support
The project runs as an MCP server that exposes tools for each government API to MCP clients, over stdio or HTTP Stream transport.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
npx -y us-gov-open-data-mcpDATA_GOV_API_KEYSecretapi.data.gov key, shared by Congress, FEC, GovInfo, FBI, NREL, Regulations.gov, College Scorecard, USDA FoodData, openFDA and USGS WaterFRED_API_KEYSecretFRED (Federal Reserve Economic Data) API keyCENSUS_API_KEYSecretCensus Bureau API keyBLS_API_KEYSecretBureau of Labor Statistics API key (optional; raises rate limits)BEA_API_KEYSecretBureau of Economic Analysis API keyEIA_API_KEYSecretEnergy Information Administration API keyNOAA_API_KEYSecretNOAA Climate Data Online token (station climate data works without it)USDA_NASS_API_KEYSecretUSDA NASS Quick Stats API keyHUD_USER_TOKENSecretHUD User API tokenDOL_API_KEYSecretDepartment of Labor API keyUSPTO_API_KEYSecretUSPTO Open Data Portal API keyLDA_API_KEYSecretSenate Lobbying Disclosure (lda.gov) API key (optional; raises rate limits)AQS_API_KEYSecretEPA Air Quality System API key (used with AQS_EMAIL)AQS_EMAILEmail address registered for the EPA AQS API keySEC_CONTACT_EMAILYour email for the SEC User-Agent; SEC asks automated tools for a contact and may block requests without oneNWS_USER_AGENTUser-Agent for the National Weather Service API, with your contact details (a default is sent otherwise)MODULESComma-separated modules to load (default: all), e.g. 'fred,bls,treasury'DOMAINSComma-separated domains to load, e.g. 'economy,health' (added to MODULES)HIDE_UNCONFIGUREDSet to 1 to skip modules whose required API key is not setTOOL_MODE'full' (every tool) or 'discovery' (find_tools and call_tool only)MAX_RESPONSE_BYTESLargest tool result in bytes before rows are trimmed (default 150000)Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.
Tools
356Saved tool list · updated 2w ago
| Parameter | Type | Required | Description |
|---|---|---|---|
| year | string | No | Year(s) to fetch. Use 'X' for all, 'LAST5' for last 5, or specific year. Default: LAST5 |
| frequency | enum | No | Frequency: Q=quarterly (default), A=annual, M=monthlyQ | A | M |
| table_name | string | No | NIPA table name (default: T10101 — Real GDP). Other: T10106 (nominal GDP), T10111 (% change), T20100 (personal income) |
Details
From the project READMEUS Government Open Data MCP
MCP Server + TypeScript SDK for 40+ U.S. Government APIs
300+ tools covering economic, fiscal, health, education, energy, environment, lobbying, housing, patents, safety, banking, consumer protection, workplace safety, transportation, seismic, clinical trials, pharma payments, research funding, procurement, and legislative data.
20+ APIs require no key · The rest use free keys that take under a minute to get
Features
- 300+ tools across 40+ government APIs — economic, health, legislative, financial, environmental, and more
- Cross-referencing — built-in instructions guide the LLM to combine data from multiple agencies (e.g., FDA adverse events + lobbying spend + campaign contributions)
- Code mode — WASM-sandboxed JavaScript execution reduces context window usage by 98-100% for large responses
- Selective loading — load only the modules or domains you need:
--modules fred,treasury,congressor--domains economy,health - Discovery mode —
--tool-mode discoverylists 4 tools instead of 350; the model searches for the one it needs - Sources on every result —
meta.sourceslists the upstream API requests behind each answer - Dual transport — stdio for desktop clients, HTTP Stream for web/remote (bearer-token auth off loopback)
- TypeScript SDK — every API is importable as a standalone typed client, no MCP required
- Disk-backed caching — responses cached to disk, survives restarts
- Rate limiting + retry — token-bucket rate limiter with exponential backoff on 429/503
Quick Start
MCP Server
Requires Node.js 22 or later.
npx us-gov-open-data-mcp
Add to .vscode/mcp.json for VS Code / Copilot:
{
"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"
}
}
}
}
Add to claude_desktop_config.json for Claude Desktop:
{
"mcpServers": {
"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"
}
}
}
}
Example Prompts
Once connected, ask your AI assistant natural language questions:
Economic: "What's the current state of the U.S. economy? Show me GDP, unemployment, inflation, and interest rates."
Health: "Show me the adverse event profile for Ozempic including clinical trials, FDA reports, and pharma payments to doctors."
Legislative: "What happened with the Inflation Reduction Act? Who sponsored it, how did the vote break down by party?"
Follow the money: "Which banking PACs gave money to members of the Senate Banking Committee, and how did those members vote on banking deregulation?"
Cross-reference: "How has federal spending on healthcare changed over the last 5 years, and what health outcomes has it produced?"
TypeScript SDK
npm install us-gov-open-data-mcp
import { getObservations } from "us-gov-open-data-mcp/sdk/fred";
import { searchBills } from "us-gov-open-data-mcp/sdk/congress";
const gdp = await getObservations("GDP", { sort: "desc", limit: 5 });
No MCP server required. All functions include caching, retry, and rate limiting.
Documentation
Full documentation at lzinga.github.io/us-gov-open-data-mcp
| Getting Started | MCP setup, SDK install, client configs |
| API Keys | Which APIs need keys, where to get them |
| Data Sources | All 40+ APIs grouped by category |
| API Reference | Auto-generated from TypeScript — every function and type |
| Examples | SDK code, MCP prompts, analysis showcases |
| Architecture | How the system works |
| Adding Modules | Add a new API — just create a folder |
Data Sources
| Category | APIs |
|---|---|
| Economic | Treasury, FRED, BLS, BEA, EIA |
| Legislative | Congress.gov, Federal Register, GovInfo, Regulations.gov |
| Financial | FEC, Senate Lobbying, SEC, FDIC, CFPB |
| Spending & Procurement | USAspending, Open Payments, GSA CALC+ |
| Health & Safety | CDC, FDA, CMS, ClinicalTrials.gov, NIH, NHTSA, DOL |
| Environment & Weather | EPA, EPA AQS, NOAA, NWS, NREL, USGS |
| Justice | FBI Crime Data, DOJ News |
| Education & Research | NAEP, College Scorecard, USPTO |
| Demographics | Census, HUD, FEMA |
| Other | BTS, USDA NASS, USDA FoodData, World Bank |
Disclaimer
This project integrates a significant number of government APIs, many of which have large, complex, or inconsistently documented schemas. AI is used as a tool throughout this project to help parse API documentation, generate type definitions, and scaffold tool implementations — making it possible to cover this much surface area and get people access to government data faster than would otherwise be feasible. While every effort has been made to ensure accuracy, some endpoints may return unexpected results, have incomplete parameter coverage, or behave differently than documented.
This is a community-driven effort — if you find something that's broken or could be improved, please open an issue or submit a PR. Contributions that fix edge cases, improve schema accuracy, or expand coverage are especially welcome. The goal is to make U.S. government data as accessible and reliable as possible, together.
All data is sourced from official U.S. government and international APIs — the server does not generate, modify, or editorialize any data.
License
MIT
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.