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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@us-legal-tools/govinfo-sdk

v0.5.2

Published

TypeScript SDK and MCP server for the GovInfo API

Readme

@us-legal-tools/govinfo-sdk

TypeScript SDK and MCP server for the GovInfo API - providing programmatic access to federal government information from the U.S. Government Publishing Office.

Installation

npm install @us-legal-tools/govinfo-sdk
# or
yarn add @us-legal-tools/govinfo-sdk
# or
bun add @us-legal-tools/govinfo-sdk

Features

  • 🚀 Full TypeScript support with auto-generated types
  • 📦 Lightweight and tree-shakeable
  • 🔧 Built on top of Axios for reliable HTTP requests
  • 🤖 MCP (Model Context Protocol) server included
  • ⚡ Support for all GovInfo API endpoints
  • 🛡️ Type-safe request and response handling

Quick Start

import { createGovInfoClient } from '@us-legal-tools/govinfo-sdk';

// Initialize the client
const client = createGovInfoClient({
  apiKey: 'YOUR_API_KEY', // Get from https://api.data.gov/signup/
});

// Example: Search for documents
const searchResults = await client.search({
  query: 'climate change',
  pageSize: 10,
});

API Client Usage

Configuration

import { createGovInfoClient } from '@us-legal-tools/govinfo-sdk';

const client = createGovInfoClient({
  apiKey: 'YOUR_API_KEY',
  baseURL: 'https://api.govinfo.gov', // Optional, this is the default
  timeout: 30000, // Optional timeout in ms
});

Available Methods

The SDK provides methods for all GovInfo API endpoints. Methods will be auto-generated based on the OpenAPI specification.

MCP Server

The package includes an MCP server that can be used with Claude Desktop or other MCP-compatible applications.

Configuration

Add to your Claude Desktop configuration:

{
  "mcpServers": {
    "govinfo": {
      "command": "npx",
      "args": ["@us-legal-tools/govinfo-sdk/mcp"],
      "env": {
        "GOVINFO_API_KEY": "YOUR_API_KEY"
      }
    }
  }
}

Available Tools

The MCP server exposes GovInfo API operations as tools that can be called by Claude or other MCP clients. Each API endpoint becomes a callable tool with appropriate parameters.

Development

Building from Source

# Clone the repository
git clone https://github.com/beshkenadze/us-legal-tools.git
cd ecfr-sdk/packages/govinfo-sdk

# Install dependencies
bun install

# Generate SDK from OpenAPI spec
bun run generate

# Build the package
bun run build

# Run tests
bun test

Testing

The test suite requires a GovInfo API key. You can obtain one for free at https://api.data.gov/signup/.

# Set your API key in the environment
export GOV_INFO_API_KEY=your_api_key_here

# Or create a .env file in the project root
echo "GOV_INFO_API_KEY=your_api_key_here" >> ../../.env

# Run all tests
bun test

# Run e2e tests specifically
bun run test:e2e

Scripts

  • bun run generate - Download OpenAPI spec and generate SDK code
  • bun run build - Build the package for distribution
  • bun run test - Run unit tests
  • bun run test:integration - Run integration tests
  • bun run mcp:server - Run the MCP server locally

API Documentation

For detailed API documentation, visit:

Links