vinothezhumalai/legalmcpserver
If you are the rightful owner of legalmcpserver and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.
A Model Context Protocol (MCP) server for legal document analysis, providing AI-powered summarization and classification of legal documents across 8 major areas of law.
Legal MCP Server
A Model Context Protocol (MCP) server for legal document analysis, providing AI-powered summarization and classification of legal documents across 8 major areas of law.
Features
- Document Summarization: Extract key facts, legal issues, holdings, and reasoning from legal documents
- Legal Classification: Classify documents into 8 legal areas with confidence scores
- Multi-Area Analysis: Support for Contract, Tax, Constitutional, Property, Tort, Securities, Criminal, and Administrative Law
- Thomson Reuters LLM Integration: Configured for Thomson Reuters' internal LLM infrastructure
Legal Areas Covered
- Contract Law - Agreements, breaches, performance, remedies
- Tax Law - Taxation, IRS matters, compliance, disputes
- Constitutional Law - Constitutional rights, government powers, judicial review
- Property Law - Real estate, ownership, transfers, zoning
- Tort Law - Personal injury, negligence, damages
- Securities Law - Investment securities, SEC regulations, fraud
- Criminal Law - Criminal charges, prosecution, defense
- Administrative Law - Government agencies, regulations, procedures
Installation
# Clone the repository
git clone https://github.com/vinothezhumalai/legalmcpserver.git
cd legalmcpserver
# Install dependencies
npm install
# Build the project
npm run build
Configuration
Copy .env.example to .env and configure:
cp .env.example .env
The server is pre-configured for Thomson Reuters infrastructure:
- Base URL:
https://litellm.int.thomsonreuters.com - Model:
anthropic/claude-sonnet-4-20250514
Usage
Running the MCP Server
# Development mode
npm run dev
# Production mode
npm run build && npm start
MCP Tools Available
1. summarize_legal_document
Generates comprehensive legal summaries including:
- Executive summary
- Key facts
- Legal issues
- Court holdings
- Legal reasoning
- Relevant precedents
Input:
{
"document": {
"content": "Legal document text...",
"title": "Case Title",
"caseNumber": "2023-CV-1234",
"jurisdiction": "Superior Court",
"date": "2023-06-15"
},
"options": {
"maxLength": 500,
"includeKeyFacts": true,
"includeHolding": true,
"includeReasoning": true,
"includeCitations": false
}
}
2. classify_legal_document
Classifies documents into legal areas with confidence scores:
Input:
{
"document": {
"content": "Legal document text...",
"title": "Document Title"
},
"options": {
"confidenceThreshold": 0.7,
"includeSubcategories": true,
"multiLabel": false
}
}
3. analyze_legal_document_full
Performs both summarization and classification in one call.
Sample Legal Scenarios
The server includes 8 diverse legal scenarios for testing, accessible via the resource legal://sample-scenarios.
Integration with Claude Code
Add to your MCP configuration:
{
"mcpServers": {
"legal-analyzer": {
"command": "node",
"args": ["dist/index.js"],
"cwd": "/path/to/legalmcpserver"
}
}
}
API Response Format
Summarization Response
{
"summary": "Executive summary text...",
"keyFacts": ["Fact 1", "Fact 2"],
"legalIssues": ["Issue 1", "Issue 2"],
"holding": "Court's decision...",
"reasoning": "Legal reasoning...",
"precedents": ["Case 1", "Case 2"],
"wordCount": 245
}
Classification Response
{
"primaryArea": "Contract Law",
"confidence": 0.92,
"secondaryAreas": [
{
"area": "Tort Law",
"confidence": 0.35
}
],
"subcategories": ["Breach of Contract", "Damages"],
"reasoning": "Document discusses breach of construction contract..."
}
Development
# Install dependencies
npm install
# Run in development mode
npm run dev
# Build for production
npm run build
# Run tests (if available)
npm test
Security
- API keys are configured through environment variables
- All inputs are validated using Zod schemas
- Error handling prevents sensitive information leakage
License
MIT License - see LICENSE file for details.