Skip to content

About

A MCP implementation to use the Courtlistener API

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

CourtListener MCP Server

This is a (very basic) Model Context Protocol (MCP) server implementation for the CourtListener API.

Features

  • Specific Tools: Dedicated tools for major endpoints like Dockets, Opinions, People, Audio, and RECAP Documents.
  • Generic Tool: A get_resource tool that allows accessing any endpoint with any supported filter via JSON arguments.
  • General Search: Full-text search capability.

Installation

Once you clone the repo, put this "mcpServers" config into your general settings file. For example, ~/.gemini/settings.json or Claude equivalent

Don't forget to input your token

{
  "mcpServers": {
    "courtlistener-api": {
        "command": "uv",
        "args": [
            "--directory", "{ABSOLUTE_PATH}/courtlistener-api-mcp/",
            "--quiet",
            "run",
            "--with",
            "mcp",
            "--with",
            "requests",
            "python",
            "{ABSOLUTE_PATH}/courtlistener-api-mcp/courtlistener_mcp/main.py"
         ],
         "env": {
           "COURTLISTENER_API_TOKEN": "...", 
           "PYTHONUNBUFFERED": "1"
         }
       }

  }
}

Available Tools

  • search_dockets: Search legal dockets.
  • search_opinions: Search opinion clusters (case law).
  • search_people: Search for judges and other people.
  • search_audio: Search oral argument audio.
  • search_recap_documents: Search PACER documents stored in RECAP.
  • general_search: Perform full-text search across various types.
  • get_resource: Access any endpoint (e.g., financial-disclosures, schools) with custom filters.

Filters

The get_resource tool supports standard Django lookup filters. Common suffixes include:

  • __exact, __iexact: Exact match (case-insensitive for i).
  • __contains, __icontains: substring match.
  • __startswith, __istartswith: prefix match.
  • __gt, __gte: Greater than (or equal).
  • __lt, __lte: Less than (or equal).
  • __range: Range of values.
  • __year, __month, __day: Date parts.

Advanced Filtering & Relations

You can filter by related objects using double underscores (__). For example, when searching for Opinions (Clusters), you can filter by the fields of the associated Docket:

  • docket__docket_number: Filter opinions by the docket number of the case.
  • docket__court: Filter opinions by the court ID (e.g., scotus).

Example JSON filter for get_resource ("clusters"):

{
  "docket__docket_number": "19-123",
  "date_filed__gte": "2020-01-01"
}

This syntax is powerful and allows you to traverse relationships defined in the API.

About

A MCP implementation to use the Courtlistener API

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages