legal-mcp
A remotely callable MCP server for US legal research that provides tools to search, retrieve, and analyze US case law from the CourtListener API, enabling agents to build evidence packs from primary sources without generating legal content.
README
legal-mcp
A remotely callable MCP server for US legal research. Baseline ("套壳") milestone: a thin, source-agnostic wrapper over CourtListener (the Free Law Project's 9M+ federal and state court opinions — free and public), exposed over the MCP streamable-HTTP transport.
It is deliberately the skeleton the value layers plug into later
(multi-jurisdiction aggregation, full-text retrieval, citation graphs,
freshness monitoring), mirroring the architecture of paper-mcp.
Design discipline
The server returns only primary-source text and citation metadata retrieved from the upstream API. It never lets a model generate legal content — agents build evidence packs they can check and footnote. (Legal hallucination has real sanctions; the server refuses to be the source of one.)
Tools
| Tool | What it does |
|---|---|
search_cases(query, court='', sort_by='relevance') |
Full-text case-law search. |
search_all(query) |
Aggregated search across every configured corpus, de-duplicated and re-ranked with Reciprocal Rank Fusion. |
get_case(doc_id) |
One case's full record (citations, judges, sub-opinion links). |
read_opinion(opinion_id, format='text') |
Full opinion text (text or html). |
lookup_citation(text) |
Resolve reporter citations in free text to real cases. Needs a token. |
get_citation_network(doc_id) |
Authorities a case relies on + how often it is later cited. |
list_recent_cases(court) |
Newest opinions in a court. |
list_courts() |
Common court ids. |
list_legal_sources() |
Available corpora. |
Architecture
legal_mcp/
├── __init__.py version string
├── models.py LegalDoc — normalized, source-agnostic record
├── aggregate.py pure RRF fusion + de-dup (by citation / case name)
├── server.py FastMCP bootstrap + tool registrations
└── sources/
├── base.py LegalSource Protocol (the swappable contract)
├── __init__.py source registry + aliases
└── courtlistener.py CourtListener REST client → LegalDoc
Adding a jurisdiction (CAP, GovInfo, Congress, eCFR, OpenStates) is a new
sources/<name>.py implementing the LegalSource contract plus one line in the
registry — no server change.
Configuration
| Env var | Default | Purpose |
|---|---|---|
LEGAL_MCP_HOST |
127.0.0.1 |
bind host |
LEGAL_MCP_PORT |
9500 |
bind port |
LEGAL_MCP_PATH |
/mcp |
MCP endpoint path |
COURTLISTENER_API_TOKEN |
— | optional; raises rate limits and unlocks lookup_citation |
Run
pip install -e .
legal-mcp # serves streamable-HTTP at 127.0.0.1:9500/mcp
Anonymous access already allows search and document fetch (rate-limited). Set
COURTLISTENER_API_TOKEN for higher limits and citation lookup.
Roadmap
- MVP (this) — CourtListener case law: search, full text, citations.
- Add federal sources — eCFR (regulations), GovInfo (US Code), Congress (bills/votes/members), Federal Register, 26 USC/CFR (tax).
- Add CAP (Harvard) historical 50-state case law, fused with CourtListener.
- Add OpenStates (50-state legislation) for the state layer UK has no analogue for.
- Freshness pipeline — incremental watermark crawl + embeddings (slow data: ~hundreds of new docs/day, <10 min GPU/day).
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.