ecourts-mcp-server
Click on "Install 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-serverlookup 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: Law7 MCP
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.
| Name | Required | Description | Default |
|---|---|---|---|
| cnr | Yes | Case Number Record, e.g. DLHC010001232024 |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations already declare read-only, idempotent, open-world, and non-destructive behavior. The description adds value by detailing the comprehensive return fields (case status, parties, orders, etc.) and explaining how to discover order filenames, which goes beyond the annotations.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise: three sentences that quickly convey the main purpose, return content, and usage guidance. No extraneous information is present, earning full marks.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the complexity of Indian court cases and the absence of an output schema, the description provides a thorough list of return fields and valuable guidance on using the tool in conjunction with sibling tools. This fully compensates for any missing structured information.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The schema already provides a 100% description coverage for the single parameter 'cnr', including an example. The description repeats the example but adds no new semantic detail beyond what the schema offers, so a baseline score of 3 is appropriate.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the action 'Retrieve comprehensive details' and the resource 'Indian court case by CNR'. It differentiates from siblings by explicitly noting that this tool should be used first to discover order filenames before calling ecourts_get_order or ecourts_get_order_ai.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description gives explicit guidance on when to use this tool: use it first to discover order filenames. However, it does not explicitly state when not to use it or mention alternatives beyond the sibling tools, leaving some room for improvement.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| state | No | State code, e.g. DL | |
| court_no | No | Court room number | |
| district_code | No | District code | |
| court_complex_code | No | Court complex code |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Adds behavioral traits beyond annotations: 'Free endpoint (no credit charge, authentication required)' and 'At least one parameter is required' (a constraint not fully captured in schema). Annotations already declare readOnly, idempotent, and non-destructive, so the description complements without contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, no wasted words. Purpose stated first, then usage constraints, then practical guidance. Extremely efficient for the information conveyed.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given no output schema, the description appropriately explains the return value (dates) and its intended use. It also mentions authentication and free credit usage. It adequately covers the necessary context for a simple lookup tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100% with descriptions like 'State code, e.g. DL'. The description adds meaning by explaining that at least one parameter is required and that the output dates are intended for use with ecourts_search_causelist, enhancing the understanding of parameter purpose.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clear verb-resource combination: 'Get dates for which cause list data is available'. The description explicitly states filtering by location, and the tool's purpose is distinct from sibling tools (ecourts_search_cases, ecourts_get_case), which deal with case data.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Provides explicit context: 'Use the returned dates with ecourts_search_causelist to avoid empty searches.' Also states the prerequisite that at least one parameter is required. However, it does not contrast usage with siblings or specify when not to use the tool.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
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.
| Name | Required | Description | Default |
|---|---|---|---|
| page | No | Page number (1-based) | |
| query | No | General full-text search across all fields | |
| judges | No | Search by judge name | |
| sort_by | No | Field to sort by | |
| advocates | No | Search by advocate name (both petitioner and respondent advocates) | |
| litigants | No | Search petitioners AND respondents simultaneously | |
| page_size | No | Results per page (max 100) | |
| case_types | No | Filter by case types: CIVIL, CRIMINAL, WRIT, APPEAL, REVISION, EXECUTION, ARBITRATION, MATRIMONIAL, MOTOR_ACCIDENT, LABOR | |
| sort_order | No | Sort direction | |
| bench_types | No | Filter by bench type, e.g. ['SINGLE','DIVISION'] | |
| court_codes | No | Filter by court codes, e.g. ['DLHC01','HCBM01']. Use ecourts_get_court_structure or the enum reference. | |
| petitioners | No | Search by petitioner name | |
| respondents | No | Search by respondent name | |
| filing_years | No | Filter by filing year(s), e.g. [2024, 2023] | |
| case_statuses | No | Filter by statuses: PENDING, DISPOSED, TRANSFERRED, WITHDRAWN, UNKNOWN | |
| decision_years | No | Filter by decision year(s) | |
| filing_date_to | No | Filing date range end (YYYY-MM-DD) | |
| case_categories | No | Filter by case categories, e.g. ['COMMERCIAL'] | |
| decision_date_to | No | Decision date range end (YYYY-MM-DD) | |
| filing_date_from | No | Filing date range start (YYYY-MM-DD) | |
| judicial_sections | No | Filter by judicial sections: CIV, CRIM, WRIT, REV, APP, MISC, PIL, BAIL, URG, ADM | |
| decision_date_from | No | Decision date range start (YYYY-MM-DD) | |
| next_hearing_years | No | Filter by next hearing year(s) | |
| registration_years | No | Filter by registration year(s) | |
| first_hearing_years | No | Filter by first hearing year(s) | |
| include_facet_counts | No | Include facet (aggregation) counts in response. Default true. | |
| next_hearing_date_to | No | Next hearing date range end (YYYY-MM-DD) | |
| registration_date_to | No | Registration date range end (YYYY-MM-DD) | |
| first_hearing_date_to | No | First hearing date range end (YYYY-MM-DD) | |
| next_hearing_date_from | No | Next hearing date range start (YYYY-MM-DD) | |
| registration_date_from | No | Registration date range start (YYYY-MM-DD) | |
| first_hearing_date_from | No | First hearing date range start (YYYY-MM-DD) |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Annotations indicate read-only, open-world, idempotent, non-destructive. Description adds details on parameter constraints (max page size, date format), facet counts, and return fields, complementing the safety profile without contradiction.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-organized with bullet points, clear category headers, and no extraneous text. It efficiently conveys all necessary information for a complex tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's complexity (32 parameters, no output schema), the description covers all parameter groups, constraints, and typical usage. It lacks explicit pagination or error details but is sufficient for agent invocation.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema has 100% description coverage. The description groups parameters into logical categories (text, filters, years, dates, controls), adding semantic structure that aids understanding beyond individual schema descriptions.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states it searches for Indian court cases with various criteria, listing supported query types and return fields. It distinguishes from sibling tools (causelist dates, specific case retrieval) by focusing on search and filtering.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description requires at least one search term or filter, and categorizes parameters into text, filters, dates, etc. It does not explicitly compare to alternatives but the purpose is clear relative to sibling tool names.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.
3 tool updates
v1.2.0- First observed
ecourts_get_case - First observed
ecourts_get_causelist_dates - First observed
ecourts_search_cases
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
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Search U.S. case law, fetch opinions, and ask matter-aware legal questions over your documents.
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.
Resolve, search and verify legal citations against the official sources, with provenance.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables LLM-friendly access to the CourtListener legal database and eCFR for searching legal opinions, court cases, judges, documents, and federal regulations.12-
- FlicenseNot gradedqualityDmaintenanceProvides AI assistants with up-to-date legal documents from official sources, enabling accurate legal information retrieval and analysis.17-
- 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.993MIT
- AlicenseNot gradedqualityCmaintenanceEnables 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.11MIT