courtmesh-mcp
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., "@courtmesh-mcpSearch for Supreme Court cases on right to privacy"
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.
@courtmesh/mcp-server
An MCP (Model Context Protocol) server for the CourtMesh public REST API. It gives any MCP capable AI client, Claude Desktop, Claude Code, Cursor, or a custom agent, tools to search and analyze Indian court case law: 310M plus case records spanning the Supreme Court, High Courts, District Courts and tribunals.
Built with the official @modelcontextprotocol/sdk. MIT licensed.
Quickstart
1. Get an API key
Sign up and generate a key at https://research.courtmesh.ai. Keys look like cm-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-xxxx (a legacy vv- prefix also works).
2. Run it
You do not need to install anything by hand, npx will fetch and run the package. Set COURTMESH_API_KEY in your MCP client config, see the copy pasteable blocks below.
Local checkout:
npm install
npm run build
COURTMESH_API_KEY=cm-your-key-here node dist/index.jsRelated MCP server: canlii-mcp
Environment variables
Variable | Required | Default | Description |
| Recommended | none | Your CourtMesh API key. Tools list fine without it, but any real API call will fail with a 401 style error until it is set. In HTTP mode a per session |
| No |
| Override to point at a different CourtMesh environment. |
| No |
| Set to |
| No |
| Port for the HTTP transport. |
Transports
This server supports two transports, chosen at startup:
stdio (default): the standard transport for local MCP clients such as Claude Desktop, Claude Code and Cursor. The client spawns the server process and talks to it over stdin and stdout.
Streamable HTTP: pass
--httpor setMCP_TRANSPORT=httpto run as a long lived HTTP server, mounted at/mcp, suitable for hosting behind a URL such asmcp.courtmesh.ai/mcp. A plainGET /healthroute is also available on the HTTP server itself, separate from thecheck_api_healthtool, which checks the upstream CourtMesh API instead.
Tools
Tool | Endpoint | Credits | One line |
|
| No | Fast keyword and boolean search over the full 310M plus case index. |
|
| Yes | AI vector search over the roughly 2M case subset with embeddings, for natural language questions about legal concepts. |
|
| No | Full case details, without AI analysis. |
|
| No | Reads any existing AI analysis for a case, read only. |
|
| No | Other documents sharing the same case number, plus a procedural timeline. |
|
| No | Autocomplete over Supreme Court and High Court judge names. |
|
| Yes | Triggers AI analysis of one case, asynchronous. |
|
| Yes, more | AI analysis merged across every document sharing a case number, synchronous and slow. |
|
| No | A time limited, encrypted link to the official judgment PDF. |
|
| No | Kicks off a live fetch of order and hearing history from the court's own systems. |
|
| No | Polls the job started by |
|
| No | Checks CourtMesh API connectivity, no authentication required. |
Full input and output field details are in each tool's own description, visible to any connected MCP client through tools/list.
Configuration examples
Claude Desktop
Edit claude_desktop_config.json (Settings, Developer, Edit Config) and add:
{
"mcpServers": {
"courtmesh": {
"command": "npx",
"args": ["-y", "@courtmesh/mcp-server"],
"env": {
"COURTMESH_API_KEY": "cm-your-key-here"
}
}
}
}Claude Code
CLI one liner:
claude mcp add courtmesh --env COURTMESH_API_KEY=cm-your-key-here -- npx -y @courtmesh/mcp-serverOr add to .mcp.json in your project:
{
"mcpServers": {
"courtmesh": {
"command": "npx",
"args": ["-y", "@courtmesh/mcp-server"],
"env": {
"COURTMESH_API_KEY": "cm-your-key-here"
}
}
}
}Cursor
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"courtmesh": {
"command": "npx",
"args": ["-y", "@courtmesh/mcp-server"],
"env": {
"COURTMESH_API_KEY": "cm-your-key-here"
}
}
}
}Hosted HTTP mode
Once this server is deployed behind a public URL, point any Streamable HTTP capable MCP client at it directly, no local process required. Pass your key as a query parameter, it overrides COURTMESH_API_KEY for that session:
{
"mcpServers": {
"courtmesh": {
"url": "https://mcp.courtmesh.ai/mcp?token=cm-your-key-here"
}
}
}Error codes
The API's own error text is always surfaced verbatim where available, along with a plain explanation.
Status | Meaning | What to do |
401 | The API key is missing, malformed, invalid, or deactivated. | Set |
403 | Account, plan, or quota gate: organization deactivated, account suspended, billing inactive, account not found, AI credits exhausted, or the daily API call quota reached (the response includes | Check your CourtMesh billing and plan settings, or wait for the quota to reset. |
429 | Rate limited. | Wait the number of seconds given in |
400 | Validation failed. | The tool result lists the specific field errors from the API's |
404 | The case, PDF, or timeline request was not found. | Double check the id or requestId. |
408 / 500 / 502 / 503 | Timeout or upstream failure. | Usually transient, retry later. |
There is one API quirk this server handles for you: POST /search/cases/semantic sends its HTTP 200 status before it finishes work, so a failure inside that endpoint can still arrive as HTTP 200 with a body of {"success": false, "error": "..."}. Every tool call checks for success: false in the response body in addition to the HTTP status, and reports it as a tool error either way.
Development
npm install
npm run build # compiles TypeScript with tsc, then chmods dist/index.js executable
npm run dev # tsc --watch
npm start # runs the built server over stdioSource layout:
src/index.ts: entry point, transport selection (stdio vs Streamable HTTP), Express app for HTTP mode.src/client.ts: shared HTTP client, auth headers, and all error mapping.src/tools.ts: tool schemas (zod) and handlers, one per CourtMesh endpoint.src/context.ts: anAsyncLocalStorageused to carry a per request?token=override through to the client in HTTP mode.
License
MIT, Copyright 2026 Thinkscoop Technologies LLP. See LICENSE.
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 Servers
- FlicenseBqualityFmaintenanceAn MCP server providing standardized access to Swiss court decisions through the entscheidsuche.ch API, allowing LLMs to search, retrieve, and analyze legal documents from Swiss jurisdictions.35
- AlicenseAqualityCmaintenanceAn MCP server providing AI assistants access to Canadian case law and legislation metadata from CanLII across all jurisdictions, supporting search and citation relationships.785MIT
- AlicenseAqualityDmaintenanceMCP Server providing AI agents access to over 3 million US court decisions via CourtListener and EU legislation via EUR-Lex, with tools for searching cases, citations, judges, and court information.6MIT
- Alicense-qualityCmaintenanceAn MCP server providing AI agents access to CourtListener's comprehensive legal database, featuring semantic search, hybrid search, citation verification, and research tools.7MIT
Related MCP Connectors
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.
CourtListener MCP — Free Law Project's CourtListener API (free, no auth required for basic access)
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thinkscoop-technologies/courtmesh-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server