CourtListener MCP adapter with citation parser and fixture tests

Gadoes adds the CourtListener connector for federal and state caselaw in the United States: config builder, key validator, tool definitions, system prompt, two JSON fixtures, and 19 tests covering both citation parsing and a mock-MCP round trip.

searchintegration

The whole thing lives in backend/src/lib/mcp/servers/courtlistener.ts - a single file exporting buildCourtListenerConfig, isValidCourtListenerKey, COURTLISTENER_TOOLS, and COURTLISTENER_SYSTEM_PROMPT. Key validation is simple: non-null, non-empty, non-whitespace string.

The fixture pair in backend/src/__fixtures__/courtlistener/ covers a three-result search response (including a SCOTUS opinion, a D.C. Circuit case, and an S.D.N.Y. case) and an empty-results response. Tests confirm citation parsing maps case names to title, CourtListener opinion IDs to source_id, URLs to courtlistener.com paths, and snippets to excerpt. The mock-MCP integration test uses the InMemoryTransport-based mock server from Chunk 2 to exercise the config without spawning a child process.

The buildCourtListenerConfig/isValidXKey/X_TOOLS/X_SYSTEM_PROMPT shape is the template all later per-source adapters follow. If you're adding your own sources, start here.

So what Worth a look for any fork serving American-jurisdiction work. Small footprint - one file plus fixtures - no schema changes. The pattern is deliberately generic, so it doubles as a reference implementation for adding sources that aren't in Gadoes' roadmap.

View this fork on GitHub →

Spotted something wrong? Or know the PR text has fresher detail than the writeup above?

Commits in this thread

2 commits from Gadoes/dispumike, oldest first. Source extracted verbatim from the harvested git log.

SHA Subject Author Date
0aff3c42 feat(mcp): Chunk 10 - CourtListener MCP server config + fixture tests Gadoes 2026-05-02 ↗ GitHub
commit body
Adds buildCourtListenerConfig, isValidCourtListenerKey, COURTLISTENER_TOOLS,
and COURTLISTENER_SYSTEM_PROMPT. Includes fixture-based citation parser tests
and mock MCP server integration tests (19 tests).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
5a7336c1 Merge chunk-10-courtlistener into main Gadoes 2026-05-02 ↗ GitHub

Capture this thread into my fork

Download a single Markdown prompt that tells Claude how to port every commit above into your working tree — adapting paths and structure to match your repo. Run it via claude -p < capture-thread-22.md from inside the repo you want the changes in.

⬇ Download capture-thread-22.md