U.S. Government Open Data

السجل الرسمي البيانات وقواعدها

Open data from 40+ U.S. government APIs: economy, spending, Congress, health, energy, disasters

ماذا يمكنك أن تفعل مع U.S. Government Open Data؟

  • 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,congress or --domains economy,health
  • Discovery mode — --tool-mode discovery lists 4 tools instead of 350; the model searches for the one it needs
  • Sources on every result — meta.sources lists 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

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

NPM package us-gov-open-data-mcp
Claude Code
claude mcp add u-s-government-open-data -e 'DATA_GOV_API_KEY=<your data_gov_api_key>' -e 'FRED_API_KEY=<your fred_api_key>' -e 'CENSUS_API_KEY=<your census_api_key>' -e 'BLS_API_KEY=<your bls_api_key>' -e 'BEA_API_KEY=<your bea_api_key>' -e 'EIA_API_KEY=<your eia_api_key>' -e 'NOAA_API_KEY=<your noaa_api_key>' -e 'USDA_NASS_API_KEY=<your usda_nass_api_key>' -e 'HUD_USER_TOKEN=<your hud_user_token>' -e 'DOL_API_KEY=<your dol_api_key>' -e 'USPTO_API_KEY=<your uspto_api_key>' -e 'LDA_API_KEY=<your lda_api_key>' -e 'AQS_API_KEY=<your aqs_api_key>' -e 'AQS_EMAIL=<AQS_EMAIL>' -e 'SEC_CONTACT_EMAIL=<SEC_CONTACT_EMAIL>' -e 'NWS_USER_AGENT=<NWS_USER_AGENT>' -e 'MODULES=<MODULES>' -e 'DOMAINS=<DOMAINS>' -e 'HIDE_UNCONFIGURED=<HIDE_UNCONFIGURED>' -e 'TOOL_MODE=full' -e 'MAX_RESPONSE_BYTES=<MAX_RESPONSE_BYTES>' -- npx -y us-gov-open-data-mcp@2026.10.8
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "u-s-government-open-data": {
            "command": "npx",
            "args": [
                "-y",
                "us-gov-open-data-mcp@2026.10.8"
            ],
            "env": {
                "DATA_GOV_API_KEY": "<your data_gov_api_key>",
                "FRED_API_KEY": "<your fred_api_key>",
                "CENSUS_API_KEY": "<your census_api_key>",
                "BLS_API_KEY": "<your bls_api_key>",
                "BEA_API_KEY": "<your bea_api_key>",
                "EIA_API_KEY": "<your eia_api_key>",
                "NOAA_API_KEY": "<your noaa_api_key>",
                "USDA_NASS_API_KEY": "<your usda_nass_api_key>",
                "HUD_USER_TOKEN": "<your hud_user_token>",
                "DOL_API_KEY": "<your dol_api_key>",
                "USPTO_API_KEY": "<your uspto_api_key>",
                "LDA_API_KEY": "<your lda_api_key>",
                "AQS_API_KEY": "<your aqs_api_key>",
                "AQS_EMAIL": "<AQS_EMAIL>",
                "SEC_CONTACT_EMAIL": "<SEC_CONTACT_EMAIL>",
                "NWS_USER_AGENT": "<NWS_USER_AGENT>",
                "MODULES": "<MODULES>",
                "DOMAINS": "<DOMAINS>",
                "HIDE_UNCONFIGURED": "<HIDE_UNCONFIGURED>",
                "TOOL_MODE": "full",
                "MAX_RESPONSE_BYTES": "<MAX_RESPONSE_BYTES>"
            }
        }
    }
}

متغيرات البيئة

  • DATA_GOV_API_KEY سري api.data.gov key, shared by Congress, FEC, GovInfo, FBI, NREL, Regulations.gov, College Scorecard, USDA FoodData, openFDA and USGS Water
  • FRED_API_KEY سري FRED (Federal Reserve Economic Data) API key
  • CENSUS_API_KEY سري Census Bureau API key
  • BLS_API_KEY سري Bureau of Labor Statistics API key (optional; raises rate limits)
  • BEA_API_KEY سري Bureau of Economic Analysis API key
  • EIA_API_KEY سري Energy Information Administration API key
  • NOAA_API_KEY سري NOAA Climate Data Online token (station climate data works without it)
  • USDA_NASS_API_KEY سري USDA NASS Quick Stats API key
  • HUD_USER_TOKEN سري HUD User API token
  • DOL_API_KEY سري Department of Labor API key
  • USPTO_API_KEY سري USPTO Open Data Portal API key
  • LDA_API_KEY سري Senate Lobbying Disclosure (lda.gov) API key (optional; raises rate limits)
  • AQS_API_KEY سري EPA Air Quality System API key (used with AQS_EMAIL)
  • AQS_EMAIL Email address registered for the EPA AQS API key
  • SEC_CONTACT_EMAIL Your email for the SEC User-Agent; SEC asks automated tools for a contact and may block requests without one
  • NWS_USER_AGENT User-Agent for the National Weather Service API, with your contact details (a default is sent otherwise)
  • MODULES Comma-separated modules to load (default: all), e.g. 'fred,bls,treasury'
  • DOMAINS Comma-separated domains to load, e.g. 'economy,health' (added to MODULES)
  • HIDE_UNCONFIGURED Set to 1 to skip modules whose required API key is not set
  • TOOL_MODE 'full' (every tool) or 'discovery' (find_tools and call_tool only)
  • MAX_RESPONSE_BYTES Largest tool result in bytes before rows are trimmed (default 150000)

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. US Government Open Data MCP
  2. Features
  3. Quick Start
  4. Example Prompts
  5. Documentation
  6. Data Sources
  7. Disclaimer
  8. License

US 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

Getting Started · API Reference · Documentation


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,congress or --domains economy,health
  • Discovery mode — --tool-mode discovery lists 4 tools instead of 350; the model searches for the one it needs
  • Sources on every result — meta.sources lists 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 StartedMCP setup, SDK install, client configs
API KeysWhich APIs need keys, where to get them
Data SourcesAll 40+ APIs grouped by category
API ReferenceAuto-generated from TypeScript — every function and type
ExamplesSDK code, MCP prompts, analysis showcases
ArchitectureHow the system works
Adding ModulesAdd a new API — just create a folder

Data Sources

CategoryAPIs
EconomicTreasury, FRED, BLS, BEA, EIA
LegislativeCongress.gov, Federal Register, GovInfo, Regulations.gov
FinancialFEC, Senate Lobbying, SEC, FDIC, CFPB
Spending & ProcurementUSAspending, Open Payments, GSA CALC+
Health & SafetyCDC, FDA, CMS, ClinicalTrials.gov, NIH, NHTSA, DOL
Environment & WeatherEPA, EPA AQS, NOAA, NWS, NREL, USGS
JusticeFBI Crime Data, DOJ News
Education & ResearchNAEP, College Scorecard, USPTO
DemographicsCensus, HUD, FEMA
OtherBTS, 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

الأسئلة الشائعة

ما هو U.S. Government Open Data؟

Open data from 40+ U.S. government APIs: economy, spending, Congress, health, energy, disasters

كيف أثبّت U.S. Government Open Data؟

يعمل على جهازك. في Claude Code: claude mcp add u-s-government-open-data -e 'DATA_GOV_API_KEY=<your data_gov_api_key>' -e 'FRED_API_KEY=<your fred_api_key>' -e 'CENSUS_API_KEY=<your census_api_key>' -e 'BLS_API_KEY=<your bls_api_key>' -e 'BEA_API_KEY=<your bea_api_key>' -e 'EIA_API_KEY=<your eia_api_key>' -e 'NOAA_API_KEY=<your noaa_api_key>' -e 'USDA_NASS_API_KEY=<your usda_nass_api_key>' -e 'HUD_USER_TOKEN=<your hud_user_token>' -e 'DOL_API_KEY=<your dol_api_key>' -e 'USPTO_API_KEY=<your uspto_api_key>' -e 'LDA_API_KEY=<your lda_api_key>' -e 'AQS_API_KEY=<your aqs_api_key>' -e 'AQS_EMAIL=<AQS_EMAIL>' -e 'SEC_CONTACT_EMAIL=<SEC_CONTACT_EMAIL>' -e 'NWS_USER_AGENT=<NWS_USER_AGENT>' -e 'MODULES=<MODULES>' -e 'DOMAINS=<DOMAINS>' -e 'HIDE_UNCONFIGURED=<HIDE_UNCONFIGURED>' -e 'TOOL_MODE=full' -e 'MAX_RESPONSE_BYTES=<MAX_RESPONSE_BYTES>' -- npx -y us-gov-open-data-mcp@2026.10.8. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج U.S. Government Open Data إلى مفتاح API؟

نعم. يتطلب 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, USPTO_API_KEY, LDA_API_KEY, AQS_API_KEY، وتضبطها في إعداداته.

هل U.S. Government Open Data مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون U.S. Government Open Data؟

ينشره lzinga. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.