Dokumentacija
Vodiči za integraciju MCP Servera, REST API-ja i SDK-a za anonym.legal i cloak.business
Postavljanje MCP Servera
HTTP prijenos: https://anonym.legal/mcp · 7 alata · instalacija nije potrebna
Claude Desktop
Dodajte 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
Dodajte u Cursor MCP postavke (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 | Anonimizacija teksta — replace, redact, hash, encrypt, mask ili keep po entitetu |
analyze_text | Otkrivanje PII entiteta — vraća pozicije, tipove i vrijednosti pouzdanosti |
detokenize_text | Vraćanje izvornih vrijednosti iz tokena sesije |
get_balance | Provjera preostalog stanja tokena |
estimate_cost | Procjena troška tokena prije poziva anonymize_text |
list_sessions | Popis aktivnih sesija anonimizacije |
delete_session | Brisanje sesije — brisanje prema GDPR čl. 17 |
Preduvjeti
| Zahtjev | Obavezno | Opis |
|---|---|---|
anonym.legal account | Da | Plan Pro ili Business (MCP Server nije dostupan u planovima Free/Basic) |
API key | Da | Šalje se kao Authorization: Bearer YOUR_API_KEY zaglavlje — Node.js ili npm instalacija nisu potrebni |
MCP client | Da | Svaki klijent koji podržava HTTP prijenos (Claude Desktop, Cursor, VS Code, Windsurf, Continue, Cline) |
REST API
anonym.legal REST API — SDK nije potreban, izravna HTTP integracija
Osnovni URL
https://api.anonym.legal/v1
Autentifikacija
Uključite svoj API ključ u zaglavlje Authorization:
Authorization: Bearer your-api-key
POST/anonymize
Anonimizirajte tekst i otkrijte PII entitete.
Tijelo zahtjeva
{
"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
Vratite izvorne vrijednosti iz tokena sesije.
{ "text": "enc_xK9mP2... email is enc_jL7nQ4...", "session_id": "abc123" }
Primjeri 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
Odaberite pravu metodu za svoj slučaj uporabe
replace
Zadano
Zamjenjuje PII realističnim lažnim podacima. Zadržava čitljivost dokumenta.
"John Smith" → "Max Mueller"
redact
Potpuno uklanja PII. Nepovratno, ali uz maksimalnu privatnost.
"john@example.com" → "[REDACTED]"
hash
SHA-256
Jednosmjerni kriptografski hash. Dosljedna pseudonimizacija.
"555-0123" → "a7f3c9d2..."
encrypt
AES-256-GCM
Enkripcija vojne razine. Potpuno povratna uz ispravan ključ.
"DE89370400..." → "enc_xK9mP2..."
mask
Djelomična vidljivost s maskiranim znakovima. Prikazuje strukturu.
"4532-1234-5678-9012" → "4532-****-****-9012"
Trebate pomoć?
Naš tim spreman je pomoći Vam integrirati Anonymize.dev u svoj radni proces.