Extraction-based legal research synthesis tool for Claude Desktop
Project description
Baymax - Legal Research Synthesis Tool
Zero hallucination. Pure extraction.
Baymax is a powerful MCP server for Claude Desktop that provides extraction-based legal research tools. Unlike AI that generates or summarizes, Baymax extracts actual text from cases - holdings, rules, facts, and procedural posture - with full citations.
Quick Start (5 minutes)
Step 1: Install Python Dependencies
cd "path/to/baymax"
pip install -r requirements.txt
Step 2: Configure Claude Desktop
Add Baymax to your Claude Desktop config file:
Windows: %APPDATA%\Claude\claude_desktop_config.json
Mac: ~/Library/Application Support/Claude/claude_desktop_config.json
{
"mcpServers": {
"baymax": {
"command": "python",
"args": ["C:/path/to/baymax/citation_mcp_text_based.py"]
}
}
}
Replace the path with your actual installation location.
Step 3: Restart Claude Desktop
Close and reopen Claude Desktop. You should see "baymax" in your MCP servers.
Step 4: Start Using
Just ask Claude:
- "Brief this case for me" (paste case text)
- "Extract the holding from Brady v. Maryland"
- "Synthesize the rules across these three cases"
- "Generate a parenthetical for this case"
Features
Core Extraction Tools
| Tool | Description |
|---|---|
extract_citation |
Parse case names and citations from text |
extract_rules |
Extract holdings, standards, elements, and factors |
extract_case_facts |
Extract procedural posture, key facts, and outcome |
generate_parenthetical |
Create properly formatted case parentheticals |
build_citation_string |
Format citations with signals and pin cites |
Workflow Tools (One-Click Analysis)
| Tool | Description |
|---|---|
brief_this_case |
Complete case briefing - facts, rules, holding, parenthetical |
synthesize_rules |
Multi-case rule synthesis with hierarchy |
validate_brief |
Check brief for citation errors and unsupported assertions |
Research Tools
| Tool | Description |
|---|---|
find_similar_holdings |
Match arguments to case holdings |
suggest_signals |
Recommend citation signals based on context |
analyze_argument_strength |
Evaluate supporting authority strength |
Deposition Tools
| Tool | Description |
|---|---|
ingest_deposition |
Parse transcript into searchable Q&A entries |
search_deposition |
Find testimony by keyword, topic, or citation |
validate_facts_against_record |
Check statement of facts against depositions |
Installation Options
Basic (MCP Server Only)
pip install mcp
Recommended (With PDF Support)
pip install mcp PyPDF2 pdfplumber python-docx
Full Install (All Features)
pip install -r requirements.txt
Optional: Web UI
Baymax includes a web interface for drag-and-drop case analysis:
pip install flask
python web_app.py
# Open http://127.0.0.1:5000
Usage Examples
Brief a Case
User: Brief this case for me:
[paste case text]
Claude: Uses brief_this_case tool...
CASE BRIEF: Brady v. Maryland
=============================
CITATION: 373 U.S. 83 (1963)
PROCEDURAL POSTURE:
Certiorari to the Court of Appeals of Maryland
KEY FACTS:
- Petitioner and companion were convicted of murder
- Companion admitted the actual killing
- Prosecution withheld companion's confession
HOLDING:
The suppression by the prosecution of evidence favorable
to an accused upon request violates due process where the
evidence is material either to guilt or to punishment.
PARENTHETICAL:
(holding that prosecution's suppression of evidence
favorable to accused violates due process when material
to guilt or punishment)
Synthesize Rules Across Cases
User: Synthesize the qualified immunity rules from these cases:
[paste 3 case texts]
Claude: Uses synthesize_rules tool...
RULE SYNTHESIS: Qualified Immunity
==================================
MASTER RULE:
Government officials are entitled to qualified immunity
unless their conduct violated clearly established law.
ELEMENTS:
1. Whether the facts show a constitutional violation
2. Whether the right was clearly established at the time
3. Whether a reasonable official would have known
SOURCES: Harlow v. Fitzgerald, Saucier v. Katz, Pearson v. Callahan
Validate a Brief
User: Check this brief section for problems:
[paste brief section]
Claude: Uses validate_brief tool...
VALIDATION REPORT
=================
CITATIONS: 5 found, 4 valid
ISSUES:
[!] "Smith v. Jones, 123 F.3d 456" - citation format error
[!] Assertion on page 3 lacks supporting authority
[!] Signal "see" may be incorrect - consider "see also"
SUGGESTIONS:
- Add pin cite for block quote from Johnson v. State
- Consider distinguishing adverse authority on element 2
Requirements
- Python 3.9+
- Claude Desktop with MCP support
- Optional: Tesseract OCR (for scanned PDFs)
- Optional: Poppler (for PDF-to-image conversion)
File Structure
baymax/
├── citation_mcp_text_based.py # MCP server (main entry point)
├── brief_synthesis.py # Parentheticals, synthesis
├── enhanced_rules.py # Rule/holding extraction
├── extraction_validation.py # Validation tools
├── workflows.py # Workflow orchestration
├── deposition_tools.py # Deposition processing
├── web_app.py # Optional web UI
├── templates/
│ └── index.html # Web UI template
├── requirements.txt # Python dependencies
├── pyproject.toml # Package configuration
└── README.md # This file
Troubleshooting
"MCP server not connecting"
- Check the path in
claude_desktop_config.jsonis correct - Ensure Python is in your PATH
- Try running
python citation_mcp_text_based.pydirectly to see errors
"Module not found"
pip install mcp
"PDF extraction not working"
pip install PyPDF2 pdfplumber
"DOCX export not working"
pip install python-docx
How It Works
Baymax uses pattern-based extraction - not AI generation. Every piece of text returned is extracted directly from the source document using legal-specific regex patterns:
- Holdings: Patterns like "We hold that...", "The court held..."
- Rules: "Under [standard], a party must..."
- Facts: Procedural posture, party actions, key events
- Elements: Numbered lists, "requires that" constructions
This means:
- No hallucination - only text from your documents
- Verifiable - check every extraction against the source
- Citation-ready - formatted for immediate use
License
MIT License - Free for personal and professional use.
Contributing
Issues and PRs welcome at the project repository.
Baymax - Extraction-based legal research synthesis for Claude Desktop.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file baymax_legal-1.0.0.tar.gz.
File metadata
- Download URL: baymax_legal-1.0.0.tar.gz
- Upload date:
- Size: 243.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4ab0de7362990f0b04d5782e6890ff02fb733059d25a2e2fd06c4d33b01c5773
|
|
| MD5 |
009ea8e6b4460da18c8beb134bbb2211
|
|
| BLAKE2b-256 |
84c4da3c7a304b2c077d2da88897bcdf20443546a130ead78537275bfccc6da2
|
File details
Details for the file baymax_legal-1.0.0-py3-none-any.whl.
File metadata
- Download URL: baymax_legal-1.0.0-py3-none-any.whl
- Upload date:
- Size: 252.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b07eefa1a5075a480734c5647cd1f123deeb4bf7278ac4e4963fd16e163d93c0
|
|
| MD5 |
f27d1feed46031689d628c0cc1ce327c
|
|
| BLAKE2b-256 |
4aa47c6dd838071d04dea96922f663fe5c07ab9740666d727c57c60b1464a243
|