# Brazil Case Law & Legal Research MCP: STJ, STF Jurisprudência (`siteacs/brazil-case-law-mcp`) Actor

Legal research MCP server and LLM tool for official Brazilian case law (jurisprudência) from the STJ and STF. Search by legal terms, party, lawyer or company CNPJ; one search returns the newest matching decisions as compact JSON: citation, parties, ementa summary, tese, links. Priced per search.

- **URL**: https://apify.com/siteacs/brazil-case-law-mcp.md
- **Developed by:** [SiteAcs](https://apify.com/siteacs) (community)
- **Categories:** MCP servers, AI, Agents
- **Features:** Limited permissions, Single-tenant, Server interface
- **Stats:** 1 total users, 0 monthly users, 0.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $20.00 / 1,000 searches

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Brazil Case Law MCP: STJ & STF Jurisprudência for AI Agents

**In short.** Input: one tool call to `search_brazil_case_law` with legal terms (`query`), a `party` or lawyer, or a
company `cnpj`, plus optional filters. Output: up to 20 of the newest matching STJ and STF decisions as compact JSON.
Price: **$0.02 per search** (up to 20 decisions), or $0.06 with full text for up to 5 decisions; a search with no results
is free.

MCP endpoint (Streamable HTTP, send your Apify API token as a Bearer token). Config for Claude Desktop, Cursor or any
client that takes a JSON config:

```json
{
  "mcpServers": {
    "brazil-case-law": {
      "url": "https://siteacs--brazil-case-law-mcp.apify.actor/mcp",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

Tool: `search_brazil_case_law(query, party, cnpj, court, decision_type, date_from, date_to, relator, case_class,
max_results, include_full_text)`. Give at least one of `query`, `party` or `cnpj`; every argument is described under
"The tool" below.

Example arguments (the same fields work as a normal Actor run input in camelCase):

```json
{ "query": "\"dano moral\" bagagem extraviada", "court": "both", "max_results": 5 }
```

Three fields of one returned decision:

```json
{
  "citation": "STJ, AgInt no AREsp 2999881/SP, Rel. Min. Maria Isabel Gallotti, Quarta Turma, j. 09/03/2026, publ. 13/03/2026",
  "relator": "MARIA ISABEL GALLOTTI",
  "fullTextUrl": "https://processo.stj.jus.br/SCON/GetInteiroTeorDoAcordao?num_registro=...&dt_publicacao=13/03/2026"
}
```

For bulk exports (hundreds or thousands of decisions, CSV or Excel), use
[Brazil Court Decisions & Case Law](https://apify.com/siteacs/brazil-case-law), priced per decision.

A search tool for AI agents and LLM apps that need Brazilian case law (jurisprudência). One call searches the official
case-law services of the **Superior Tribunal de Justiça (STJ)** and the **Supremo Tribunal Federal (STF)** and returns
the newest matching decisions as compact JSON: a ready-to-cite reference, the ementa, the parties and their lawyers, the
thesis (tese) and theme (tema) of binding precedents, and links to the official record and full text. Search by legal
terms, by a party or lawyer, or both.

It works three ways:

- **As an MCP server** for Claude, ChatGPT, Cursor or any MCP client: one tool, `search_brazil_case_law`.
- **Through Apify's MCP server** (mcp.apify.com), next to other Apify tools.
- **As a normal Actor run** through the API, n8n, Make or Zapier: one search per run.

You pay per search, not per decision: up to 20 decisions for one `search` event. A search that finds nothing is free.

### Em português

Ferramenta de pesquisa de jurisprudência do STJ e do STF para agentes de IA (servidor MCP) e LLMs. Cada chamada
devolve os acórdãos e as decisões monocráticas mais recentes em JSON compacto: citação pronta (tribunal, processo,
relator, órgão julgador, datas), partes e advogados, ementa, tese e tema, e links para o registro oficial e o inteiro
teor. Os dados vêm das bases oficiais de pesquisa dos tribunais. Pesquisa por termos jurídicos, por parte ou advogado
(pesquisa por parte/advogado), por CNPJ de empresa (pesquisa por CNPJ, com a razão social consultada em base pública), ou por termos e parte juntos. Preço por pesquisa: US$ 0,02 por chamada com até 20 decisões, ou US$ 0,06
com o inteiro teor de até 5 decisões. Pesquisa sem resultado não é cobrada.

### Connect it as an MCP server

The MCP endpoint is this Actor's Standby URL with the path `/mcp` (Streamable HTTP):

```
https://siteacs--brazil-case-law-mcp.apify.actor/mcp
```

Send your Apify API token as a Bearer token. In Claude Desktop, Cursor or another client that takes a JSON config:

```json
{
  "mcpServers": {
    "brazil-case-law": {
      "url": "https://siteacs--brazil-case-law-mcp.apify.actor/mcp",
      "headers": { "Authorization": "Bearer YOUR_APIFY_TOKEN" }
    }
  }
}
```

Or load it into Apify's own MCP server with `https://mcp.apify.com/?tools=siteacs/brazil-case-law-mcp`, where the tool
shows up as `siteacs--brazil-case-law-mcp--search_brazil_case_law`.

An autonomous agent with no Apify account can buy a prepaid, spend-capped Apify token at
[agi.apify.com](https://agi.apify.com) (x402 or MPP) and send it as the Bearer token here. Store search marks this
server as not taking direct agent payments because it runs in Standby, but the prepaid token works. The batch Actor
[siteacs/brazil-case-law](https://apify.com/siteacs/brazil-case-law) takes direct agent payments.

#### The tool

`search_brazil_case_law` takes:

| Argument | What it does |
|---|---|
| `query` | Legal terms in Portuguese, at most 500 characters. Words are combined with AND; quotes for a phrase; OR / NOT; parentheses to group. Example: `"dano moral" bagagem (extravio OR atraso)` |
| `party` | Only decisions where this name is listed as a party or a lawyer, e.g. `Banco do Brasil`, `INSS`, or a lawyer's name (3 to 200 characters). Matched as a phrase; accents and case ignored |
| `cnpj` | A company CNPJ (`00.000.000/0001-91` or 14 digits): decisions that list the company, by its registered name, as a party, or print the CNPJ (pesquisa por CNPJ). Sole traders (MEI) are refused. Not with `party` |
| `court` | `both` (default), `STJ` or `STF` |
| `decision_type` | `acordao` (default, collegiate judgments with an ementa), `monocratica` or `both` |
| `date_from`, `date_to` | Publication date range, `YYYY-MM-DD` |
| `relator` | Reporting minister, e.g. `Nancy Andrighi` |
| `case_class` | e.g. `REsp`, `AREsp`, `HC` (STJ) or `RE`, `ARE`, `ADI` (STF) |
| `max_results` | 1 to 20, default 10 (with full text: 1 to 5, default 3) |
| `include_full_text` | Add each decision's full text, up to 60,000 characters each (the call takes 30-60 s) |

Give `query`, `party` or `cnpj`, alone or with `query` (not `party` and `cnpj` together). Results come newest first. For a `query` alone, when more decisions match than were
returned, the answer says how many (`totalMatches` per court) and suggests how to narrow it (`hint`). A search with
`party` returns decisions, not counts: its answer has `totalMatches` and `hint` set to `null`, and the run's status
message gives no number of matches.

Operators can also be typed in lower case or in Portuguese (`ou`, `e`, `não`/`nao`); outside quotes they are read as
operators at both courts. A `query` the courts would reject (an unclosed parenthesis or quote, an operator with no
term on one side, an empty group, a lone `-`) is refused with an error and not charged.

`party` is cleaned before the search: a trailing company form (`S.A.`, `S/A`, `SA`, `S A`, `Ltda`, `ME`, `EPP`,
`EIRELI`) is dropped and `-` is read as a space, so `Banco do Brasil S/A` searches `Banco do Brasil` and `Coca-Cola`
also finds `COCA-COLA`. A company form mid-name ends it: `Petróleo Brasileiro S.A. - Petrobras` searches
`Petróleo Brasileiro` (a bare `SA` or `ME` counts mid-name only in an all-capitals name). Dotted numbers (`Tema 1.199`, `HC 598.051`) are sent to the STJ as phrases, which its search
needs.

### Run it as a normal Actor

The input fields are the same, in camelCase (`query`, `party`, `court`, `decisionType`, `dateFrom`, `dateTo`, `relator`,
`caseClass`, `maxResults`, `includeFullText`). Example:

```json
{
  "query": "\"dano moral\" bagagem extraviada",
  "court": "both",
  "maxResults": 5
}
```

Each decision is saved as a dataset item, and the whole answer (decisions, total matches per court and hint for
searches without `party`, warnings, charged event) under the key-value store key `OUTPUT`.

### Output

One decision, as the tool returns it (summary shortened here):

```json
{
  "id": "STJ-ACOR-2799402",
  "citation": "STJ, AgInt no AREsp 2999881/SP, Rel. Min. Maria Isabel Gallotti, Quarta Turma, j. 09/03/2026, publ. 13/03/2026",
  "court": "STJ",
  "decisionType": "acordao",
  "processNumber": "AgInt no AREsp 2999881/SP",
  "relator": "MARIA ISABEL GALLOTTI",
  "orgaoJulgador": "Quarta Turma",
  "judgmentDate": "2026-03-09",
  "publicationDate": "2026-03-13",
  "parties": null,
  "summary": "AGRAVO INTERNO. AGRAVO EM RECURSO ESPECIAL. PROCESSUAL CIVIL. TRANSPORTE AÉREO DE PASSAGEIROS. ATRASO EM VOO INTERNACIONAL. ...",
  "summaryIsTruncated": true,
  "tese": null,
  "tema": null,
  "url": "https://processo.stj.jus.br/SCON/SearchBRS?b=ACOR&livre=2799402...",
  "fullTextUrl": "https://processo.stj.jus.br/SCON/GetInteiroTeorDoAcordao?num_registro=...&dt_publicacao=13/03/2026"
}
```

| Field | What it holds |
|---|---|
| `citation` | Court, case, reporting minister, division, judgment (`j.`) and publication (`publ.`) dates |
| `parties` | Parties and their lawyers as the court lists them, one `ROLE: NAME` entry each (`AGDO.(A/S): BANCO DO BRASIL SA`). STJ entries keep the lawyer's OAB registration as the PDF prints it (`ADVOGADO: NAME - SP123456`); STF's lists of a lawyer's registrations in several states (`(3600/AC, 9395A/AL, ...)`) are left out to save tokens. STF: always. STJ acórdãos: only with `include_full_text` (read from the PDF). STJ monocratic decisions: `null` |
| `summary` | The ementa of an acórdão, or the opening of a monocratic decision, cut at 1,500 characters |
| `tese`, `tema` | Thesis and theme of repetitive appeals and repercussão geral, when there is one |
| `url`, `fullTextUrl` | Official record and full text on the court's site |
| `fullText`, `fullTextIsTruncated` | Only with `include_full_text` |

### Pricing

| Event | Price | When |
|---|---|---|
| `search` | $0.02 | A call that returns 1 to 20 decisions |
| `search-with-full-text` | $0.06 | A call with `include_full_text` that returns 1 to 5 decisions and at least one full text (if no full text comes back in time, it is charged as a plain `search`) |

A call that finds nothing, has invalid arguments, or cannot reach either court is not charged, and neither is an MCP
call whose client disconnected before the answer was ready. If your maximum cost per run does not cover one more
event, the call stops and charges nothing. Every run, whether a normal run or an MCP server start, also pays Apify's fixed
Actor-start fee ($0.00005). Through the MCP server URL your Apify account also pays the platform usage of the server run
until the platform shuts it down after its idle time.

For bulk exports (hundreds or thousands of decisions, every field, CSV or Excel), use
[Brazil Court Decisions & Case Law](https://apify.com/siteacs/brazil-case-law) instead, priced per decision.

### Sources and limits

- Data comes from the courts' public search services, the ones behind
  [scon.stj.jus.br](https://scon.stj.jus.br/SCON/) and [jurisprudencia.stf.jus.br](https://jurisprudencia.stf.jus.br/).
  Only published decisions are returned. New decisions show up when the courts publish them.
- What `query` searches: at STF, the ementa, indexing, thesis and theme, observation notes, legislation and precedents
  cited, case number and, for monocratic decisions, the decision text; at STJ, every field SCON searches by default,
  which includes its party index. What `party` searches: only each court's own party list (STF's "Partes" field,
  STJ's party index, both holding parties and their lawyers), never the decision text. A longer name that contains
  the phrase also matches (`Banco do Brasil` also finds `CASSI - Caixa de Assistência dos Funcionários do Banco do
  Brasil`).
- Plain searches take 2-10 s. Full-text calls take 30-60 s: STJ full text comes from the official PDF of each
  acórdão. A call stops waiting for the courts after 30 s and for PDFs after 40 s; decisions whose full text was
  skipped keep their `fullTextUrl`, and the answer says so in `warnings`.
- Broad STJ searches, mostly of monocratic decisions, can be cancelled by the court (Oracle error ORA-01013); the
  warning names the base. Add terms, a phrase or a date range.
- This is a research tool, not legal advice. Check every decision on the court's site before relying on it.

### Company search by CNPJ (pesquisa por CNPJ)

The `cnpj` argument (the same name in the tool and in a run's input) takes a company's CNPJ, formatted (`00.000.000/0001-91`) or as 14 digits, and returns decisions about that
company:

1. The number is checked (14 digits, valid check digits) and looked up in a free public CNPJ registry built on the
   Receita Federal's open data: [BrasilAPI](https://brasilapi.com.br) first, then [Minha Receita](https://minhareceita.org)
   if it does not answer. Only the number is sent, directly, with no proxy. Only the registered name (razão social),
   the trade name (nome fantasia), the legal nature and the MEI flag (`opcao_pelo_mei`) are read from the answer.
2. Both courts' party lists are searched for the registered name **with its company form**, in each spelling the
   courts index: `BANCO DO BRASIL SA` is sent as `BANCO DO BRASIL S.A.`, `S/A`, `SA` and `S A`, so the bank is found
   and `CAIXA DE ASSISTENCIA DOS FUNCIONARIOS DO BANCO DO BRASIL` is not. A status after the name (`EM RECUPERACAO
   JUDICIAL`, `EM LIQUIDACAO EXTRAJUDICIAL`) is dropped first. Decisions that print the CNPJ in their text (full text
   included at STF) are found too; the number alone finds only a handful of decisions per company.
3. **Every row with a party list is checked before it is saved**: every STF row, and STJ acórdãos when
   `include_full_text` is on (their party list comes from the PDF). A row is kept only when a party entry, after its
   role label, starts with the company's name followed by the end, a company form, `-`, `E OUTRO(A/S)` or `EM
   RECUPERACAO` (`PETRÓLEO BRASILEIRO S/A - PETROBRAS` passes; `PETROBRAS TRANSPORTE S.A. - TRANSPETRO`, `FUNDAÇÃO
   PETROBRAS ...`, `RIO CLARO ...` and people named Vale do not), or when the court reports the CNPJ match. Rows that
   fail are left out of the answer (the answer warns when that happens). **STJ rows without a party list (monocratic decisions, and acórdãos without
   full text) are not verified**: SCON matches the phrase anywhere in its party index, so check `parties` or turn on
   `include_full_text` when precision matters.
4. The trade name is searched too when it names the company: it is cut at `-` (`PETROBRAS - EDISE` searches
   `PETROBRAS`), office words at its end are dropped (`MATRIZ`, `SEDE`, `EST UNIF`, ...), and none is searched when it
   names an office or department (`DIRECAO GERAL`, `DEPARTAMENTO ...`), has digits, or repeats the registered name.
   At the STJ the trade name is sent only where the row can be checked (acórdãos with full text).
5. Each row carries `searchCnpj`, `searchCompanyName` (the razão social) and `matchedBy`: `party` when its party list
   names the company by the rule above, `cnpj-text` when the CNPJ matched in its text, or null when the row cannot
   show it (unverified STJ rows).

Refused before any court request, and not charged:

- **Natural persons**: legal nature 213-5 (empresário individual, which every MEI is), the whole group 4 "pessoas
  físicas" (produtor rural, leiloeiro, contribuinte individual, ...), a record without a 4-digit legal nature, the MEI
  flag, and a registered name with a run of 8 or more digits (MEI names often hold the owner's CPF). Such a name is
  never shown in the log, the error or the answer. Shorter numbers in a company's name are fine (`3M DO BRASIL`,
  `B3 S.A.`, `99 TECNOLOGIA`); a trade name with digits is simply not searched.
- A CNPJ with wrong check digits, one the registries do not know, or any CNPJ while the registries do not answer (the
  search is never run without the name).
- `cnpj` together with `party`. It works alone or with `query`.

Like a party search, a CNPJ search returns decisions, not counts (`totalMatches` and `hint` are null); the answer names the `cnpj` and `companyName` searched. The registry lookup counts against the call's time limit (at most 5 s per registry). CPF numbers stay refused in every field.

### Perguntas frequentes

**Meu agente de IA consegue fazer pesquisa de jurisprudência nos tribunais superiores?**
Sim, no STJ e no STF. Conecte o servidor MCP e peça a `search_brazil_case_law` os acórdãos sobre um tema: cada chamada
devolve as decisões mais recentes com a citação pronta, a ementa, o relator, o órgão julgador, a tese e o tema, e um
link para o inteiro teor no site do tribunal (ou o próprio inteiro teor, com `include_full_text`). Nenhum outro tribunal
é pesquisado, e o resultado não substitui a conferência da decisão no site do tribunal. Para exportar muitas decisões
de uma vez, use o Actor [Brazil Court Decisions & Case Law](https://apify.com/siteacs/brazil-case-law).

### Official published decisions only

The tool returns decisions the courts publish in their official case-law search, with the fields they publish,
including the parties and lawyers they list. It searches one name at a time and returns decisions; it does not build
profiles of people or totals per person.

- No CPF search: an argument with 9 or more digits outside the number forms the tool recognises is refused with an
  error and not charged, however the digits are punctuated or split; so is a court wildcard (`?`, `$`, `*`, `%`, `_`)
  next to a digit. Recognised forms, each in its exact printed format: CNJ case numbers, CNPJs, STJ registration
  numbers, `R$` amounts below R$ 100 million, dates, years, OAB numbers, and numbers right after a case class or statute
  word (`REsp 1.810.170/RS`, `Tema 1.199`, `lei 8.112/90`). Numbers side by side count together: put a word between
  them (`arts. 165, 458 e 535`). Write amounts of R$ 100 million or more in millions (`R$ 150 milhões`).
- CPF numbers printed in court texts are masked (`***.***.***-**`) in every field of the answer, however they are
  punctuated (`nº.123.456.789-09`, `123.456.789- 09`, `123456789-09`), with or without the word "CPF" before them.
- SCON field syntax typed into an argument (`.TXT.`, `.PART.` or `[PART]`, also with spaces before them, `inpath(...)`,
  `@` references) is refused and not charged. Abbreviations such as `Ind.Com.Ltda.` or `Ag.Rg.` are fine.
- Court decisions name private people. Under the LGPD (Lei 13.709/2018) the buyer needs a lawful purpose for
  processing them: legal research, litigation and compliance work are typical; screening job applicants or tenants, or
  building profiles of people, are not uses this tool is meant for.

# Changelog

This Actor's version history is a separate document: https://apify.com/siteacs/brazil-case-law-mcp/changelog.md

# Actor input Schema

## `query` (type: `string`):

Legal terms in Portuguese (jurisprudência), at most 500 characters. Words are combined with AND; use quotes for a phrase, OR / NOT between terms and parentheses to group. Example: "dano moral" bagagem (extravio OR atraso). Optional when "party" or "cnpj" is set.

## `party` (type: `string`):

Only decisions where this name is listed as a party or lawyer, e.g. Banco do Brasil, Petrobras, INSS or a lawyer's name (3 to 200 characters). Matched as a phrase against each court's own party list, never the decision text; accents and case are ignored. A trailing S.A., S/A, SA, Ltda, ME, EPP or EIRELI is dropped and "-" is read as a space; a company form mid-name ends the name (Petróleo Brasileiro S.A. - Petrobras searches Petróleo Brasileiro). Works alone or with "query". CPF numbers are refused. Party searches return no match counts.

## `cnpj` (type: `string`):

Only decisions about this company: its registered name (razão social, and its trade name when it names the company) in the party list, or the CNPJ printed in the decision text. Formatted (00.000.000/0001-91) or 14 digits, with valid check digits. The name is looked up in a free public CNPJ registry (BrasilAPI, falling back to Minha Receita); only the number is sent. Natural persons with a CNPJ (empresário individual, MEI, produtor rural and the other pessoa física legal natures, or any record without a legal nature) are refused, as are unknown CNPJs and searches while the registries are down, all free. The registered name is searched with its company form (BANCO DO BRASIL S.A., S/A, SA); rows whose party list names a different company with a similar name are left out. STJ rows without a party list (monocratic decisions, acórdãos without full text) are not verified. Not together with "party"; works alone or with "query". CNPJ searches return no match counts.

## `court` (type: `string`):

STJ (Superior Tribunal de Justiça) decides federal law; STF (Supremo Tribunal Federal) decides constitutional questions. "both" searches the two and shares maxResults between them.

## `decisionType` (type: `string`):

acordao = collegiate judgments with an ementa, best for citing precedent. monocratica = decisions signed by one minister. both = either.

## `dateFrom` (type: `string`):

Earliest publication date, format YYYY-MM-DD, e.g. 2025-01-01. Narrows broad queries. Leave empty for no lower limit.

## `dateTo` (type: `string`):

Latest publication date, format YYYY-MM-DD, e.g. 2025-12-31. Leave empty for no upper limit.

## `relator` (type: `string`):

Name of the minister who reported the decision, e.g. Nancy Andrighi or Cármen Lúcia. Ministers only. Accents and case are ignored. Leave empty for any relator.

## `caseClass` (type: `string`):

Case class abbreviation, letters and spaces only, e.g. REsp, AgInt no AREsp, HC (STJ) or RE, ARE, ADI (STF). Leave empty for any class.

## `maxResults` (type: `integer`):

How many of the newest matching decisions to return: an integer from 1 to 20, e.g. 10 (default); with full text 1 to 5, default 3. A search costs the same for 1 or 20 decisions.

## `includeFullText` (type: `boolean`):

true or false (default false). Adds the full text (inteiro teor) of each decision (up to 60,000 characters each), charged as a search-with-full-text event instead of a search event. The call takes 30-60 s. Leave off to search first, then open a decision's fullTextUrl.

## Actor input object example

```json
{
  "query": "\"dano moral\" bagagem extraviada",
  "court": "both",
  "decisionType": "acordao",
  "includeFullText": false
}
```

# Actor output Schema

## `decisions` (type: `string`):

One item per decision found: citation, summary, thesis, links and, when asked, full text.

## `answer` (type: `string`):

The same decisions plus total matches per court, a hint for narrowing, warnings and the charged event, as one JSON object.

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "query": "\"dano moral\" bagagem extraviada"
};

// Run the Actor and wait for it to finish
const run = await client.actor("siteacs/brazil-case-law-mcp").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "query": "\"dano moral\" bagagem extraviada" }

# Run the Actor and wait for it to finish
run = client.actor("siteacs/brazil-case-law-mcp").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "query": "\\"dano moral\\" bagagem extraviada"
}' |
apify call siteacs/brazil-case-law-mcp --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,siteacs/brazil-case-law-mcp"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/i3skgQqf17vlifxzc/builds/MArTiL0kHqrLOi477/openapi.json
