A monorepo of typed TypeScript clients for U.S. government data APIs. Each data source is a plugin that shares a common core โ one interface, multiple surfaces (library, CLI, MCP server).
| Source | Status | Endpoints | Description |
|---|---|---|---|
| doge-api | Stable | 5 | DOGE API โ grants, contracts, leases, payments, statistics |
| federal-register | Stable | 9 | Federal Register โ documents, agencies, public inspection, facets |
| dol-open-data-api | Stable | 42 | Dept. of Labor โ MSHA, OSHA, WHD, and 6 other agencies |
| naics-api | Stable | 3 | NAICS code lookup (local SQLite, no HTTP) |
| usaspending-api | Stable | 137 | USAspending.gov โ awards, agencies, spending, recipients, contracts, disaster relief, financial accounts, IDVs, subawards, downloads |
| bls-api | Stable | 3 | Bureau of Labor Statistics โ time series, surveys, popular series |
Not yet started: SEC EDGAR, Census Bureau, EPA, USDA, HHS, FEC, USPTO, data.gov
| Package | Description |
|---|---|
| govdata-core | Shared primitives: HTTP client, response envelope, pagination, plugin interface |
| doge-api | DOGE API plugin |
| federal-register | Federal Register API plugin |
| dol-open-data-api | Dept. of Labor open data API plugin |
| naics-api | NAICS code lookup plugin |
| usaspending-api | USAspending.gov API plugin |
| bls-api | Bureau of Labor Statistics API plugin |
| govdata-cli | Unified CLI binary for all plugins |
| govdata-mcp | Unified MCP server for all plugins |
bun installimport { doge } from "doge-api";
import { fr } from "federal-register";
const grants = await doge.grants({ sort_by: "savings" });
console.log(grants.summary());
const docs = await fr.documents.search({ term: "climate" });
console.log(docs.toMarkdown());See each package's README for full API docs.
# Unified CLI routes by plugin prefix
bun packages/govdata-cli/src/cli.ts doge grants --sort-by savings --per-page 5
bun packages/govdata-cli/src/cli.ts federal-register documents --term climate
bun packages/govdata-cli/src/cli.ts dol get MSHA accident --limit 10
# Standalone CLIs also work
bun packages/doge-api/src/cli.ts grants --sort-by savings{
"mcpServers": {
"govdata": {
"command": "bun",
"args": ["packages/govdata-mcp/src/mcp.ts"]
}
}
}Registers tools for every plugin across all data sources.
- Create
packages/<name>-api/implementingGovDataPluginfromgovdata-core - Add it to the
pluginsarray ingovdata-cliandgovdata-mcp - Add it to the
pluginsarray intests/plugin-contract.test.ts(and other integration tests) - Run
bun testto verify
bun test # all tests (unit + integration)
bun run test:integration # root integration tests
bun run test:core # govdata-core unit tests
bun run test:doge # doge-api unit tests
bun run test:naics # naics-api unit tests
bun run test:dol # dol-open-data-api unit tests
bun run test:fr # federal-register unit tests
bun run test:usaspending # usaspending-api unit tests
bun run test:bls # bls-api unit tests
bun run typecheck # type-check all packagesSee COMPOSITION.md for the full design rationale.
Every data source implements GovDataPlugin:
interface GovDataPlugin {
prefix: string;
describe(): { endpoints: EndpointDescription[] };
endpoints: Record<string, (params?: any) => Promise<GovResult>>;
}The describe() method provides structured metadata that drives CLI flag parsing, MCP schema generation, and documentation. Adding a source means implementing this interface once โ the CLI and MCP server surface it automatically.
Apache-2.0