CourtListener MCP Server
Provides general web search capabilities via Brave Search API to supplement legal research with recent developments, practical guidance, and contextual information.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@CourtListener MCP ServerSearch for Supreme Court cases on free speech"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
CourtListener MCP Server
A comprehensive Model Context Protocol (MCP) server for accessing CourtListener's legal database. Provides Claude Desktop with powerful legal research capabilities including court opinions, case dockets, judge profiles, and comprehensive legal analysis.
Features
🏛️ Court Opinion Analysis - Retrieve and analyze court decisions with full text interpretation
📋 Case Docket Information - Complete case timelines, parties, and procedural history
⚖️ Legal Content Analysis - Extract holdings, dispositions, and factual backgrounds
👨⚖️ Judge & People Profiles - Comprehensive biographical, educational, and career data
🗳️ Political & Career Analysis - Political affiliations, ABA ratings, and retention events
💼 Position & Appointment Tracking - Judicial positions, appointment processes, and career timelines
🔍 Advanced Search & Citations - Search across all content types with citation network analysis
📊 Human-Readable Codes - Automatic translation of legal codes to plain English
🔗 Citation & Precedent Analysis - Track case citations and legal precedents
Complete Tool Set
Court Opinions & Case Law
get_opinion- Individual court decisions with full text analysisget_cluster- Grouped opinions (cases with multiple decisions)get_docket- Case information, timelines, and procedural historysearch_legal_cases- Advanced search across all legal contentadvanced_legal_search- Complex filtering and multi-court searches
Judge & People Information
get_judge- Comprehensive judge biographical and career dataget_positions- Judicial and professional position historyget_political_affiliations- Political party history and timelineget_aba_ratings- American Bar Association ratings analysisget_educations- Educational background and degree detailsget_retention_events- Judicial retention votes and reappointmentsget_sources- Data provenance and source tracking
Citation & Legal Analysis
verify_citations- Citation verification and lookup using Eyecitebulk_citation_verification- Batch citation processingfind_authorities_cited- Legal precedents an opinion relies uponfind_citing_opinions- Later cases that cite a specific decisionanalyze_citation_network- Comprehensive precedent network analysis
Courts & Infrastructure
get_court- Court information, jurisdiction, and hierarchy
Project Structure
courtlistener-mcp/
├── courtlistener_server.py # Main MCP server
├── server_factory.py # server factory
├── requirements.txt # Dependencies
├── .env.template # Environment template
├── README.md # Project documentation
├── core/
│ ├── __init__.py
│ └── lifespan.py # Lifecycle management
├── tools/ # All 16 tool implementations
│ ├── __init__.py
│ ├── opinion_tools.py
│ ├── cluster_tools.py
│ ├── docket_tools.py
│ ├── court_tools.py
│ ├── search_tools.py
│ ├── people_tools.py
│ ├── position_tools.py
│ ├── political_affiliation_tools.py
│ ├── aba_ratings_tools.py
│ ├── retention_events_tools.py
│ ├── sources_tools.py
│ ├── education_tools.py
│ ├── citation_tools.py
│ └── opinions_cited_tools.py
├── utils/
│ ├── __init__.py
│ ├── mappings.py # Code mappings
│ └── formatters.py # Output formatting
└── tests/ # Test directory (NEW)
├── __init__.py # Make it a Python package
├── courtlistener_evals.py # Comprehensive evaluation suite
├── mcp_test_runner.py # Practical test runner
├── test_config.sh # Automated test script
├── pytest.ini # Pytest configuration
└── .env.test # Test environment templateInstallation
1. Clone and Setup
# Install MCP framework
pip install mcp
# Install legal database clients
pip install courtlistener-api
pip install brave-search-api2. API Configuration
CourtListener Setup:
# Register for CourtListener API access at: https://www.courtlistener.com/api/
export COURTLISTENER_API_KEY="your_api_key_here"Brave Search Setup:
# Register for Brave Search API at: https://api.search.brave.com/
export BRAVE_SEARCH_API_KEY="your_api_key_here"3. Start MCP Servers
# Start CourtListener MCP Server
python mcp_servers/courtlistener_server.py --port 8000
# Start Brave Search MCP Server
python mcp_servers/brave_server.py --port 80014. Run Training with MCP
python train_with_mcp.py \
--config config/mcp_training.yaml \
--mcp-servers courtlistener,brave \
--output models/mcp_legal_agent_v1/Learning Patterns During Training
Tool Usage Evolution
Early Training (Episodes 1-100):
Random tool selection
Poor query formulation
No strategic sequencing
Mid Training (Episodes 500-1000):
Begins preferring CourtListener for legal precedents
Learns basic jurisdiction targeting
Develops simple search refinement
Advanced Training (Episodes 2000+):
Strategic tool sequencing (CourtListener → Brave for context)
Jurisdiction-aware tool selection
Complex query optimization
Expert Level (Episodes 5000+):
Sophisticated search strategies
Tool coordination patterns
Professional-grade research workflows
Optimal Search Strategy Patterns
Precedent Research:
Search CourtListener for case topic
Search CourtListener for jurisdiction-specific cases
Search Brave for recent developments
Statutory Analysis:
Search Brave for statute text
Search CourtListener for statute interpretation
Search Brave for recent applications
General Consultation:
Search Brave for topic overview
Search CourtListener for relevant cases
Search Brave for practical guidance
Monitoring and Troubleshooting
Health Checks
# Test MCP server connectivity
curl http://localhost:8000/health # CourtListener
curl http://localhost:8001/health # BraveCommon Issues
Connection Problems:
Check API keys are properly set
Verify servers are running on correct ports
Test network connectivity
Rate Limiting:
Monitor API usage quotas
Adjust request frequency if needed
Scale servers for higher throughput
Performance Issues:
Check server response times
Monitor memory usage
Verify database connectivity
Scaling Considerations
High-Traffic Scenarios:
Run multiple MCP server instances
Use load balancers for distribution
Implement connection pooling
Cache frequent queries
Key Benefits of Our MCP Approach
1. Strategic Learning During Training
Agents develop optimal tool sequencing patterns naturally
9-call constraint forces efficient resource utilization
Legal-specific search strategies emerge through reinforcement learning
2. Professional Legal Research Replication
Dual database approach mirrors real legal practice (specialized + general search)
Jurisdiction-aware tool selection develops automatically
Citation network navigation skills learned during training
3. Research Innovation
First implementation of MCP integration during RL training episodes
Reproducible methodology using standardized MCP protocols
Novel training approach for legal AI development
4. Practical Advantages
Cost-effective training through search constraints
Quality-focused rewards for search relevance
Scalable architecture supporting concurrent training
Future MCP Enhancements
Additional Legal Database Integration
Westlaw and Lexis MCP servers
Patent database access
Regulatory database integration
Advanced Search Capabilities
Multi-modal document analysis
Real-time legal news integration
Specialized practice area databases
Performance Optimizations
Intelligent query caching
Predictive search suggestions
Dynamic rate limit management
This MCP integration enables our legal AI agents to develop professional-grade research skills by learning with tools during training, representing a fundamental advancement in legal AI training methodology.
This server cannot be installed
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/UPSD1/courtlistener-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server