1. Conduid
  2. Developer Tools
  3. Courtlistener SDK
MCP server · Developer Tools

Courtlistener SDK

TypeScript SDK and MCP server for CourtListener API

42Fair

Scored 6 months ago · breakdown

About Courtlistener SDK

Courtlistener SDK is an MCP server in the Developer Tools category: typeScript SDK and MCP server for CourtListener API.

Install

Claude Code
claude mcp add courtlistener-sdk -- npx -y @us-legal-tools/courtlistener-sdk
npx
npx -y @us-legal-tools/courtlistener-sdk

This server has no ConduID identity, so agent calls to it are not receipted. Pin the version you install and review the source before granting it credentials.

Ask AI

✦

Ask AI about Courtlistener SDK

Powered by Claude · Grounded in docs

I know everything about Courtlistener SDK. Ask me about installation, configuration, usage, or troubleshooting.

Security checks

  • ✓README presentThe repository ships documentation.

5 checks have not been run yet.

README

📑 Table of Contents

🚀 Quick Start

# Install any SDK
npm install @us-legal-tools/ecfr-sdk
npm install @us-legal-tools/federal-register-sdk
npm install @us-legal-tools/courtlistener-sdk
npm install @us-legal-tools/govinfo-sdk
npm install @us-legal-tools/dol-sdk

# Or clone and run locally
git clone https://github.com/beshkenadze/us-legal-tools.git
cd ecfr-sdk
bun install
turbo build

📦 Packages

📚 Key Features

@us-legal-tools/ecfr-sdk - Electronic Code of Federal Regulations

  • Full text of all 50 CFR titles with advanced search
  • Historical versions and change tracking
  • MCP Server: eCFRSDKServer

@us-legal-tools/federal-register-sdk - Federal Register

  • All documents published since 1994 with agency information
  • Public inspection documents before publication
  • MCP Server: FederalRegisterServer

@us-legal-tools/courtlistener-sdk - CourtListener

  • Millions of legal opinions from federal and state courts
  • Judge profiles, oral arguments, PACER integration
  • Citation lookup and docket alerts
  • MCP Server: CourtListenerRESTAPIServer

@us-legal-tools/govinfo-sdk - GovInfo

  • Congressional, judicial, and executive branch publications
  • Full-text search with multiple download formats
  • MCP Server: GovInfoServer

@us-legal-tools/dol-sdk - Department of Labor

  • Employment, wages, inflation, and productivity statistics
  • Industry-specific and geographic data
  • MCP Server: DOLDataServer

📖 Usage Examples

eCFR SDK

import { getApiSearchV1Results } from '@us-legal-tools/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}`);
});

Federal Register SDK

import { getDocumentsFormat } from '@us-legal-tools/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`);

CourtListener SDK

import { getSearch } from '@us-legal-tools/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})`);
});

GovInfo SDK

import { createApiClient } from '@us-legal-tools/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`);

DOL SDK

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}`);
});

🤖 MCP (Model Context Protocol) Servers

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.

Running MCP Servers

# 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

MCP Integration Example

Configure your AI assistant (like Claude) to use these MCP servers:

{
  "mcpServers": {
    "ecfr": {
      "command": "bunx",
      "args": ["@us-legal-tools/ecfr-sdk/mcp"]
    },
    "federal-register": {
      "command": "bunx", 
      "args": ["@us-legal-tools/federal-register-sdk/mcp"]
    },
    "courtlistener": {
      "command": "bunx",
      "args": ["@us-legal-tools/courtlistener-sdk/mcp"],
      "env": {
        "COURTLISTENER_API_TOKEN": "your-token"
      }
    },
    "govinfo": {
      "command": "bunx",
      "args": ["@us-legal-tools/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"
      }
    }
  }
}

🔑 Authentication

CourtListener API

Requires an API token from CourtListener. Set via:

  • Environment variable: COURTLISTENER_API_TOKEN
  • Or pass directly in API calls

GovInfo API

Requires an API key from GovInfo. Set via:

  • Environment variable: GOV_INFO_API_KEY
  • Or pass in request headers

DOL API

Requires an API key from DOL Developer. Set via:

  • Environment variable: DOL_API_KEY
  • Or pass in request headers

eCFR & Federal Register APIs

No authentication required - these are public APIs.

🛠️ Development

This is a Turborepo monorepo using Bun for package management.

Setup

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

# Install dependencies
bun install

# Generate all SDKs
turbo generate

# Build all packages
turbo build

# Run tests
turbo test

Project Structure

ecfr-sdk/
├── packages/
│   ├── ecfr-sdk/              # eCFR SDK
│   ├── federal-register-sdk/  # Federal Register SDK
│   ├── courtlistener-sdk/     # CourtListener SDK
│   ├── govinfo-sdk/           # GovInfo SDK
│   ├── dol-sdk/               # Department of Labor SDK
│   └── tsconfig/              # Shared TypeScript configs
├── turbo.json                 # Turborepo configuration
├── package.json               # Root package.json
├── biome.json                 # Code formatter/linter config
├── tsconfig.json              # Root TypeScript config
└── README.md                  # This file

Adding a New SDK

  1. Create a new package directory: packages/your-sdk
  2. Add orval configuration for OpenAPI code generation
  3. Configure TypeScript and build scripts
  4. Add to root tsconfig.json references
  5. Update this README

📋 Commands

# Install dependencies
bun install

# Generate all SDKs from OpenAPI specs
turbo generate

# Build all packages
turbo build

# Run tests
turbo test
turbo test:integration
turbo test:e2e

# Format and lint
turbo format
turbo lint

Working with Packages

# Run a specific package's command
turbo run build --filter=@us-legal-tools/ecfr-sdk

# Work on a specific package
cd packages/ecfr-sdk
bun test

🤝 Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

📄 License

MIT License - see LICENSE for details.

🔗 Resources

API Documentation

Websites

MCP Resources

👤 Author

Aleksandr Beshkenadze beshkenadze@gmail.com


Built with ❤️ using Turborepo, Bun, and Orval

README copy captured when this server was indexed; it may lag the repository. The original is authoritative.

Questions

About Courtlistener SDK

How do I install Courtlistener SDK?

Run claude mcp add courtlistener-sdk -- npx -y @us-legal-tools/courtlistener-sdk, then add the server to your MCP client's configuration.

Is Courtlistener SDK safe to use with an AI agent?

Its trust score is 42 out of 100 (fair). It passes 1 of the 1 static security checks run so far. It has no ConduID identity yet, so agent calls to it are not receipted.

Is Courtlistener SDK still maintained?

Conduid hasn't recorded a commit date for this repository yet. Check the repository directly for recent activity.