title: Legal Deed Reviewer
emoji: ⚖️
colorFrom: blue
colorTo: purple
sdk: gradio
sdk_version: 4.0.0
app_file: app.py
pinned: false
license: apache-2.0
tags:
- mcp
- mcp-in-action-productivity
- legal
- document-analysis
- gradio
- ai
- legal-tech
- property
- deed-analysis
⚖️ Legal Deed Reviewer
AI-powered legal deed analysis using MCP (Model Context Protocol) servers
Upload property deed documents to receive comprehensive risk assessments, clause-by-clause breakdowns, and plain-language explanations of legal issues.
🎯 Overview
Legal Deed Reviewer is an intelligent system that helps property buyers, landlords, lawyers, and mortgage teams understand the risks and implications in legal deed documents. Built for the MCP-1st-Birthday Hackathon, this project demonstrates advanced MCP integration with multi-tool orchestration for legal document analysis.
What This Tool Does:
✅ Deed Classification - Automatically identifies deed type (sale, mortgage, lease, gift, warranty, quitclaim)
✅ Metadata Extraction - Extracts parties, property details, consideration, and jurisdiction
✅ Clause Breakdown - Splits deeds into logical sections and clauses
✅ Risk Analysis - Identifies legal risks with severity levels (LOW/MEDIUM/HIGH)
✅ Plain-Language Explanations - Translates legal jargon into understandable language
✅ Actionable Recommendations - Suggests next steps and areas requiring legal consultation
🚀 Quick Start
- Upload a PDF - Click "Upload Deed (PDF)" and select your property deed document
- Click "Analyze Deed" - The system will process your document (takes 10-30 seconds)
- Review Results - Navigate through tabs:
- Overview: Deed metadata and quick stats
- Clause Breakdown: All identified clauses with categorization
- Risk Analysis: Clause-by-clause risk assessment with explanations
- Extracted Text: Full text from the deed
- Download Report - Get a Markdown report for your records
Sample Deed Included
Try the system with our sample: usa_general_warranty_deed_sample.pdf (included in the Space)
🏗️ Architecture
MCP Integration
This project uses 5 MCP tools that work together to provide comprehensive deed analysis:
1. PDF Text Extraction
extract_text_from_deed_pdf(pdf_path: str) -> JSON
- Direct text extraction from PDFs using PyMuPDF
- OCR fallback for scanned documents
- Returns full text + page-by-page breakdown
2. Clause Splitting
split_deed_into_clauses(text: str) -> JSON
- Pattern-based clause detection
- Identifies common deed sections (WITNESSETH, WHEREAS, NOW THEREFORE)
- Categorizes clause types
3. Deed Classification
classify_deed_type(deed_text: str) -> JSON
- LLM-powered deed type identification
- Extracts jurisdiction, parties, property details
- Structured JSON output
4. Risk Analysis
analyze_deed_risks(clauses: str, classification: str) -> JSON
- Clause-by-clause risk assessment
- Categories: TITLE, WARRANTY, ENCUMBRANCE, EASEMENT, RESTRICTION
- Risk levels with explanations and recommendations
5. Comprehensive Report Generation
generate_comprehensive_deed_report(pdf_path: str) -> JSON
- Orchestrates all tools in a pipeline
- Returns complete analysis report
- Single-command full analysis
Tech Stack
- MCP Framework: Model Context Protocol for tool orchestration
- Gradio 4: Web interface
- FastAPI: REST API backend
- Nebius Qwen2.5-VL-72B: Vision model for OCR
- Meta Llama-3.3-70B: LLM for legal analysis
- PyMuPDF: PDF processing
📊 Sample Output
Deed Classification
{
"deed_type": "warranty",
"jurisdiction": {
"country": "United States",
"state_province": "Illinois"
},
"key_parties": {
"grantor": "Michael Austin Carter and wife Laura Jean Carter",
"grantee": "Husband and wife Address: 7421 Meadowbrook Drive"
},
"consideration_amount": "$250,000.00"
}
Risk Analysis Example
RISK LEVEL: MEDIUM
CATEGORY: ENCUMBRANCE
EXPLANATION: The deed includes several exceptions and reservations that could
affect the property's value and usability, including unpaid real estate taxes
and existing easements.
RECOMMENDATION: Conduct a thorough title search to understand the full extent
of encumbrances and consult with a real estate attorney to assess their impact.
🎓 Use Cases
For Property Buyers
- Understand risks before closing
- Identify unusual clauses
- Know what questions to ask your lawyer
For Real Estate Lawyers
- Quick first-pass review
- Standardized risk assessment
- Time-saving for routine deeds
For Mortgage Teams
- Automated security deed screening
- Risk flagging for approval workflow
- Compliance checking
For Landlords
- Lease deed analysis
- Easement and restriction identification
- Future resale impact assessment
⚠️ Legal Disclaimer
IMPORTANT: This tool provides analysis for informational purposes only and does not constitute legal advice.
- Always consult with a qualified attorney licensed in your jurisdiction
- Legal requirements vary by location
- This tool cannot replace professional legal counsel
- Use this as a starting point for discussion with your lawyer
🔧 How It Works
Multi-Step Reasoning Pipeline
The system uses intelligent multi-step reasoning:
- 📄 Text Extraction - Extracts text from PDF (direct or OCR)
- 🔍 Classification - Identifies deed type and jurisdiction
- ✂️ Clause Segmentation - Breaks document into logical sections
- ⚖️ Risk Scoring - Analyzes each clause for legal issues
- 📝 Report Generation - Compiles comprehensive analysis
MCP Tool Orchestration
All tools are MCP-compliant and can be called individually or chained:
# Example: Full analysis pipeline
report = generate_comprehensive_deed_report(pdf_path)
# Or: Individual tool calls
text = extract_text_from_deed_pdf(pdf_path)
classification = classify_deed_type(text)
clauses = split_deed_into_clauses(text)
risks = analyze_deed_risks(clauses, classification)
🏆 MCP-1st-Birthday Hackathon
This project was built for the MCP-1st-Birthday Hackathon in the Productivity Track.
Why This Project Uses MCP
- Modularity - Each legal analysis function is a separate MCP tool
- Composability - Tools can be chained for complex workflows
- Reusability - MCP tools work standalone or in pipelines
- Extensibility - Easy to add new analysis tools (RAG, jurisdiction-specific logic)
- Interoperability - Standard MCP interface for all tools
Future Enhancements
- RAG System: Vector database with model clauses and legal precedents
- Multi-Jurisdiction Support: Country-specific risk assessments
- Clause Comparison: Visual diff against standard templates
- Advanced Risk Scoring: ML-based risk prediction
- Multi-MCP Architecture: Separate servers for PDF, RAG, and LLM
📚 Documentation
- Main README: Project documentation
- CLAUDE.md: AI assistant guidance for codebase
- readme_main.md: Detailed project guidelines
- main_project.md: Original requirements and roadmap
👥 Team
Built by the Legal-AI Team for MCP-1st-Birthday Hackathon:
- Sojib: Frontend (Gradio UI, report export)
- Pial & Sojib: MCP servers (PDF + RAG tools)
- Takib: LLM orchestration and legal prompts
🔗 Links
- GitHub Repository: Legal-Deed-Reviewer
- Hugging Face Space: This Space!
- MCP Documentation: Model Context Protocol
📄 License
Apache-2.0 License - See LICENSE file for details
Made with ⚖️ for the MCP-1st-Birthday Hackathon
Empowering users to understand legal documents through AI