Skip to main content
Glama
jcpask

Legal Research Agent

by jcpask

Legal Research Agent

A small MCP server that gives students a Claude-based research assistant backed by real, citable, free legal sources — no Westlaw/Lexis login required:

Students connect to it as a remote connector in Claude.ai — no local install, no API keys of their own. You (the instructor) host one server; every student in the class points Claude at the same URL.

Tools it exposes

Tool

What it does

search_case_law(query, court, filed_after, filed_before, max_results)

Searches CourtListener's case law index. Returns case name, citation, court, date, a snippet, a link to the full case, and a cluster_id.

get_opinion_text(cluster_id)

Fetches the full opinion text for a case found via search_case_law. Requires a free CourtListener API token (see below) — without one it tells the student to use the link instead.

lookup_legal_term(term)

Looks up a term in Cornell's Wex dictionary. Tries the exact page first, then falls back to browsing Wex's alphabetical index for the closest match (handles typos/variants).

Every response includes its source URL so students can (and should) verify and cite the original.

Related MCP server: CourtListener MCP Server

1. Run it locally first (sanity check)

cd law
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt
.venv/bin/python server.py

This starts a Streamable HTTP server on http://127.0.0.1:8000/mcp. This step is just to confirm it boots on your machine — students won't run this themselves.

2. Deploy it somewhere it can stay running

Students need a stable URL, so this needs a real (if tiny) host — GitHub Pages alone can't run a Python process. Render's free tier is the easiest option and needs no code changes:

  1. Push this repo to GitHub (see below).

  2. In Render, New > Blueprint, point it at your GitHub repo — it will read render.yaml and configure everything. (Or: New > Web Service, build command pip install -r requirements.txt, start command python server.py.)

  3. Deploy. Render gives you a URL like https://legal-research-agent.onrender.com.

  4. Your MCP endpoint is that URL plus /mcp: https://legal-research-agent.onrender.com/mcp

Note: Render's free tier sleeps after inactivity, so the first request after a quiet period takes ~30-50 seconds to wake up. Fine for a classroom tool; worth mentioning to students so they don't think it's broken.

Unauthenticated search works out of the box at a low rate limit — fine for trying it out, risky for a whole class hitting it during an assignment.

  1. Create a free account at courtlistener.com.

  2. Go to your profile settings > API and copy your token.

  3. In Render, go to your service > Environment > add COURTLISTENER_API_TOKEN = your token. Redeploy.

This also unlocks get_opinion_text (full opinion text requires auth on CourtListener's side regardless of rate limit).

3. Push to GitHub

git remote add origin https://github.com/<your-username>/legal-research-agent.git
git push -u origin main

(Nothing sensitive is in this repo — the token lives only in Render's environment variables, never in git, per .gitignore.)

4. Give students the connector URL

In Claude.ai: Settings > Connectors > Add custom connector, paste your /mcp URL from step 2. Once connected, students can ask things like:

"Find the case where the Supreme Court established the Miranda warning requirement, and give me the citation."

"What's the legal definition of promissory estoppel?"

Limitations students should know

  • CourtListener is a large, reputable, but not-exhaustive free database — it doesn't have everything Westlaw/Lexis has, especially older or obscure state cases.

  • This is a research aid, not legal advice and not a substitute for reading the actual opinion — always click through to the source.

  • Wex is Cornell's own reference material, written for public education; it's a great starting definition, not a substitute for a case-specific legal argument.

A
license - permissive license
-
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

  • F
    license
    -
    quality
    D
    maintenance
    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.
    Last updated
    1
  • A
    license
    -
    quality
    C
    maintenance
    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.
    Last updated
    MIT

View all related MCP servers

Related MCP Connectors

  • Connect AI to millions of laws and court cases with the Lawstronaut MCP.

  • MCP for CourtListener: US federal and state opinions, dockets, judges, plus eCFR regulations.

  • MCP server giving Claude AI access to 22+ NYC public-record databases for real estate due diligence

View all MCP Connectors

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/jcpask/legal-research-agent'

If you have feedback or need assistance with the MCP directory API, please join our Discord server