This is a (very basic) Model Context Protocol (MCP) server implementation for the CourtListener API.
- Specific Tools: Dedicated tools for major endpoints like Dockets, Opinions, People, Audio, and RECAP Documents.
- Generic Tool: A
get_resourcetool that allows accessing any endpoint with any supported filter via JSON arguments. - General Search: Full-text search capability.
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"
}
}
}
}
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.
The get_resource tool supports standard Django lookup filters. Common suffixes include:
__exact,__iexact: Exact match (case-insensitive fori).__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.
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.