U.S. Government Open Data

io.github.lzingav2026.10.8更新於 Oct 8, 2026

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

概覽

AI 產生的概覽

讓助理透過 300 多個工具查詢 40 多個美國政府開放資料 API,涵蓋經濟、健康、立法、支出、能源等領域。

功能
提供 300 多個工具,串接 40 多個美國官方與國際 API,涵蓋經濟指標、財政與採購資料、國會與遊說、健康與安全、環境與天氣、教育、專利和人口統計。內建指引鼓勵在一次回答中交叉引用多個機構的資料,每筆結果都會列出其上游 API 請求。WASM 沙箱程式碼模式可執行 JavaScript 以精簡大型回應,選擇性載入或探索模式可減少暴露的工具數量。
適用情境
適合助理需要權威美國公共資料來回答研究、報導、政策或分析類問題,尤其是需要把經濟指標與立法或健康資料結合時。若只是單次查詢、一個 API 呼叫即可解決,則沒有必要安裝。
執行需求
透過 npx 以 stdio 在本機執行,需要 Node.js 22 或更新版本。許多 API 不需要金鑰;其他 API 需要免費金鑰,以環境變數形式提供,例如 FRED_API_KEY、DATA_GOV_API_KEY、CENSUS_API_KEY、BLS_API_KEY、EIA_API_KEY、NOAA_API_KEY 等。AQS_EMAIL、SEC_CONTACT_EMAIL 和 NWS_USER_AGENT 用於識別呼叫者。需要能連線這些政府 API 的網路。
安裝前請注意
此伺服器要求以環境變數提供大量 API 金鑰與權杖,包括 DATA_GOV_API_KEY、FRED_API_KEY、HUD_USER_TOKEN 和 USPTO_API_KEY,應視為機密。它只讀取公開資料,不會寫入、傳送或刪除任何內容,但查詢內容和你設定的聯絡方式會傳送給第三方政府 API。README 提醒部分端點可能傳回非預期或不完整的結果。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 U.S. Government Open Data,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

US Government Open Data MCP

MCP Server + TypeScript SDK for 40+ U.S. Government APIs

[npm version] [npm downloads] [License: MIT]

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.

bash
npx us-gov-open-data-mcp

Add to .vscode/mcp.json for VS Code / Copilot:

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"      }    }  }}

Add to claude_desktop_config.json for Claude Desktop:

json
{  "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

bash
npm install us-gov-open-data-mcp
typescript
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

來源:README.md,提交 06df35c

工具

0
工具後設資料尚未被收錄。

版本歷史

1
  1. v2026.10.8最新Oct 8, 2026