Legal Research Agent
MCP server for legal research that enables searching US case law via CourtListener, retrieving full opinion text, and looking up legal definitions from Cornell's Wex. Students can connect via a remote connector in Claude.ai to cite real, free legal sources.
README
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:
- CourtListener (run by the nonprofit Free Law Project) — full-text US case law search and opinion text.
- Cornell Law School's Wex — a free, authoritative legal dictionary/encyclopedia.
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.
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:
- Push this repo to GitHub (see below).
- In Render, New > Blueprint, point it at your
GitHub repo — it will read
render.yamland configure everything. (Or: New > Web Service, build commandpip install -r requirements.txt, start commandpython server.py.) - Deploy. Render gives you a URL like
https://legal-research-agent.onrender.com. - 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.
Getting a free CourtListener API token (recommended)
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.
- Create a free account at courtlistener.com.
- Go to your profile settings > API and copy your token.
- 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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。