A comprehensive TypeScript monorepo containing SDKs and Model Context Protocol (MCP) servers for major U.S. federal legal and regulatory APIs.
This monorepo contains five powerful SDKs for accessing federal legal and government information:
Electronic Code of Federal Regulations (eCFR) SDK
Access the complete, continuously updated digital version of the Code of Federal Regulations (CFR).
- π API Coverage: Full text of all 50 CFR titles
- π Search: Advanced search across all federal regulations
- π Versioning: Access historical versions and track changes
- ποΈ Structure: Navigate hierarchical regulation structure
- π€ MCP Server:
eCFRSDKServer
for AI integration
Federal Register SDK
Access the daily journal of the United States government, including all proposed and final rules, notices, and presidential documents.
- π Documents: Search all documents published since 1994
- ποΈ Agencies: Comprehensive agency information
- π Public Inspection: Access documents before publication
- πΌοΈ Images: Document images and metadata
- π€ MCP Server:
FederalRegisterServer
for AI integration
CourtListener SDK
Access the largest free legal database, containing millions of legal opinions, oral arguments, judges, and more.
- βοΈ Case Law: Millions of legal opinions from federal and state courts
- π¨ββοΈ Judges: Comprehensive judge profiles and biographical data
- ποΈ Oral Arguments: Audio recordings and metadata
- π Citations: Advanced citation lookup and normalization
- πΌ PACER Integration: Access federal court dockets
- π Alerts: Track changes to cases and dockets
- π€ MCP Server:
CourtListenerRESTAPIServer
for AI integration
GovInfo SDK
Access the U.S. Government Publishing Office's official repository for federal government information.
- π Collections: Access to all Congressional, judicial, and executive branch publications
- π Search: Full-text search across all government documents
- π Download: Multiple format options (PDF, XML, HTML, etc.)
- ποΈ Coverage: Bills, laws, regulations, court opinions, and more
- π€ MCP Server:
GovInfoServer
for AI integration
Department of Labor (DOL) SDK
Access comprehensive labor statistics and datasets from the U.S. Department of Labor.
- π Statistics: Employment, wages, inflation, and productivity data
- π Time Series: Historical labor market data
- π Industries: Detailed industry-specific statistics
- πΊοΈ Geography: State and metropolitan area data
- π€ MCP Server:
DOLDataServer
for AI integration
Each SDK can be installed independently from npm:
# eCFR SDK
npm install @beshkenadze/ecfr-sdk
# Federal Register SDK
npm install @beshkenadze/federal-register-sdk
# CourtListener SDK
npm install @beshkenadze/courtlistener-sdk
# GovInfo SDK
npm install @beshkenadze/govinfo-sdk
# DOL SDK
npm install @us-legal-tools/dol-sdk
Or using other package managers:
# Using Bun
bun add @beshkenadze/ecfr-sdk
# Using Yarn
yarn add @beshkenadze/federal-register-sdk
# Using PNPM
pnpm add @beshkenadze/courtlistener-sdk
import { getApiSearchV1Results } from '@beshkenadze/ecfr-sdk';
// Search for regulations about "clean air"
const results = await getApiSearchV1Results({
q: 'clean air',
per_page: 10,
page: 1
});
console.log(`Found ${results.count} regulations`);
results.results.forEach(result => {
console.log(`- ${result.title}: ${result.label_string}`);
});
import { getDocumentsFormat } from '@beshkenadze/federal-register-sdk';
// Search for recent EPA rules
const documents = await getDocumentsFormat({
format: 'json',
conditions: {
agencies: ['environmental-protection-agency'],
type: ['RULE'],
publication_date: {
gte: '2024-01-01'
}
}
});
console.log(`Found ${documents.count} EPA rules in 2024`);
import { getSearch } from '@beshkenadze/courtlistener-sdk';
// Search for Supreme Court cases about free speech
const cases = await getSearch({
type: 'o', // opinions
q: 'free speech',
court: 'scotus',
order_by: 'score desc'
});
console.log(`Found ${cases.count} Supreme Court cases`);
cases.results.forEach(case => {
console.log(`- ${case.caseName} (${case.dateFiled})`);
});
import { createApiClient } from '@beshkenadze/govinfo-sdk';
const client = createApiClient({
headers: {
'X-Api-Key': process.env.GOV_INFO_API_KEY
}
});
// Search for recent legislation
const results = await client.searchPublished({
query: 'infrastructure',
pageSize: 10,
offsetMark: '*',
collection: 'BILLS'
});
console.log(`Found ${results.data.count} bills about infrastructure`);
import { createApiClient } from '@us-legal-tools/dol-sdk';
const client = createApiClient({
headers: {
'X-API-KEY': process.env.DOL_API_KEY
}
});
// Get available datasets
const datasets = await client.getDatasets();
console.log(`Available DOL datasets: ${datasets.data.datasets.length}`);
datasets.data.datasets.forEach(dataset => {
console.log(`- ${dataset.dataset_title}`);
});
Each SDK includes an MCP server that enables AI assistants to interact with these APIs. MCP servers provide a standardized way for AI tools to access external data sources.
# Run eCFR MCP Server
cd packages/ecfr-sdk
bun run mcp:server
# Run Federal Register MCP Server
cd packages/federal-register-sdk
bun run mcp:server
# Run CourtListener MCP Server (requires API token)
cd packages/courtlistener-sdk
COURTLISTENER_API_TOKEN=your-token bun run mcp:server
# Run GovInfo MCP Server (requires API key)
cd packages/govinfo-sdk
GOV_INFO_API_KEY=your-key bun run mcp:server
# Run DOL MCP Server (requires API key)
cd packages/dol-sdk
DOL_API_KEY=your-key bun run mcp:server
Configure your AI assistant (like Claude) to use these MCP servers:
{
"mcpServers": {
"ecfr": {
"command": "bunx",
"args": ["@beshkenadze/ecfr-sdk/mcp"]
},
"federal-register": {
"command": "bunx",
"args": ["@beshkenadze/federal-register-sdk/mcp"]
},
"courtlistener": {
"command": "bunx",
"args": ["@beshkenadze/courtlistener-sdk/mcp"],
"env": {
"COURTLISTENER_API_TOKEN": "your-token"
}
},
"govinfo": {
"command": "bunx",
"args": ["@beshkenadze/govinfo-sdk/mcp"],
"env": {
"GOV_INFO_API_KEY": "your-key"
}
},
"dol": {
"command": "bunx",
"args": ["@us-legal-tools/dol-sdk/mcp"],
"env": {
"DOL_API_KEY": "your-key"
}
}
}
}
Requires an API token from CourtListener. Set via:
- Environment variable:
COURTLISTENER_API_TOKEN
- Or pass directly in API calls
Requires an API key from GovInfo. Set via:
- Environment variable:
GOV_INFO_API_KEY
- Or pass in request headers
Requires an API key from DOL Developer. Set via:
- Environment variable:
DOL_API_KEY
- Or pass in request headers
No authentication required - these are public APIs.
This is a Turborepo monorepo using Bun for package management.
# Clone the repository
git clone https://github.com/beshkenadze/ecfr-sdk.git
cd ecfr-sdk
# Install dependencies
bun install
# Generate all SDKs
turbo generate
# Build all packages
turbo build
# Run tests
turbo test
ecfr-sdk/
βββ packages/
β βββ ecfr-sdk/ # eCFR SDK package
β βββ federal-register-sdk/ # Federal Register SDK package
β βββ courtlistener-sdk/ # CourtListener SDK package
β βββ govinfo-sdk/ # GovInfo SDK package
β βββ dol-sdk/ # Department of Labor SDK package
βββ turbo.json # Turborepo configuration
βββ package.json # Root package.json
βββ README.md # This file
- Create a new package directory:
packages/your-sdk
- Add orval configuration for OpenAPI code generation
- Configure TypeScript and build scripts
- Add to root
tsconfig.json
references - Update this README
- β Full regulation text retrieval
- β Advanced search with faceting
- β Historical version access
- β Hierarchical navigation
- β Citation lookup
- β Recent changes tracking
- β Document search and retrieval
- β Agency information
- β Public inspection documents
- β Presidential documents
- β Document images
- β Suggested searches
- β Opinion full-text search
- β Case metadata and citations
- β Judge biographical data
- β Oral argument audio
- β PACER document access
- β Financial disclosures
- β Docket alerts
- β Citation normalization
Contributions are welcome! Please:
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
MIT License - see LICENSE for details.
Akira Beshkenadze
- GitHub: @beshkenadze
- Free Law Project for CourtListener
- U.S. Government Publishing Office for eCFR and Federal Register APIs
- Anthropic for Model Context Protocol