Skip to main content
Glama
alesop95
by alesop95

Consulente Legale

Assistente legale locale per uso privato e aziendale, basato sul corpus della legislazione italiana (italia-corpus). Realizzato come MCP server locale interrogato da Claude Desktop.

  • Usa l'abbonamento Claude Team — il ragionamento lo fa Claude Desktop chiamando i tool dell'MCP server. Nessun costo API pay-as-you-go.

  • Locale e privacy-first: corpus, indice e ricerca interamente sulla tua macchina. Solo la conversazione (domanda + estratti restituiti) passa per Claude Desktop.

  • No GPU: ricerca BM25 / full-text (SQLite FTS5). Indicizzazione veloce.

  • Sempre aggiornato: il corpus è un clone locale di italia-corpus, aggiornabile con git pull e reindicizzazione incrementale (scripts/update_corpus.py).

  • Codici fondamentali inclusi: civile, penale, procedura civile, navigazione e penali militari, il cui articolato manca in italia-corpus, sono scaricati da Normattiva e versionati nel repo (data/codici-extra).

  • Lacune di italia-corpus colmate dalla fonte ufficiale: il corpus di terze parti rispecchia il catalogo delle collezioni preconfezionate di Normattiva, che non comprende la legge ordinaria, il decreto-legge vigente e la Costituzione. Queste classi vengono recuperate dall'API Open Data di Normattiva (scripts/fetch_normattiva.py) e indicizzate accanto alle altre. La misura della lacuna è in docs/audit-completezza-corpus.md.

  • Completezza verificabile a comando: scripts/check_completezza.py confronta il corpus con le tipologie dichiarate dalla fonte e con una lista di atti notori, e fallisce dicendo cosa manca invece di restituire un totale rassicurante.

⚠️ Strumento informativo, non costituisce consulenza legale. Per uso professionale fare sempre riferimento alla Gazzetta Ufficiale / Normattiva.

Stato

Funzionante e verificato end-to-end in Claude Desktop: alla domanda risponde citando gli articoli con il loro URN, dal corpus locale, senza ricorso al web. Vedi HANDOFF.md per architettura, stack e decisioni.

Related MCP server: vectorise-mcp

Installazione

Windows, un clic (consigliata per l'uso finale)

Prerequisito: Claude Desktop già installato (piano Team). Non serve altro software preesistente: né Python, né git, né conoscenze tecniche.

Per procurarsi il progetto senza usare git, sulla pagina GitHub del repository si preme il pulsante verde Code, poi Download ZIP, e si estrae lo ZIP scaricato in una cartella a piacere. Fatto questo, doppio clic su install.cmd dentro quella cartella.

Lo script, senza privilegi di amministratore, installa git e uv se mancano, configura git per i percorsi lunghi (i nomi-file del corpus superano i 260 caratteri di Windows), scarica il corpus, costruisce l'indice e registra il server legge-it in Claude Desktop preservando gli altri server. La prima esecuzione richiede una connessione internet e dura tipicamente 15-20 minuti (il tempo dipende dalla velocità della connessione e dal disco): la maggior parte è download del corpus (circa 2 GB) e costruzione dell'indice. Si apre una finestra nera con scritte tecniche in inglese e italiano: è normale, non richiede di leggerla né di intervenire, va solo lasciata finire.

Se Windows mostra un avviso blu "Windows ha protetto il PC" (SmartScreen, tipico sui portatili aziendali con antivirus gestito dall'IT), è perché lo script è scaricato da internet e non firmato digitalmente, non perché sia dannoso: si sceglie Ulteriori informazioni e poi Esegui comunque. In caso di dubbio, verificare con il proprio reparto IT prima di procedere.

Se qualcosa va storto a metà (connessione caduta, PC spento), si può rilanciare install.cmd tutte le volte che serve: riprende da dove serve senza ripetere i passi già completati (per esempio non riscarica il corpus se è già presente) e non danneggia nulla.

Al termine: chiudere del tutto Claude Desktop (anche dall'icona nella tray vicino all'orologio) e riaprirlo. Per verificare che tutto funzioni, fare una domanda di diritto italiano qualsiasi (per esempio "quali sono i termini di prescrizione per il reato di omicidio?"): la risposta deve citare gli articoli con il loro riferimento normativo (URN) e chiudersi con un disclaimer.

Manuale (sviluppatori, o altri OS)

uv run python scripts/setup.py        # clona il corpus, sincronizza l'ambiente, indicizza

Poi registrare il server nel client. Per Claude Code è già pronto .mcp.json in radice: basta aprire il progetto e approvare il server. Per Claude Desktop aggiungere a claude_desktop_config.json (usare il percorso assoluto di uv se non è nel PATH):

"legge-it": {
  "command": "uv",
  "args": ["--directory", "E:\\legal-consultant", "run", "python", "-m",
           "legal_consultant.mcp_server"]
}

Uso

Setup permanente: il Project (consigliato)

In Claude Desktop creare un Project "Consulente Legale" e incollare nel campo istruzioni il testo di prompts/consulente-legale.md. Impone di usare solo gli strumenti legge-it, mai la ricerca web, e di citare atto e articolo con l'URN. Da lì ogni chat nel progetto si comporta da consulente legale senza altre indicazioni.

Setup veloce: istruzione nella singola domanda

Senza Project, si antepone alla domanda l'istruzione esplicita:

Usando esclusivamente lo strumento legge-it e senza fare ricerche sul web,
<domanda di diritto italiano>.

Alla prima chiamata di ogni strumento scegliere Consenti sempre per non rivedere il prompt di permesso.

Strumenti esposti

cerca_normativa (ricerca BM25 → estratti citabili), leggi_atto (testo integrale di un atto o articolo per URN), info_corpus (ampiezza e freschezza della base normativa).

Aggiornamento della normativa

L'installazione Windows registra da sé un'attività pianificata (ConsulenteLegale-Aggiornamento) che ogni giorno alle 6:00, se il PC è acceso e l'utente ha effettuato l'accesso, aggiorna il corpus e — al più una volta alla settimana — i codici fondamentali, reindicizzando solo ciò che è cambiato. Non richiede alcun intervento manuale né privilegi di amministratore; l'esito di ogni esecuzione si trova in data/index/auto_update.log. Se la registrazione automatica fallisse (per esempio per una policy aziendale che limita l'Utilità di pianificazione), l'installer lo segnala ma prosegue comunque: l'aggiornamento va allora lanciato a mano, con lo stesso script che usa l'attività pianificata:

uv run python scripts/auto_update.py      # corpus + codici, con la stessa logica dell'attività pianificata

Restano disponibili anche i due passaggi separati, utili per un aggiornamento mirato o per un sistema diverso da Windows:

uv run python scripts/update_corpus.py     # solo il corpus: fetch + reset incrementale
uv run python scripts/fetch_codici.py      # ri-scarica i codici fondamentali da Normattiva
uv run python scripts/fetch_normattiva.py  # colma le classi assenti da italia-corpus
uv run python scripts/fetch_atto.py <urn>  # recupera un singolo atto dato il suo URN

Verificare che la base normativa sia completa

uv run python scripts/check_completezza.py

Confronta le tipologie di atto che Normattiva dichiara con quelle presenti nell'indice, e verifica una per una una lista di leggi che uno studio consulta davvero. Esce con codice 1 e dice quale classe manca e quale atto atteso non si trova. È il rimedio a un difetto reale del corpus di terze parti, documentato in docs/audit-completezza-corpus.md: dichiarava sync completo mentre mancavano oltre novemila leggi vigenti, e nulla lo segnalava.

Al primo avvio il recupero delle classi mancanti è progressivo: l'installer ne fa una parte a partire dagli anni recenti e l'attività pianificata completa il resto nei giorni successivi, perché il recupero storico dal 1861 richiede ore. Finché non è finito, il comando qui sopra dice esattamente quanto resta.

Limiti noti

Il filtro dei soli atti vigenti esclude la collezione delle abrogate, ma non garantisce la vigenza odierna di ogni singolo atto: verificare sempre su Normattiva. La ricerca è lessicale (BM25): per l'articolo esatto di un codice il consulente usa leggi_atto. Il corpus contiene solo testo legislativo: nessuna giurisprudenza e nessuna dottrina, e le ragioni per cui l'estensione è stata circoscritta alla sola Corte costituzionale sono in docs/giurisprudenza-fattibilita.md.

Available Tools

3 tools
cerca_normativaA

Cerca nella legislazione italiana e restituisce gli estratti normativi piu pertinenti (ranking BM25). USA SEMPRE questo strumento prima di rispondere a una domanda di diritto italiano: non rispondere a memoria. Ogni risultato porta urn, atto, articolo e un estratto: cita sempre atto e articolo nella risposta.

query: testo libero (concetti, parole chiave). solo_vigenti: se True esclude gli atti abrogati. limit: numero massimo di estratti (default 8).

ParametersJSON Schema
NameRequiredDescriptionDefault
limitNo
queryYes
solo_vigentiNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A4.3/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the explanatory burden. It discloses the BM25 ranking behavior, the result fields, the effect of solo_vigenti, and the instruction to cite act and article. It conveys that this is a read/search operation, and there are no hidden destructive side effects.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is compact and every sentence earns its place: the search behavior, the mandatory usage instruction, the output citation rule, and parameter semantics are all included without waste. The imperative 'USA SEMPRE' is intentionally attention-grabbing and reinforces the priority of this tool.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The description is nearly complete for invocation: it explains purpose, when to use, all parameters, and the structure of results. It could be slightly richer by explaining how it relates to sibling tools or what to do when the ordinary law details are not sufficient, but nothing essential is missing for calling the tool correctly.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters5/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, but the description compensates fully by defining every parameter: query as free text, solo_vigenti as excluding repealed acts, and limit as the maximum number of extracts with a default of 8. This adds substantial meaning beyond the bare schema types and titles.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool searches Italian legislation and returns the most relevant normative extracts using BM25 ranking, which is specific and action-oriented. It does not explicitly mention sibling tools, but the search scope is clear enough for an agent to distinguish it from leggi_atto and info_corpus.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It gives an explicit usage directive: always use this tool before answering Italian law questions and do not answer from memory. However, it does not state when not to use it or mention alternatives, so the guidance is strong on when but not on exclusions.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

info_corpusA

Stato e freschezza del corpus indicizzato: numero di atti e di chunk, commit e data dell'ultimo aggiornamento del corpus. Usalo per dire all'utente quanto e' aggiornata e ampia la base normativa su cui si fonda la risposta, e cita sempre il disclaimer in calce.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.5/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the full burden of behavioral disclosure. It explains what informational data the tool returns (act count, chunk count, commit, update date) and also instructs the agent to cite the disclaimer. This is sufficient for a read-only status tool, though it does not explicitly state that no mutations occur.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two sentences with no redundancy: the first sentence front-loads the tool's purpose and output data, and the second explains the intended usage context. Every clause earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple informational tool with no parameters and no output schema, the description is complete: it names the output fields, gives an explicit use case, and adds the disclaimer instruction. An agent has all it needs to decide when to call this tool and how to present the results.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters and full schema coverage, so the description does not need to clarify any inputs. According to the baseline for parameterless tools, a score of 4 is appropriate; the description adds no irrelevant parameter information.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly identifies the tool as providing status and freshness of the indexed corpus, including specific outputs: number of acts, number of chunks, commit, and last update date. This domain is distinct from siblings cerca_normativa (search) and leggi_atto (read), so an agent can easily tell it apart.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description explicitly states when to use the tool: to tell the user how up-to-date and broad the normative base supporting the answer is, and to cite the disclaimer. It lacks explicit 'when not to use' guidance, but the use case is clearly described and the tool's scope is obvious from the context.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

leggi_attoA

Legge il testo integrale di un atto, o di un suo singolo articolo, dall'indice. Identifica l'atto per urn (preferito, lo restituisce cerca_normativa) oppure per path. Con articolo valorizzato restituisce solo quell'articolo. Usalo per leggere il testo completo dopo che cerca_normativa ha individuato l'atto rilevante.

ParametersJSON Schema
NameRequiredDescriptionDefault
urnNo
pathNo
articoloNo

TDQS

A4.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden and does well: it discloses that the tool is a read operation ('Legge'), that it sources from an index, that it can return a whole act or a single article, and that urn is preferred over path. It stops short of explaining error behavior or response format, which is a minor gap for a retrieval tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Three dense sentences with no filler. The main purpose is front-loaded, and every sentence adds useful information: the object being read, the identification methods, the article filter, and the recommended workflow.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple read tool with no output schema and no annotations, the description is largely complete: it explains the selector parameters and the workflow with the key sibling. It could add what happens when no matching act is found or what the returned text looks like, but the core calling context is well covered.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 0%, so the description must compensate, and it does: it defines urn as the preferred identifier, path as an alternative, and articolo as an optional filter that restricts output to a single article. It adds semantics that the bare schema does not provide, though it leaves details like value formats implied.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a specific verb and resource: 'Legge il testo integrale di un atto, o di un suo singolo articolo, dall'indice.' It makes clear this tool reads full legal text, and it distinguishes itself from cerca_normativa by defining the workflow: cerca_normativa finds the act, this tool reads it.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines5/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states when to use the tool: 'Usalo per leggere il testo completo dopo che cerca_normativa ha individuato l'atto rilevante.' It also frames urn as the preferred identifier because it is returned by cerca_normativa, giving concrete routing guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

A4.5/5.0
Disambiguation5/5

Each tool targets a distinct function: searching legislation, reading a full act or article, and inspecting corpus metadata. There is no meaningful overlap between search results and full-text retrieval, and the corpus info tool is clearly separate.

Naming Consistency4/5

Two tools use a clear imperative verb_noun pattern ('cerca_normativa', 'leggi_atto'), while 'info_corpus' is a noun phrase. This is a minor inconsistency, but all names are readable, lowercase, snake_case, and descriptive.

Tool Count5/5

Three tools is a compact, well-scoped set for a legal-research assistant. Each tool serves a necessary step in the workflow: search, retrieve full text, and assess corpus freshness.

Completeness5/5

The tool surface covers the core research loop: find relevant norms, read the full text, and validate the corpus behind the answer. No obvious gap exists for the stated purpose since the corpus is read-only and requires no create/update/delete operations.

Maintenance

ActivityActive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    F
    maintenance
    A local MCP server that integrates with Claude Desktop, enabling RAG capabilities to provide Claude with up-to-date private information from custom LlamaCloud indices.
    225
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    Local MCP server that indexes folders of documents into a hybrid vector + keyword search index for Claude Desktop, with support for PDFs, Office files, and images via OCR.
    MIT
  • F
    license
    Not graded
    quality
    B
    maintenance
    Unifies 14 Argentine legal connectors (JUBA, SCBA, CSJN, SAIJ, PJN Jurisprudencia, BORA, BOPBA, InfoLEG, Normativa PBA, PTN, TFN, PJN Consulta, Portal PJN, JusCABA) into a single MCP server for Claude Desktop, enabling local, read-only access to jurisprudencia, legislation, and legal documents.

Latest Blog Posts

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/alesop95/legal-consultant'

If you have feedback or need assistance with the MCP directory API, please join our Discord server