leis-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| LEIS_RG | No | ripgrep program. | rg |
| LEIS_GIT | No | git program. | git |
| LEIS_LOG | No | Log level: erro, aviso, info or depuracao. The log goes to stderr. | info |
| LEIS_RAMO | No | Branch of the corpus. | main |
| LEIS_CLONE | No | Folder of the partial clone. | ~/.cache/leis-mcp/acervo |
| LEIS_CORPO | No | Folders whose body goes into the FTS5 index, for example constituicao,federal/leis-ordinarias. | |
| LEIS_ESCOPO | No | Spheres and folders in the clone, for example constituicao,federal,estaduais/SP,municipais/SP/campinas. | constituicao,federal |
| LEIS_INDICE | No | SQLite file of the index. | ~/.cache/leis-mcp/indice.sqlite |
| LEIS_REMOTO | No | Git repository of the corpus. | https://github.com/viniciusdsandrade/leis.git |
| XDG_CACHE_HOME | No | When set, the cache folder is $XDG_CACHE_HOME/leis-mcp. | |
| LEIS_ORCAMENTO_TOKENS | No | Token budget of each result. | 8000 |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
This server publishes no instructions, or was last inspected before Glama recorded them.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": true
} |
| resources | {
"listChanged": true
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| leis_buscarA | Busca normas no acervo local por palavras e filtros. Devolve itens compactos com caminho, título, tipo, número, data, UF, ementa, situação, fonte, versao_texto, baixado_em e marca de OCR. Use o cursor para a próxima página. |
| leis_obterA | Lê uma norma por caminho, URN ou citação, inteira (paginada por artigo) ou só um dispositivo. Omite redações tachadas por padrão e avisa. Se a citação for ambígua, devolve candidatos. |
| leis_facetasA | Conta normas por esfera, tipo, UF, órgão, tribunal, município e década, com os mesmos filtros de leis_buscar. |
| leis_coberturaA | Mostra as lacunas de um recorte (COBERTURA.md, PROGRESSO.md e _falhas.jsonl) e o estado do índice local: commit, data do sync, escopo e totais. |
| leis_autoriaA | Mostra quem assinou uma norma (autor, coautores e origem da autoria) ou lista as normas de um signatário. Vem da base inicial do histórico; as datas vêm do cabeçalho. |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
No prompts | |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
No resources | |
TDQS
Scored across 5 tools
Each tool targets a distinct operation: leis_buscar lists matching norms, leis_facetas aggregates counts, leis_obter retrieves a single norm's text, leis_cobertura reports index/coverage diagnostics, and leis_autoria handles authorship. The shared filter vocabulary between buscar and facetas is explicitly signposted, and their outputs (items vs. counts) are clearly different, so an agent can select confidently.
All names share the same 'leis_' namespace prefix and are lowercase snake-style, which makes the set predictable. The only wrinkle is a mixed verb/noun pattern (buscar, obter are verbs; facetas, cobertura, autoria are nouns), but this still reads naturally and doesn't impede selection.
Five tools is a tight, well-scoped surface for a local legal-norm archive: one search, one fetch, one aggregation, one diagnostics, one authorship. Nothing appears redundant and no obvious capability is bolted on unnecessarily.
The read-only lifecycle for the domain is well covered: discovery (buscar), retrieval (obter), aggregation (facetas), corpus health (cobertura), and provenance (autoria). Minor gaps exist — no dedicated version-history/comparison tool despite versao_texto being exposed, and no explicit export/raw-text operation — but agents can work around these via obter.