Dokumentation
MCP Server, REST API og SDK-integrationsguider til anonym.legal og cloak.business
Opsætning af MCP Server
HTTP-transport: https://anonym.legal/mcp · 7 værktøjer · ingen installation påkrævet
Claude Desktop
Føj til 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
Føj til Cursor MCP-indstillinger (Settings › Features › MCP):
{
"mcpServers": {
"anonym-legal": {
"type": "http",
"url": "https://anonym.legal/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
7 MCP-værktøjer
| Værktøj | Beskrivelse |
|---|---|
anonymize_text | Anonymiser tekst — replace, redact, hash, encrypt, mask eller keep pr. enhed |
analyze_text | Registrer PII-enheder — returnerer positioner, typer og konfidensscorer |
detokenize_text | Gendan oprindelige værdier fra sessionstokens |
get_balance | Tjek resterende tokensaldo |
estimate_cost | Estimer tokenomkostning før du kalder anonymize_text |
list_sessions | Vis aktive anonymiseringssessioner |
delete_session | Slet en session — sletning iht. GDPR art. 17 |
Forudsætninger
| Krav | Påkrævet | Beskrivelse |
|---|---|---|
anonym.legal account | Ja | Pro- eller Business-plan (MCP Server er ikke tilgængelig på Free/Basic) |
API key | Ja | Sendes som Authorization: Bearer YOUR_API_KEY -header — ingen Node.js eller npm-installation nødvendig |
MCP client | Ja | Enhver klient, der understøtter HTTP-transport (Claude Desktop, Cursor, VS Code, Windsurf, Continue, Cline) |
REST API
anonym.legal REST API — ingen SDK påkrævet, direkte HTTP-integration
Basis-URL
https://api.anonym.legal/v1
Autentificering
Angiv din API-nøgle i Authorization-headeren:
Authorization: Bearer your-api-key
POST/anonymize
Anonymiser tekst og registrer PII-enheder.
Anmodningstekst
{
"text": "John Smith's email is john@example.com",
"method": "replace",
"language": "en",
"entities": ["PERSON", "EMAIL_ADDRESS"]
}
Svar
{
"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
Gendan oprindelige værdier fra sessionstokens.
{ "text": "enc_xK9mP2... email is enc_jL7nQ4...", "session_id": "abc123" }
Kodeeksempler
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"}'
Anonymiseringsmetoder
Vælg den rette metode til dit anvendelsesscenarie
replace
Standard
Erstatter PII med realistiske fiktive data. Bevarer dokumentets læsbarhed.
"John Smith" → "Max Mueller"
redact
Fjerner PII fuldstændigt. Irreversibel, men maksimal privatlivsbeskyttelse.
"john@example.com" → "[REDACTED]"
hash
SHA-256
Envejs kryptografisk hash. Konsistent pseudonymisering.
"555-0123" → "a7f3c9d2..."
encrypt
AES-256-GCM
Militærgrad kryptering. Fuldt reversibel med den korrekte nøgle.
"DE89370400..." → "enc_xK9mP2..."
mask
Delvis synlighed med maskerede tegn. Viser strukturen.
"4532-1234-5678-9012" → "4532-****-****-9012"
Brug for hjælp?
Vores team står klar til at hjælpe dig med at integrere Anonymize.dev i din arbejdsgang.