法律数据检索 MCP 服务器

CourtListener MCP Server 是一个用于法律数据检索的 MCP 服务,提供卷宗、判例意见、法官、口头辩论音频及 RECAP 文档的搜索和 API 访问能力,适用于法律研究、案件分析与法庭记录查询等场景。

  • by grossir
  • Python
  • 本地部署
  • 1 星标
  • 更新于
在 GitHub 查看 grossir/courtlistener-api-mcp

使用说明

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.