@us-legal-tools/dol-sdk
v0.5.1
Published
TypeScript SDK for the Department of Labor API
Maintainers
Readme
@us-legal-tools/dol-sdk
TypeScript SDK and MCP server for the Department of Labor API.
Installation
npm install @us-legal-tools/dol-sdk
# or
yarn add @us-legal-tools/dol-sdk
# or
bun add @us-legal-tools/dol-sdkUsage
Basic Usage
import { getAgencies, getDatasets, getStatistics } from '@us-legal-tools/dol-sdk';
// Get all DOL agencies
const agencies = await getAgencies();
// Get datasets filtered by agency
const datasets = await getDatasets({
agency: 'BLS',
format: 'json'
});
// Get employment statistics
const stats = await getStatistics('employment', {
startDate: '2024-01-01',
endDate: '2024-12-31'
});With API Key
Set your DOL API key as an environment variable:
export DOL_API_KEY=your-api-key-hereOr configure it programmatically:
import { apiClient } from '@us-legal-tools/dol-sdk';
apiClient.defaults.headers['X-API-Key'] = 'your-api-key-here';MCP Server
This package includes an MCP server for use with Claude Desktop or other MCP clients.
Running the MCP Server
# Using npx
npx @us-legal-tools/dol-sdk
# Or directly
dol-mcp-serverAvailable Tools
getAgencies- List all DOL agenciesgetDatasets- List available datasets with optional filtersgetStatistics- Get labor statistics by category
Development
This SDK is generated from the DOL OpenAPI specification using Orval. To regenerate the SDK:
bun run generate