0xAI logo
0xAI
Products / Legal MCP

Legal AI infrastructure exposed as production MCP tools.

Legal MCP gives applications, agents, and IDE workflows a governed interface for Brazilian legal search, grounded answers, contract review, document drafting, triage, and risk analysis.

Live endpoint

/mcp/ streamable HTTP

Endpointmcp.laweragent.com
TransportMCP-compatible streamable HTTP
AuthenticationAuthorization: Bearer <client_token>
Unauthenticated probes/health, /healthz, /readyz, /livez

14

legal tools

Scoped

authenticated access

RAG

grounded Brazilian law answers

Managed

retrieval, review, and usage controls

Product surface

A legal intelligence layer for serious integrations.

The platform packages retrieval, generation, authentication, token governance, and usage telemetry behind a single MCP interface.

Grounded legal answers

Answer PT-BR legal questions with citations from indexed Brazilian sources and a lawyer review signal on every response.

Document analysis

Extract parties, dates, values, obligations, omissions, clauses, and risk markers from contracts and legal drafts.

MCP-native API

Expose legal intelligence through an MCP-compatible HTTP interface so IDEs, agents, apps, and internal tools can call it directly.

Governed operations

Issue scoped client tokens, revoke leaked credentials, track usage, and route critical outputs to human legal review.

Quickstart

Authenticate once, then call any scoped legal tool.

Every request is attributed to a client token. The MCP server validates issuer, audience, expiry, signature, and revocation status before a tool runs.

01

Create a client

A backoffice operator creates an MCP client and assigns the exact tool scopes the integration needs.

02

Issue a token

The admin API issues a scoped client token. The raw token is displayed once, then only metadata is retained.

03

Call /mcp/

Your app sends MCP tool calls over authenticated HTTP with Authorization: Bearer <token>.

04

Monitor and revoke

Usage is attributed by client and token id. Revoked tokens are rejected by the server within 60 seconds.

curl
TOKEN="eyJhbGciOiJIUzI1NiIs..."
curl -sN -X POST https://your-legal-mcp-endpoint.example/mcp/ \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json, text/event-stream" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "tools/call",
    "params": {
      "name": "answer_legal_question",
      "arguments": {
        "question": "O que diz o artigo 422 do Codigo Civil?",
        "top_k": 6
      }
    }
  }'
python
from mcp import ClientSession
from mcp.client.streamable_http import streamablehttp_client

async with streamablehttp_client(
    "https://your-legal-mcp-endpoint.example/mcp/",
    headers={"Authorization": f"Bearer {token}"},
    timeout=30.0,
) as (read, write, _meta):
    async with ClientSession(read, write) as session:
        await session.initialize()
        result = await session.call_tool(
            "answer_legal_question",
            {"question": "...", "top_k": 8},
        )

Get access

Subscribe and receive your Legal MCP client token.

After confirmation, we generate a client token with every Legal MCP tool enabled so your project can start calling the MCP endpoint immediately.

MCP client token

US$0.03per 1,000 tokens

The token is created after the subscription is confirmed.

All 14 public Legal MCP tools are enabled on the client token.

The first 1,000 tokens are included for testing your integration.

Your first 1,000 tokens are free. After that, Legal MCP usage is only US$0.03 per 1,000 tokens for legal RAG and document workflows.

Tool reference

Fourteen tools across retrieval, analysis, drafting, triage, and risk review.

All tools require a valid client token with the matching scope. Each response carries requiresHumanReview so callers can preserve the lawyer-in-the-loop contract.

Search and answers

answer_legal_question

Primary user-facing RAG answer with inline citations.

question, top_k, jurisdiction

search_legal_sources

Low-level BM25 plus semantic retrieval for raw chunks.

query, limit

get_law_article

Retrieve a specific article from a numbered law.

law_number, article

explain_legal_basis

Return literal source text and neighboring chunks without LLM rewriting.

query

answer_in_area

Answer a question filtered by a legal area such as civil, labor, tax, LGPD, or corporate.

question, area, top_k, jurisdiction

Contracts and documents

check_contract_risks

Find contract risks with category, level, citation, and recommendation.

contract_text, contract_type

validate_contract_completeness

Check a contract against type-specific required fields.

contract_text, contract_type

get_clause_recommendation

Recommend essential missing clauses with templates and legal basis.

contract_text, contract_type

draft_legal_document

Generate a Brazilian legal document in markdown for lawyer review.

document_type, facts, area, parties, target_court

analyze_legal_document

Extract structured fields from legal text.

text, kind

review_legal_document

QA pass for coherence, omissions, unsupported claims, and style.

document_text, kind

Workflow and risk

legal_orchestrate

One-shot triage, RAG answer, risk markers, and optional draft.

question, include_draft, draft_type, top_k

classify_legal_case

Fast triage for area, sub-topics, risk, urgency, and required docs.

question

assess_legal_risk

Deterministic regex-based risk scan with no LLM call.

facts

Architecture

Backed by the storage and worker model needed for legal-grade retrieval.

The MCP server stays focused on authenticated tool execution while operational systems manage source quality, retrieval freshness, and usage governance.

MCP server

Authenticated MCP endpoint with 14 legal tool handlers available to client tokens.

Admin API

Client, token, job, document, chunk, search, and playground APIs.

Knowledge operations

Managed source quality, retrieval freshness, and operational review flows.

Legal knowledge layer

Versioned documents, searchable chunks, vector retrieval, token usage, and raw file custody.

Request path

01

A bearer client token enters the Legal MCP endpoint.

02

Middleware validates token claims and revocation status.

03

Tool handlers read from the legal knowledge index.

04

Operational controls remain internal and are not exposed to client tokens.

05

Usage events are recorded without blocking tool responses.

Authentication

Scoped client tokens with revocation and usage attribution.

Tokens are minted by legal-admin-api, persisted only as metadata, and rejected if expired, mis-scoped, unknown, or revoked.

Current full scope set

search_legal_sourcesget_law_articlecheck_contract_risksvalidate_contract_completenessget_clause_recommendationexplain_legal_basisanswer_legal_questionlegal_orchestrateclassify_legal_caseanswer_in_areadraft_legal_documentanalyze_legal_documentassess_legal_riskreview_legal_document
token claims
{
  "iss": "legal-admin-api",
  "aud": "legal-mcp-server",
  "sub": "<client_id>",
  "scopes": ["answer_legal_question", "search_legal_sources"],
  "iat": 1779121557,
  "exp": 1781713557,
  "jti": "<token uuid>"
}

Use cases

Built for teams embedding legal intelligence into real product workflows.

Legal MCP can sit behind a chat product, a drafting workflow, a contract review system, an IDE assistant, or an internal operations console.

Agent workflows

Call legal search, legal basis explanation, and area-scoped answers from drafting or curation nodes.

Legal copilots

Give customer-facing assistants grounded citations while keeping the final decision behind human review.

Contract operations

Screen drafts for missing clauses, risk patterns, unsupported assertions, and completeness gaps.

Knowledge coverage

Use governed legal knowledge coverage across grounded answers, document review, drafting, and risk workflows.

continue ide
name: Legal MCP Server
version: 0.2.0
schema: v1
mcpServers:
  - name: Legal MCP
    url: https://your-legal-mcp-endpoint.example/mcp/
    transport: streamable-http
    headers:
      Authorization: Bearer ${{ secrets.LEGAL_MCP_TOKEN }}

Lawyer-agent workflow

Your product can call search_legal_sources during drafting, then run explain_legal_basis, answer_in_area, and assess_legal_risk in parallel during curation.

LEGAL_MCP_URL=<provided_onboarding_endpoint>

LEGAL_MCP_TOKEN=<client_token>

LEGAL_MCP_TIMEOUT_S=30.0

LEGAL_MCP_SEARCH_K=6

Backoffice and admin

Operators control clients, tokens, search, jobs, uploads, and usage.

The admin API supports operational workflows and the Clerk-authenticated operator UI used to manage Legal MCP safely.

Jobs: GET/POST /admin/jobs, retry, cancel, detail

Documents: GET /admin/documents, /admin/documents/{id}, /admin/chunks

Search: POST /admin/search/semantic and /admin/search/hybrid

MCP clients: create, list, detail, soft delete, usage

MCP tokens: issue once, list metadata, revoke by jti

Playground: POST /admin/mcp/playground/{tool_name}

Knowledge governance

Curated legal knowledge behind the MCP endpoint.

0xAI manages the knowledge surface behind the MCP endpoint so client tokens can focus on approved legal reasoning, review, drafting, and risk workflows.

01

0xAI curates the legal knowledge surface exposed to client tokens.

02

Retrieval quality is monitored through source metadata, citations, and review signals.

03

Client integrations consume only the approved MCP tools listed in the public reference.

04

Operational controls stay internal so user tokens cannot modify the knowledge base.

Operational runbook

The daily control plane for production legal integrations.

Common operations stay explicit: issue, revoke, retry, inspect, and rotate with a clear owner path.

Issue tokens from backoffice

Create clients at /clients, issue a token, and copy the raw credential immediately.

Review operational events

Use the operations board to inspect processing status and retry controlled jobs.

Revoke leaked credentials

Delete the token by id. Revocation is observed by the MCP server cache.

Track usage

Read per-client totals, monthly breakdowns, and per-tool usage from the usage card.

Build with 0xAI

Bring Legal MCP into your product workflow.

0xAI can help scope token governance, tool access, knowledge coverage, and the integration path for your app or agent workflow.