Documentazione
Guide di integrazione MCP Server, REST API e SDK per anonym.legal e cloak.business
Configurazione MCP Server
Trasporto HTTP: https://anonym.legal/mcp · 7 strumenti · nessuna installazione richiesta
Claude Desktop
Aggiungi a claude_desktop_config.json:
{
"mcpServers": {
"anonym-legal": {
"type": "http",
"url": "https://anonym.legal/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
macOS: ~/Library/Application Support/Claude/claude_desktop_config.jsonWindows: %APPDATA%\Claude\claude_desktop_config.json
Cursor IDE
Aggiungi alle impostazioni MCP di Cursor (Settings › Features › MCP):
{
"mcpServers": {
"anonym-legal": {
"type": "http",
"url": "https://anonym.legal/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
7 strumenti MCP
| Strumento | Descrizione |
|---|---|
anonymize_text | Anonimizza il testo — replace, redact, hash, encrypt, mask o keep per singola entità |
analyze_text | Rileva le entità PII — restituisce posizioni, tipi e punteggi di affidabilità |
detokenize_text | Ripristina i valori originali dai token di sessione |
get_balance | Verifica il saldo dei token rimanenti |
estimate_cost | Stima il costo in token prima di chiamare anonymize_text |
list_sessions | Elenca le sessioni di anonimizzazione attive |
delete_session | Elimina una sessione — cancellazione ai sensi dell'art. 17 GDPR |
Prerequisiti
| Requisito | Obbligatorio | Descrizione |
|---|---|---|
anonym.legal account | Sì | Piano Pro o Business (l'MCP Server non è disponibile nei piani Free/Basic) |
API key | Sì | Inviato come Authorization: Bearer YOUR_API_KEY header — non è necessario installare Node.js o npm |
MCP client | Sì | Qualsiasi client che supporti il trasporto HTTP (Claude Desktop, Cursor, VS Code, Windsurf, Continue, Cline) |
REST API
REST API di anonym.legal — nessun SDK richiesto, integrazione HTTP diretta
URL di base
https://api.anonym.legal/v1
Autenticazione
Includi la tua chiave API nell'header Authorization:
Authorization: Bearer your-api-key
POST/anonymize
Anonimizza il testo e rileva le entità PII.
Corpo della richiesta
{
"text": "John Smith's email is john@example.com",
"method": "replace",
"language": "en",
"entities": ["PERSON", "EMAIL_ADDRESS"]
}
Risposta
{
"anonymized": "Max Mueller's email is max.mueller@example.de",
"entities": [{ "type": "PERSON", "original": "John Smith", "start": 0, "end": 10 }],
"tokens_used": 2
}
POST/detokenize
Ripristina i valori originali dai token di sessione.
{ "text": "enc_xK9mP2... email is enc_jL7nQ4...", "session_id": "abc123" }
Esempi di codice
REST API di anonym.legal — Python, JavaScript, cURL
Python (requests)
import requests
API_KEY = "your-api-key"
BASE_URL = "https://api.anonym.legal/v1"
def anonymize(text, method="replace"):
response = requests.post(
f"{BASE_URL}/anonymize",
headers={"Authorization": f"Bearer {API_KEY}"},
json={"text": text, "method": method}
)
return response.json()
result = anonymize("Contact John at john@example.com")
print(result["anonymized"])
# → "Contact Max Mueller at max.mueller@example.de"
JavaScript / Node.js
const BASE_URL = 'https://api.anonym.legal/v1';
const API_KEY = 'your-api-key';
const result = await fetch(`${BASE_URL}/anonymize`, {
method: 'POST',
headers: { 'Authorization': `Bearer ${API_KEY}`, 'Content-Type': 'application/json' },
body: JSON.stringify({ text: 'Contact John at john@example.com', method: 'replace' })
}).then(r => r.json());
console.log(result.anonymized);
// → "Contact Max Mueller at max.mueller@example.de"
cURL
curl -X POST https://api.anonym.legal/v1/anonymize \
-H "Authorization: Bearer your-api-key" \
-H "Content-Type: application/json" \
-d '{"text":"Contact John at john@example.com","method":"replace"}'
Metodi di anonimizzazione
Scegli il metodo più adatto al tuo caso d'uso
replace
Predefinito
Sostituisce le PII con dati fittizi realistici. Mantiene la leggibilità del documento.
"John Smith" → "Max Mueller"
redact
Rimuove completamente le PII. Irreversibile ma con la massima privacy.
"john@example.com" → "[REDACTED]"
hash
SHA-256
Hash crittografico unidirezionale. Pseudonimizzazione coerente.
"555-0123" → "a7f3c9d2..."
encrypt
AES-256-GCM
Crittografia di livello militare. Completamente reversibile con la chiave corretta.
"DE89370400..." → "enc_xK9mP2..."
mask
Visibilità parziale con caratteri mascherati. Mostra la struttura.
"4532-1234-5678-9012" → "4532-****-****-9012"
Hai bisogno di aiuto?
Il nostro team è pronto ad aiutarti a integrare Anonymize.dev nel tuo flusso di lavoro.