loading…
Search for a command to run...
loading…
An MCP server providing AI agents access to CourtListener's comprehensive legal database, featuring semantic search, hybrid search, citation verification, and r
An MCP server providing AI agents access to CourtListener's comprehensive legal database, featuring semantic search, hybrid search, citation verification, and research tools.
An MCP (Model Context Protocol) server providing AI agents access to CourtListener's comprehensive legal database, featuring semantic search, hybrid search, citation verification, and research tools.
Intended for use with OpenCode and Claude Code via local system storage and runtime. Vibe-coded with Claude Code.
This MCP server is the first to implement CourtListener's semantic search API (released November 2025), enabling natural language legal research with vector embeddings. While other MCP servers exist for CourtListener, they all use traditional keyword-only search.
Key Advantages:
Mission: Developed by DefendTheDisabled to support civil rights litigation and make legal research more accessible through AI-powered tools.
# Clone the repository
git clone https://github.com/DefendTheDisabled/courtlistener-mcp.git
cd courtlistener-mcp
# Install dependencies
pip install -e .
Copy the example environment file:
cp .env.example .env
Edit .env and add your CourtListener API key:
COURTLISTENER_API_KEY=your_api_token_here
Get your free API key at: https://www.courtlistener.com/help/api/rest/
This server currently supports STDIO transport for local MCP clients. Future versions may include HTTP transport for remote access by web-based AI platforms.
Using CLI (Recommended):
opencode mcp add
Follow the prompts:
courtlistenerlocalpython/absolute/path/to/courtlistener-mcp/src/server.pyManual Configuration:
Add to your OpenCode config (~/.config/opencode/opencode.json for global, or opencode.json in project root):
{
"mcp": {
"courtlistener": {
"type": "local",
"command": ["python", "/absolute/path/to/courtlistener-mcp/src/server.py"],
"enabled": true
}
}
}
Notes:
C:/Users/YourName/MCP/courtlistener/src/server.py on Windows).env file in the server directory will be auto-loadedUsing CLI:
claude mcp add courtlistener python /absolute/path/to/courtlistener-mcp/src/server.py
Manual Configuration:
Edit ~/.claude/settings.json:
{
"mcpServers": {
"courtlistener": {
"command": "python",
"args": ["/absolute/path/to/courtlistener-mcp/src/server.py"]
}
}
}
Notes:
.env file in the server directory will be auto-loadedThis server uses STDIO transport and follows the MCP specification.
Current limitation: Local clients only (runs as a child process on your system).
Future plans: We plan to develop an HTTP transport version that can be accessed remotely by web-based AI platforms (Claude web, ChatGPT, etc.) while maintaining security and proper authentication.
| Tool | Description | Use Case |
|---|---|---|
courtlistener_search_cases_semantic |
Natural language case search | "Find cases about prisoners denied medical care" |
courtlistener_search_cases_keyword |
Boolean/fielded search | "deliberate indifference" AND prison |
courtlistener_search_cases_hybrid |
Semantic + required keywords | Best of both: context + precision |
courtlistener_verify_citation |
Validate citations | Verify "429 U.S. 97" exists and get details |
| Tool | Description |
|---|---|
courtlistener_get_case |
Get full case metadata by cluster ID |
courtlistener_get_opinion |
Get complete opinion text with citations |
courtlistener_get_docket |
Get docket information and filing history |
courtlistener_get_citing_cases |
Find all cases that cite a specific opinion |
| Tool | Description |
|---|---|
courtlistener_search_judges |
Search judges by name, court, or appointment info |
courtlistener_search_oral_arguments |
Find oral argument recordings by case |
courtlistener_list_courts |
List all courts in the database |
courtlistener_get_court_info |
Get detailed information about a specific court |
Total: 12 tools providing comprehensive access to CourtListener's legal database.
Query: "prisoners denied medical treatment for serious conditions"
Returns cases semantically related to Eighth Amendment deliberate indifference claims, even if they don't use those exact terms.
Query: "deliberate indifference" AND prison AND medical
Court: ca9 (Ninth Circuit)
Date Range: 2020-2024
Precise Boolean search with field filtering for targeted research.
Query: "prison conditions and medical care violations"
Required Terms: ["Eighth Amendment", "deliberate indifference"]
Semantic understanding of context + guaranteed inclusion of specific legal terms.
Text: "In Estelle v. Gamble, 429 U.S. 97 (1976), the Court held..."
Validates the citation exists, returns full case metadata, and provides CourtListener URLs.
Query: "Sotomayor"
Returns biographical data, appointment history, education, and political affiliation.
Opinion ID: 109561 (Estelle v. Gamble)
Returns all subsequent cases that cite this opinion, essential for checking if a case is still good law.
CourtListener provides 5,000 API requests per hour per authenticated user. The server handles rate limit errors gracefully and provides clear error messages.
All tools support two output formats:
Specify format with the response_format parameter.
Make sure your .env file is in the same directory as server.py and contains:
COURTLISTENER_API_KEY=your_actual_key_here
python --versionpython /path/to/server.pyYou've hit the 5,000 requests/hour limit. Wait an hour or use a different API key for testing.
If the server takes 30+ seconds to start:
CourtListener has 18+ million citations but may not have very recent cases or unpublished opinions. Try:
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest tests/
# Format code
black src/
# Sort imports
isort src/
courtlistener-mcp/
├── src/
│ ├── __init__.py
│ ├── server.py # FastMCP server with tool registration
│ ├── config.py # Environment configuration
│ └── api_client.py # CourtListener API wrapper
├── tests/
│ └── __init__.py # Test suite
├── .env.example # Environment template
├── .gitignore
├── pyproject.toml # Dependencies and metadata
├── README.md
└── LICENSE
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
Areas where help is appreciated:
MIT License - see LICENSE file for details.
Выполни в терминале:
claude mcp add courtlistener-mcp -- npx Query your database in natural language
автор: AnthropicRead-only database access with schema inspection.
автор: modelcontextprotocolInteract with Redis key-value stores.
автор: modelcontextprotocolDatabase interaction and business intelligence capabilities.
автор: modelcontextprotocolНе уверен что выбрать?
Найди свой стек за 60 секунд
Автор?
Embed-бейдж для README
Похожее
Все в категории data