Indian Legal Research Assistant
搜索与获取by Stoops0311
用智能工具加速印度法律研究,支持检索判例、提取法律原则、生成研究备忘录、格式化并核验引文,显著缩短研究时间并提升专业准确性。
什么是 Indian Legal Research Assistant?
用智能工具加速印度法律研究,支持检索判例、提取法律原则、生成研究备忘录、格式化并核验引文,显著缩短研究时间并提升专业准确性。
README
LegalMCP - Indian Legal Research Assistant
An MCP (Model Context Protocol) server that provides intelligent legal research tools for Indian law practitioners, leveraging the IndianKanoon API to automate citation work and case law research.
🎯 Overview
LegalMCP transforms legal research from hours of manual work to minutes of automated analysis. It provides five specialized tools that work together to search precedents, extract legal principles, build research memos, format citations, and verify citation accuracy.
Key Benefits
- Reduce research time from 3-4 hours to 30 minutes
- Eliminate citation errors with automated formatting
- Comprehensive coverage with intelligent search strategies
- Professional output with properly structured legal memos
🛠️ Tools
1. search_legal_precedents
Search IndianKanoon for relevant cases with intelligent ranking based on:
- Court hierarchy (Supreme Court > High Courts)
- Recency and citation metrics
- Multiple search variants for comprehensive coverage
2. extract_legal_principles
Extract specific legal principles from cases with:
- Pinpoint paragraph-level citations
- Context windows around key principles
- Distinction between ratio decidendi and obiter dicta
3. build_case_compilation
Create comprehensive legal research memos featuring:
- Multi-stage search strategy
- Automatic organization by legal principles
- Professional memo structure with citations
4. format_citations
Generate properly formatted citations in Indian legal styles:
- AIR, SCC, Neutral, and SCC OnLine formats
- Parallel citation discovery
- Multiple output formats (full, short, footnote, bibliography)
5. verify_citations
Validate and correct citations with:
- Accuracy verification against IndianKanoon database
- Error detection and correction suggestions
- Cross-reference validation
🚀 Installation
Prerequisites
- Node.js 18+
- npm or yarn
- IndianKanoon API key
Setup
- Clone the repository:
git clone https://github.com/Stoops0311/LegalMCP.git
cd LegalMCP
- Install dependencies:
npm install
-
Configure your API key (see Configuration section)
-
Start development server:
npm run dev
⚙️ Configuration
The server requires an IndianKanoon API key. Configuration can be provided via:
Option 1: Environment Variables
export INDIANKANOON_API_KEY="your-api-key-here"
Option 2: Session Configuration
When using with Smithery or MCP clients, provide configuration:
{
"indianKanoonApiKey": "your-api-key",
"defaultCourt": "supremecourt",
"maxSearchResults": 20,
"citationStyle": "SCC OnLine",
"enableCaching": true,
"cacheTimeout": 60
}
Configuration Options
| Option | Type | Description | Default |
|---|---|---|---|
indianKanoonApiKey | string | Required - Your IndianKanoon API key | - |
defaultCourt | string | Preferred court for searches | "supremecourt" |
maxSearchResults | number | Maximum search results (10-100) | 20 |
citationStyle | string | Default citation format | "SCC OnLine" |
enableCaching | boolean | Cache search results | true |
cacheTimeout | number | Cache timeout in minutes | 60 |
📖 Usage Examples
Basic Search
// Search for trademark infringement cases
await search_legal_precedents({
query: "trademark infringement",
court: "delhi",
dateRange: { from: "2015", to: "2024" }
})
Extract Legal Principles
// Extract principles about consumer confusion
await extract_legal_principles({
documentId: "178980348",
searchTerms: ["consumer confusion", "deceptive similarity"]
})
Build Research Memo
// Create comprehensive research on a legal issue
await build_case_compilation({
issue: "Criminal defamation under Section 499 IPC",
subIssues: ["public interest defense", "truth as justification"],
jurisdiction: ["supremecourt", "delhi"]
})
🏗️ Architecture
Technology Stack
- TypeScript - Type-safe development
- MCP SDK - Model Context Protocol implementation
- Zod - Schema validation
- Smithery - MCP server scaffold and deployment
API Integration
- Uses IndianKanoon API v1.0
- POST requests with token authentication
- Intelligent error handling and retry logic
- Response caching for performance
Performance Optimizations
- Parallel API requests for search variants
- Smart caching (metadata: 24h, search: 1h)
- Fragment API prioritization over full documents
- Result deduplication across searches
📚 Documentation
Project Documentation
analysis.md- Comprehensive IndianKanoon API analysisplan.md- Detailed implementation plan for each toolprompt.md- System prompt for AI assistants using the toolsCLAUDE.md- Development guidelines for Claude Code
Smithery Documentation
getting-started.md- MCP concepts and benefitsproject-config.md- Configuration setupdeployments.md- Deployment optionssession-config.md- Runtime configuration
🚢 Deployment
Local Development
npm run dev
Production Deployment
Deploy via Smithery for easy client access:
- Build the Docker image
- Configure smithery.yaml
- Deploy to Smithery platform
See deployments.md for detailed instructions.
🤝 Integration
With AI Assistants
LegalMCP is designed to work with AI assistants that support MCP:
- Claude (via Claude Desktop or API)
- Other MCP-compatible LLMs
With Legal Tech Stack
Can be integrated with:
- Document management systems
- Legal practice management software
- Citation management tools
📈 Performance Metrics
- Search Speed: < 2 seconds for multi-variant searches
- Extraction Accuracy: 95%+ for principle identification
- Citation Validation: 98%+ accuracy for format verification
- Cache Hit Rate: 60%+ for common searches
🔒 Security
- API keys are never logged or exposed
- Stateless design with no data persistence
- Secure token-based authentication
- Input validation on all parameters
📝 License
This project is licensed under the MIT License - see the LICENSE file for details.
🙏 Acknowledgments
- IndianKanoon for providing comprehensive legal database access
- Anthropic for MCP SDK and Smithery platform
- Indian legal community for inspiration and use cases
📞 Support
For issues, questions, or contributions:
- GitHub Issues: https://github.com/Stoops0311/LegalMCP/issues
- Documentation: Project Wiki
🚦 Status
Current Version: 1.0.0
Status: Active Development
API Compatibility: IndianKanoon API v1.0
Built with ❤️ for the Indian legal community
常见问题
Indian Legal Research Assistant 是什么?
用智能工具加速印度法律研究,支持检索判例、提取法律原则、生成研究备忘录、格式化并核验引文,显著缩短研究时间并提升专业准确性。
相关 Skills
股票投研框架
by alondai
股票投研9点分析框架,覆盖基本面/财务/竞品/估值/宏观/情绪等维度
SEO审计工具
by amdf01-debug
智能浏览器
by ayakolin
A fast Rust-based headless browser automation CLI with Node.js fallback that enables AI agents to navigate, click, type, and snapshot pages via structured commands. (Chinese localized version)
相关 MCP Server
网页抓取
编辑精选by Anthropic
Fetch 是 MCP 官方参考服务器,让 AI 能抓取网页并转为 Markdown 格式。
✎ 这个服务器解决了 AI 直接处理网页内容时格式混乱的问题,适合需要让 Claude 分析在线文档或新闻的开发者。不过作为参考实现,它缺乏生产级的安全配置,你得自己处理反爬虫和隐私风险。
Brave 搜索
编辑精选by Anthropic
Brave Search 是让 Claude 直接调用 Brave 搜索 API 获取实时网络信息的 MCP 服务器。
✎ 如果你想让 AI 助手帮你搜索最新资讯或技术文档,这个工具能绕过传统搜索的限制,直接返回结构化数据。特别适合需要实时信息的开发者,比如查 API 更新或竞品动态。不过它依赖 Brave 的 API 配额,高频使用可能受限。
Puppeteer 浏览器控制
编辑精选by Anthropic
Puppeteer 是让 Claude 自动操作浏览器进行网页抓取和测试的 MCP 服务器。
✎ 这个服务器解决了手动编写 Puppeteer 脚本的繁琐问题,适合需要自动化网页交互的开发者,比如抓取动态内容或做端到端测试。不过,作为参考实现,它可能缺少生产级的安全防护,建议在可控环境中使用。