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

  1. Clone the repository:
bash
git clone https://github.com/Stoops0311/LegalMCP.git
cd LegalMCP
  1. Install dependencies:
bash
npm install
  1. Configure your API key (see Configuration section)

  2. Start development server:

bash
npm run dev

⚙️ Configuration

The server requires an IndianKanoon API key. Configuration can be provided via:

Option 1: Environment Variables

bash
export INDIANKANOON_API_KEY="your-api-key-here"

Option 2: Session Configuration

When using with Smithery or MCP clients, provide configuration:

json
{
  "indianKanoonApiKey": "your-api-key",
  "defaultCourt": "supremecourt",
  "maxSearchResults": 20,
  "citationStyle": "SCC OnLine",
  "enableCaching": true,
  "cacheTimeout": 60
}

Configuration Options

OptionTypeDescriptionDefault
indianKanoonApiKeystringRequired - Your IndianKanoon API key-
defaultCourtstringPreferred court for searches"supremecourt"
maxSearchResultsnumberMaximum search results (10-100)20
citationStylestringDefault citation format"SCC OnLine"
enableCachingbooleanCache search resultstrue
cacheTimeoutnumberCache timeout in minutes60

📖 Usage Examples

Basic Search

typescript
// Search for trademark infringement cases
await search_legal_precedents({
  query: "trademark infringement",
  court: "delhi",
  dateRange: { from: "2015", to: "2024" }
})

Extract Legal Principles

typescript
// Extract principles about consumer confusion
await extract_legal_principles({
  documentId: "178980348",
  searchTerms: ["consumer confusion", "deceptive similarity"]
})

Build Research Memo

typescript
// 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 analysis
  • plan.md - Detailed implementation plan for each tool
  • prompt.md - System prompt for AI assistants using the tools
  • CLAUDE.md - Development guidelines for Claude Code

Smithery Documentation

🚢 Deployment

Local Development

bash
npm run dev

Production Deployment

Deploy via Smithery for easy client access:

  1. Build the Docker image
  2. Configure smithery.yaml
  3. 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:

🚦 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

热门

股票投研9点分析框架,覆盖基本面/财务/竞品/估值/宏观/情绪等维度

搜索与获取
未扫描4.3k

SEO审计工具

by amdf01-debug

热门

搜索与获取
未扫描4.3k

智能浏览器

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)

搜索与获取
未扫描4.3k

相关 MCP Server

网页抓取

编辑精选

by Anthropic

热门

Fetch 是 MCP 官方参考服务器,让 AI 能抓取网页并转为 Markdown 格式。

这个服务器解决了 AI 直接处理网页内容时格式混乱的问题,适合需要让 Claude 分析在线文档或新闻的开发者。不过作为参考实现,它缺乏生产级的安全配置,你得自己处理反爬虫和隐私风险。

搜索与获取
84.2k

Brave 搜索

编辑精选

by Anthropic

热门

Brave Search 是让 Claude 直接调用 Brave 搜索 API 获取实时网络信息的 MCP 服务器。

如果你想让 AI 助手帮你搜索最新资讯或技术文档,这个工具能绕过传统搜索的限制,直接返回结构化数据。特别适合需要实时信息的开发者,比如查 API 更新或竞品动态。不过它依赖 Brave 的 API 配额,高频使用可能受限。

搜索与获取
84.2k

by Anthropic

热门

Puppeteer 是让 Claude 自动操作浏览器进行网页抓取和测试的 MCP 服务器。

这个服务器解决了手动编写 Puppeteer 脚本的繁琐问题,适合需要自动化网页交互的开发者,比如抓取动态内容或做端到端测试。不过,作为参考实现,它可能缺少生产级的安全防护,建议在可控环境中使用。

搜索与获取
84.2k

评论