court-records-search
README.md
# Court Records Search — MCP Server
I work with federal court records, so I built the search I
wanted and could not find: type a company name and see where
that company shows up in federal court, as plaintiff or
defendant, in what kind of lawsuit, and whether the case is
open or terminated. No account, no key, nothing to configure.
The records sit in a local SQLite store and every answer comes
from that store.
**Free sample bundled: 18,475 records · one court · filed
1982 to 2026.** The full dataset I hold runs to **5,217,638
company case records** across the federal courts; this
repository ships the sample so you can run the real search
before anything else.
## Tools
| Tool | What it does |
|---|---|
| `search_records(company_name, role, status, nature_of_suit, filed_from, filed_to, limit)` | Search the bundled records. Every filter is optional and they combine. `company_name` is a substring match, `role` is plaintiff or defendant, `status` is terminated or open_or_unknown, `nature_of_suit` matches the federal nature of suit label, and the two date filters bound the filing date. Returns the match count and the newest matches. |
| `get_record(record_id)` | One record in full: company, role, court, docket id, filing and termination dates, status, nature of suit, and whether an outcome is recorded. |
| `dataset_stats()` | What the bundled sample covers, counted from the store itself: totals, the court, the date range, counts by status and role, and the top natures of suit. |
Every result is a real case record: the company as named in
the filing, its role in the case, the court, the docket id,
and the dates the case was filed and terminated.
## What the sample covers
The sample is every record I hold for one court, the United
States District Court for the Western District of North
Carolina, copied field for field:
| | |
|---|---|
| Records | 18,475 |
| Filed | 1982-12-28 to 2026-09-25 |
| Distinct companies | 11,091 |
| Terminated | 16,021 |
| Open or unknown | 2,454 |
| As defendant | 13,273 |
| As plaintiff | 5,202 |
| With an outcome recorded | 9,178 |
The most common natures of suit in the sample are contract
actions (1,369 records under Contract: Other and 1,035 under
190 Other contract actions), civil rights jobs cases (736),
asbestos personal injury (689), and insurance (531).
## Run it
1. Install the one dependency, the official Python MCP SDK:
```bash
pip install -r requirements.txt
```
2. Start the server over stdio, the default transport:
```bash
python3 mcp_server.py
```
3. Point your MCP client at that command. There is no API key
and no setup step. For a hosted setup, the HTTP transport
answers on `/mcp` and serves a plain `GET /health`:
```bash
python3 mcp_server.py --transport streamable-http --port 8797
```
The store path defaults to `data/sample.db` next to the
server file. Set `COURT_RECORDS_DB` to point at a larger
store with the same schema. `build_sample.py` is the exact
script that cut this sample from the full dataset, so the
slice is reproducible. Tests:
`python3 -m unittest discover -s tests -v`.
## Worked example
Asking for court records with "Carolina" in the company name,
three at a time:
```json
{"count": 344, "limit": 3,
"sample_court": "District Court, W.D. North Carolina",
"results": [
{"id": 15397,
"company_name": "North Carolina Department of Health and Human Services",
"role": "defendant",
"docket_id": "74652292",
"date_filed": "2026-08-14",
"date_terminated": "",
"status": "open_or_unknown",
"nature_of_suit": "440 Civil Rights: Other",
"has_outcome": false},
{"id": 15437,
"company_name": "Riverstreet Communications of North Carolina, Inc.",
"role": "defendant",
"docket_id": "74637953",
"date_filed": "2026-08-12",
"status": "open_or_unknown",
"nature_of_suit": "150 Contract: Recovery/Enforcement",
"has_outcome": false}
]}
```
## Honest limits
- **The sample is one court.** Searches answer from the
Western District of North Carolina only, and the tools say
so in every response. A company with no record here may
still have cases in other courts in the full dataset.
- **Open or unknown is a data statement, not a legal one.**
It means the record carries no termination date. It does
not promise the case is still active today.
- **Nature of suit is blank on 3,182 of the 18,475 records.**
Those records still search by company, role, status, and
date; they simply carry no nature of suit label.
- **Names are as filed.** The same company can appear under
several spellings, and a substring search finds the
spellings that contain your text, nothing smarter.
- **This is a snapshot.** The dataset is compiled from public
federal court data on a cycle, not a live docket feed.
## License
MIT — see `LICENSE`. The code is mine; the underlying records
are public federal court data.
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues