datajud-mcp-server
MCP server for querying Brazil's CNJ DataJud public API. Enables validating CNJ process numbers, searching lawsuits by number, and listing courts.
README
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
Quickstart
git clone <this-repo-url>
cd datajud-mcp-server
bun install
cp .env.example .env
docker compose up -d redis
Option A — HTTP transport
bun run dev
In 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:stdio
stdio 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 |
|---|---|---|
validate_process_number |
no | Validate a CNJ process number offline and explain its structure. Call this first when a number's origin is uncertain. |
search_lawsuit_by_number |
yes | Look up a lawsuit by its unified CNJ process number. Returns one record per instance (grau) it appears in. |
list_courts |
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 runs
Or run everything, app included, in Docker:
docker compose up --build
See 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
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。