Dokumentacija
Vodiči za integraciju MCP Server, REST API i SDK za anonym.legal i cloak.business
Podešavanje MCP Server-a
HTTP transport: https://anonym.legal/mcp · 7 alata · instalacija nije potrebna
Claude Desktop
Dodaj u 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
Dodaj u Cursor MCP podešavanja (Settings › Features › MCP):
{
"mcpServers": {
"anonym-legal": {
"type": "http",
"url": "https://anonym.legal/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
7 MCP alata
| Alat | Opis |
|---|---|
anonymize_text | Anonimizuje tekst — replace, redact, hash, encrypt, mask ili keep po entitetu |
analyze_text | Detektuje PII entitete — vraća pozicije, tipove i ocene pouzdanosti |
detokenize_text | Vraća originalne vrednosti iz sesijskih tokena |
get_balance | Proverava preostali broj tokena |
estimate_cost | Procenjuje potrošnju tokena pre poziva anonymize_text |
list_sessions | Prikazuje listu aktivnih sesija anonimizacije |
delete_session | Briše sesiju — brisanje po GDPR čl. 17 |
Preduslovi
| Zahtev | Obavezno | Opis |
|---|---|---|
anonym.legal account | Da | Pro ili Business plan (MCP Server nije dostupan u Free/Basic planovima) |
API key | Da | Šalje se kao Authorization: Bearer YOUR_API_KEY header — Node.js ili npm instalacija nisu potrebni |
MCP client | Da | Bilo koji klijent koji podržava HTTP transport (Claude Desktop, Cursor, VS Code, Windsurf, Continue, Cline) |
REST API
anonym.legal REST API — SDK nije potreban, direktna HTTP integracija
Osnovni URL
https://api.anonym.legal/v1
Autentifikacija
Unesite svoj API ključ u Authorization header:
Authorization: Bearer your-api-key
POST/anonymize
Anonimizuje tekst i detektuje PII entitete.
Telo zahteva
{
"text": "John Smith's email is john@example.com",
"method": "replace",
"language": "en",
"entities": ["PERSON", "EMAIL_ADDRESS"]
}
Odgovor
{
"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
Vraća originalne vrednosti iz sesijskih tokena.
{ "text": "enc_xK9mP2... email is enc_jL7nQ4...", "session_id": "abc123" }
Primeri koda
anonym.legal REST API — 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"}'
Metode anonimizacije
Izaberite metodu koja odgovara vašem slučaju upotrebe
replace
Podrazumevano
Zamenjuje PII realističnim lažnim podacima. Zadržava čitljivost dokumenta.
"John Smith" → "Max Mueller"
redact
Potpuno uklanja PII. Nepovratno, ali maksimalna privatnost.
"john@example.com" → "[REDACTED]"
hash
SHA-256
Jednosmerni kriptografski heš. Dosledna pseudonimizacija.
"555-0123" → "a7f3c9d2..."
encrypt
AES-256-GCM
Enkripcija vojnog nivoa. Potpuno povratna uz ispravan ključ.
"DE89370400..." → "enc_xK9mP2..."
mask
Delimična vidljivost sa maskiranim karakterima. Prikazuje strukturu.
"4532-1234-5678-9012" → "4532-****-****-9012"
Treba vam pomoć?
Naš tim je spreman da vam pomogne da integrišete Anonymize.dev u vaš radni tok.