npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@beshkenadze/federal-register-sdk

v0.2.0

Published

TypeScript SDK and MCP server for the Federal Register API

Downloads

8

Readme

@beshkenadze/federal-register-sdk

TypeScript SDK and MCP (Model Context Protocol) server for the Federal Register API.

npm version License: MIT

Features

  • 📄 Document Access - Search and retrieve all Federal Register documents since 1994
  • 🏛️ Agency Data - Complete information about federal agencies
  • 📋 Public Inspection - Access documents before official publication
  • 🖼️ Document Images - Retrieve document images and metadata
  • 🤖 MCP Server - AI-ready server for integration with Claude and other AI assistants
  • 🔍 Advanced Search - Powerful search with faceting and filtering
  • Type-safe - Full TypeScript support with auto-completion

Installation

# npm
npm install @beshkenadze/federal-register-sdk

# yarn
yarn add @beshkenadze/federal-register-sdk

# pnpm
pnpm add @beshkenadze/federal-register-sdk

# bun
bun add @beshkenadze/federal-register-sdk

Quick Start

Basic Usage

import { getDocumentsFormat, getAgencies } from '@beshkenadze/federal-register-sdk';

// Search for documents
const documents = await getDocumentsFormat({
  format: 'json',
  per_page: 10,
  conditions: {
    term: 'climate change'
  }
});

console.log(`Found ${documents.count} documents`);
documents.results.forEach(doc => {
  console.log(`- ${doc.title} (${doc.publication_date})`);
});

// Get all agencies
const agencies = await getAgencies();
console.log(`Total agencies: ${agencies.length}`);

Advanced Search

import { getDocumentsFormat } from '@beshkenadze/federal-register-sdk';

// Search with multiple filters
const results = await getDocumentsFormat({
  format: 'json',
  conditions: {
    agencies: ['environmental-protection-agency', 'energy-department'],
    type: ['RULE', 'PRORULE'],
    publication_date: {
      gte: '2024-01-01',
      lte: '2024-12-31'
    },
    significant: '1'
  },
  order: 'newest',
  per_page: 20
});

// Access facets for refinement
console.log('Available facets:', results.aggregations);

Document Details

import { getDocumentsDocumentNumberFormat } from '@beshkenadze/federal-register-sdk';

// Get a specific document
const document = await getDocumentsDocumentNumberFormat({
  documentNumber: '2024-12345',
  format: 'json'
});

console.log(`Title: ${document.title}`);
console.log(`Agency: ${document.agencies.map(a => a.name).join(', ')}`);
console.log(`Published: ${document.publication_date}`);
console.log(`PDF URL: ${document.pdf_url}`);

Public Inspection Documents

import { getPublicInspectionDocumentsCurrentFormat } from '@beshkenadze/federal-register-sdk';

// Get current public inspection documents
const piDocuments = await getPublicInspectionDocumentsCurrentFormat({
  format: 'json'
});

console.log('Documents on public inspection:');
piDocuments.results.forEach(doc => {
  console.log(`- ${doc.title} (Filing date: ${doc.filing_date})`);
});

API Reference

Document Endpoints

  • getDocumentsFormat - Search all documents
  • getDocumentsDocumentNumberFormat - Get a specific document
  • getDocumentsDocumentNumbersFormat - Get multiple documents by number
  • getDocumentsFacetsFacet - Get document counts by facet

Public Inspection Endpoints

  • getPublicInspectionDocumentsFormat - Search public inspection documents
  • getPublicInspectionDocumentsCurrentFormat - Get current PI documents
  • getPublicInspectionDocumentsDocumentNumberFormat - Get specific PI document

Agency Endpoints

  • getAgencies - Get all agencies
  • getAgenciesSlug - Get specific agency details

Other Endpoints

  • getIssuesPublicationDateFormat - Get table of contents for a date
  • getImagesIdentifier - Get image metadata
  • getSuggestedSearches - Get suggested searches

MCP Server

The MCP server allows AI assistants to interact with the Federal Register API.

Running the Server

# Using the SDK directly
npx @beshkenadze/federal-register-sdk/mcp

# Or if installed locally
cd node_modules/@beshkenadze/federal-register-sdk
npm run mcp:server

Integration with Claude

Add to your Claude configuration:

{
  "mcpServers": {
    "federal-register": {
      "command": "npx",
      "args": ["@beshkenadze/federal-register-sdk/mcp"]
    }
  }
}

Document Types

The API supports these document types:

  • RULE - Final rules
  • PRORULE - Proposed rules
  • NOTICE - Notices
  • PRESDOCU - Presidential documents

Date Formats

Dates should be provided in ISO format (YYYY-MM-DD):

const results = await getDocumentsFormat({
  format: 'json',
  conditions: {
    publication_date: {
      gte: '2024-01-01',
      lte: '2024-12-31'
    }
  }
});

Error Handling

import { getDocumentsFormat } from '@beshkenadze/federal-register-sdk';

try {
  const results = await getDocumentsFormat({
    format: 'json',
    per_page: 10
  });
} catch (error) {
  if (error.response?.status === 400) {
    console.error('Invalid request parameters');
  } else if (error.response?.status === 429) {
    console.error('Rate limit exceeded');
  } else {
    console.error('API error:', error.message);
  }
}

Rate Limiting

The Federal Register API has rate limits. The SDK automatically includes appropriate headers, but be mindful of making too many requests in a short period.

License

MIT License - see LICENSE for details

Links