datajud-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., "@datajud-mcp-serversearch lawsuit 0000832-35.2018.4.01.3202"
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.
datajud-mcp-server
An MCP server for querying the CNJ DataJud public API — Brazil's national judicial process database — by unified CNJ process number. Unofficial; not affiliated with or endorsed by the CNJ.
Every process number is validated offline before ever touching the network, successful lookups are cached, and every replica shares one Redis-coordinated rate limit budget kept safely under the CNJ's documented cap. See docs/architecture.md for the full design and docs/adr/ for the reasoning behind each major decision.
Requirements
Bun 1.3+ (package manager)
Node.js 24+ (runtime)
Docker (for Redis in local dev, and for building the production image)
A DataJud API key — see Compliance below
Related MCP server: juscraper-mcp
Quickstart
git clone <this-repo-url>
cd datajud-mcp-server
bun install
cp .env.example .env
docker compose up -d redisOption A — HTTP transport
bun run devIn another terminal, call a tool over Streamable HTTP:
curl -s http://localhost:3000/mcp \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-H "Authorization: <your-datajud-api-key>" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "search_lawsuit_by_number",
"arguments": { "processNumber": "0000832-35.2018.4.01.3202" }
}
}'The Authorization header carries your DataJud key for that request — a bare token is accepted and normalized; APIKey <token> also works. No key is stored server-side; it's forwarded to DataJud and otherwise only ever touches Redis as part of a cache/rate-limit key, never as a value (docs/adr/0009-no-credential-persistence.md).
GET /health is a liveness check; GET /ready additionally confirms Redis is reachable.
Option B — stdio transport
DATAJUD_API_KEY=<your-datajud-api-key> bun run dev:stdiostdio mode needs no Redis — it falls back to in-process cache and rate-limit adapters, correct for a single local user (docs/adr/0004, docs/adr/0008). Speak JSON-RPC over stdin/stdout to call the same tools as above.
Either transport should have a tools/call round-trip working in well under ten minutes from a fresh clone.
Claude Desktop (stdio)
Add to Claude Desktop's MCP config:
{
"mcpServers": {
"datajud": {
"command": "node",
"args": ["/absolute/path/to/datajud-mcp-server/src/main-stdio.ts"],
"env": {
"DATAJUD_API_KEY": "<your-datajud-api-key>"
}
}
}
}Tools
Tool | Network call? | Purpose |
| no | Validate a CNJ process number offline and explain its structure. Call this first when a number's origin is uncertain. |
| yes | Look up a lawsuit by its unified CNJ process number. Returns one record per instance (grau) it appears in. |
| no | List every court queryable through DataJud, with its alias and judiciary segment. |
Full input/output schemas and the error taxonomy are documented in docs/mcp-tools.md.
Development
bun run test # unit + integration + e2e
bun run test:coverage # same, with coverage thresholds enforced
bun run test:live # opt-in: hits the real DataJud API (needs DATAJUD_API_KEY), never runs in CI
bun run lint
bun run typecheck
bun run verify # lint + typecheck + test:coverage + build — the same gate CI runsOr run everything, app included, in Docker:
docker compose up --buildSee docs/contributing.md for the branch model, commit convention, and PR checklist, and docs/deployment.md for how staging/production deploy to Coolify.
Compliance
Unofficial client. This project is not built, reviewed, or endorsed by the CNJ.
Rate limit. The CNJ DataJud public API is capped at 120 requests/minute per key. This server enforces a distributed token bucket under that cap by default (
DATAJUD_RATE_LIMIT_PER_MINUTE,DATAJUD_RATE_LIMIT_SAFETY_FACTOR) — see the DataJud access terms for the authoritative limit.User-supplied key. The server never ships or embeds a DataJud API key. Get your own from the CNJ Acesso page and supply it per-request (HTTP) or via
DATAJUD_API_KEY(stdio/local).Public metadata only. DataJud exposes public judicial process metadata (parties' names are not returned by the API itself); this server does not add, infer, or cache any additional personal data beyond what DataJud returns.
Security
See SECURITY.md for the vulnerability reporting process and what this project does (and does not) store.
License
This server cannot be installed
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
- Flicense-qualityDmaintenanceMCP server for integrating with the Brazilian PJE judicial system via MNI and BNP, enabling consultation of legal processes, communications, and precedents.Last updated
- Alicense-qualityBmaintenancePublic MCP server for querying Brazilian court jurisprudence, processes, and communications without authentication. Supports courts like TJSP, TJRS, TJRJ, TJGO, and more via eSAJ, Datajud, and CNJ systems.Last updated1MIT
- AlicenseAqualityBmaintenanceAn MCP server for Brazilian company and public procurement data, enabling CNPJ lookup, company search, tender resolution, and more via paid USDC-based API calls.Last updated15209MIT
- AlicenseAqualityAmaintenanceMCP server for the Brazilian Chamber of Deputies open-data API, enabling search and retrieval of federal legislative bills and their status.Last updated141Apache 2.0
Related MCP Connectors
Public lookup of Brazilian court cases (metadata + docket) via the CNJ/DataJud API. Free, no login.
MCP server for live, sourced Brazilian public data from the official IBGE APIs.
MCP server for Brazilian Federal Senate open data (legislative, administrative, e-Cidadania).
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/innovtech-developers/datajud-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server