ecourts-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@ecourts-mcp-server lookup case CS(OS) 123/2024 in Delhi High Court"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
ecourts-mcp-server v1.2.0
An MCP (Model Context Protocol) server that connects LLMs to the EcourtsIndia Partner API v1.3, enabling AI agents to search Indian court cases, retrieve orders, read cause lists, and access AI-generated summaries.
Tools (9 total)
Tool | Description | Billing |
| Full case detail by CNR — parties, orders, IAs, notices, documents, hearings, FIR, linked cases, file AI status, case AI analysis | Per-request |
| Workflow tool — find a case by human-readable number (e.g. "CS(OS) 123/2024") instead of CNR, returns full details | Per-request |
| Rich search with 30+ filter params, year filters, date ranges, faceted aggregations | Per-request |
| Download order PDF with metadata (certified true copies) | Per-request |
| Extracted order text + pre-computed AI analysis (summary, outcome, key points) | Per-request |
| Browse state → district → complex → court hierarchy | Free |
| Search cause list entries across all courts | ₹1/request |
| Available cause list dates | Free |
| Queue a fresh scrape of case data | Per-request |
Related MCP server: mcp-juridico-brasil
Quick Start
npm install
npm run build
export ECOURTS_API_TOKEN="eci_live_your_token_here"
npm startDeployment
Docker
# Build
docker build -t ecourts-mcp-server .
# Run
docker run -d \
-e ECOURTS_API_TOKEN=eci_live_your_token_here \
-p 3000:3000 \
ecourts-mcp-server
# Health check
curl http://localhost:3000/healthDocker Compose
# Set your token
export ECOURTS_API_TOKEN=eci_live_your_token_here
# Start
docker compose up -d
# Verify
curl http://localhost:3000/healthCloud Deployment
The Docker image works with any container platform:
AWS ECS / Fargate — Use the health check endpoint at
/healthGoogle Cloud Run — Set
PORT=8080(Cloud Run default), server auto-adaptsAzure Container Apps — Standard HTTP container deployment
Railway / Render / Fly.io — Push the Dockerfile, set
ECOURTS_API_TOKENin secrets
The image runs as a non-root user, includes a HEALTHCHECK, and defaults to HTTP transport on port 3000.
Claude Desktop (stdio)
{
"mcpServers": {
"ecourts": {
"command": "node",
"args": ["/path/to/ecourts-mcp-server/dist/index.js"],
"env": {
"ECOURTS_API_TOKEN": "eci_live_your_token_here"
}
}
}
}Claude Code (stdio)
claude mcp add ecourts -- node /path/to/ecourts-mcp-server/dist/index.jsRunning Tests
npm test # 110 unit tests via vitest
npm run test:integration # 24 integration tests (requires ECOURTS_API_TOKEN)
npm run test:all # bothTests cover: query parameter serialization, all formatting functions, facet rendering, all 14 API error code branches, schema boundary validation, safeHandler wrapper, truncation, date validation, and typed fields. Integration tests cover court structure hierarchy, case search with filters/sort/years, case detail, order metadata, cause list search by date, case refresh, and error scenarios.
CI/CD
The .github/workflows/ci.yml pipeline:
Build & test on Node 20 and 22 (on push/PR to main)
Docker build + health check on push to main
Architecture
src/
├── index.ts # Entry point, transport (stdio/HTTP), health endpoint
├── constants.ts # Base URLs, character limits
├── types.ts # Full TypeScript interfaces for all API responses
├── schemas/index.ts # Zod input validation with date regex enforcement
├── services/
│ ├── api-client.ts # HTTP client, binary download, repeated-key array serializer, error handling
│ └── formatting.ts # Markdown formatters for case, search, causelist, order
└── tools/index.ts # 9 tool registrations with MCP annotationsEnvironment Variables
Variable | Required | Description |
| Yes | EcourtsIndia Partner API bearer token |
| No |
|
| No | HTTP port (default |
Changelog
v1.2.0 (current)
Code Quality:
Eliminated all unsafe type casts —
linkCases,subordinateCourt, andfirDetailsare now proper typed fields onCourtCaseDataCauseListEntryexpanded withpetitionerAdvocates,respondentAdvocates,internalCaseNo,dateCreated,dateModifiedProper
AvailableDatesResponseandCaseFileSummarytypes replace inline anonymous typesAll date parameters validated with
YYYY-MM-DDregex at schema level
New Features:
ecourts_lookup_case— workflow tool that finds cases by human-readable number (e.g. "CS(OS) 123/2024") instead of CNROrder file status in case detail —
ecourts_get_casenow shows which orders have AI analysis available with summary previewsHealth check endpoint —
GET /healthfor load balancers and container orchestratorsError-safe HTTP transport — Express handler now catches errors instead of hanging
ecourts_get_orderPDF download — returns order PDF as embedded resource with metadata (filename, file size) extracted from HTTP headers
Deployment:
Multi-stage Dockerfile (22MB Alpine image, non-root user, HEALTHCHECK)
docker-compose.yml with health check and token validation
GitHub Actions CI (Node 20/22 matrix, Docker build verification)
Test suite expanded to 110 unit tests + 24 integration tests
v1.1.0
Fixed array parameter serialization (courtCodes, caseTypes, etc.)
Added
isErrorflag on MCP error responsesComplete error code handling (11 API error codes)
15+ new search parameters (year filters, date ranges, categories, bench types)
Facet counts in search output
Comprehensive case detail formatting (all sections)
v1.0.0
Initial release with 8 tools covering all EcourtsIndia Partner API endpoints
Available Tools
3 toolsecourts_get_caseGet Case DetailsARead-onlyIdempotent
Retrieve comprehensive details for an Indian court case by CNR (Case Number Record).
Returns: case status, parties (petitioners/respondents), advocates, judges, hearing history, listing dates, judgment orders, interim orders, interlocutory applications, notices, filed documents, tagged/connected matters, linked cases, earlier court details, FIR details (criminal), subordinate court, and AI case analysis.
Args:
cnr (string): Case Number Record, e.g. "DLHC010001232024"
Use this tool first to discover available order filenames (judgmentOrders[].orderUrl, interimOrders[].orderUrl) before calling ecourts_get_order or ecourts_get_order_ai.
Inputs: cnr (required).
ecourts_get_causelist_datesGet Cause List Available DatesARead-onlyIdempotent
Get dates for which cause list data is available, filtered by location.
At least one parameter is required: state, district_code, court_complex_code, or court_no.
Free endpoint (no credit charge, authentication required). Use the returned dates with ecourts_search_causelist to avoid empty searches.
Inputs: state, court_no, district_code, court_complex_code.
ecourts_search_casesSearch Court CasesARead-onlyIdempotent
Search for Indian court cases with text queries, filters, date ranges, year filters, and faceted aggregations.
Text search args (all optional): query, advocates, judges, petitioners, respondents, litigants
Filter args (arrays): court_codes, case_types, case_statuses, judicial_sections, case_categories, bench_types
Year filters (integer arrays): filing_years, registration_years, first_hearing_years, next_hearing_years, decision_years
Date ranges (YYYY-MM-DD): filing_date_from/to, registration_date_from/to, first_hearing_date_from/to, next_hearing_date_from/to, decision_date_from/to
Controls: include_facet_counts (bool), sort_by, sort_order, page, page_size (max 100)
Returns: matching cases with CNR, parties, dates, facet counts. Supply at least one search term or filter.
Inputs: page, query, judges, sort_by, +28 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: searching cases with filters, retrieving cause list availability dates, and getting detailed case info by CNR. No overlap in functionality.
All tools follow a consistent 'ecourts_<verb>_<noun>' pattern (search_cases, get_causelist_dates, get_case), making them predictable and easy to distinguish.
Only 3 tools are provided, which is too few for the apparent scope of an Indian court case retrieval system. The descriptions reference missing tools like ecourts_search_causelist and ecourts_get_order, indicating the set is incomplete.
The tool surface has significant gaps: there is no tool to actually retrieve a cause list or obtain court orders, even though the get_case tool returns order URLs. Users cannot complete full workflows as described.
Maintenance
Related MCP Connectors
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
Indian court data for AI: 27.6 Cr cases, orders, cause lists, Supreme Court to tribunals, statutes
Connect AI to millions of laws and court cases with the Lawstronaut MCP.
Public Indian legal search MCP for Roop judgments, statutes, and corpus grounding.
Related MCP Servers
- FlicenseNot gradedqualityBmaintenanceEnables LLM-friendly access to the CourtListener legal database and eCFR for searching legal opinions, court cases, judges, documents, and federal regulations.13-
- AlicenseAqualityBmaintenanceConnects AI assistants to Brazilian judicial data from DataJud CNJ and 91 courts, enabling process consultation, monitoring, and deadline calculation under the Civil Procedure Code.996 PyPI135MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI agents to query and access legal data from the Free Law Project's CourtListener API, including court opinions, judges, and dockets, with basic access requiring no authentication.345 npmMIT
- AlicenseAqualityBmaintenanceAn MCP server for the CourtMesh public API that enables AI clients to search and analyze Indian court case law, covering over 310 million case records from the Supreme Court, High Courts, District Courts, and tribunals.12254 npm1MIT