Dokumentation
Integrationsguider för MCP Server, REST API och SDK för anonym.legal och cloak.business
Konfigurera MCP Server
HTTP-transport: https://anonym.legal/mcp · 7 verktyg · ingen installation krävs
Claude Desktop
Lägg till i 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
Lägg till i Cursors MCP-inställningar (Settings › Features › MCP):
{
"mcpServers": {
"anonym-legal": {
"type": "http",
"url": "https://anonym.legal/mcp",
"headers": { "Authorization": "Bearer YOUR_API_KEY" }
}
}
}
7 MCP-verktyg
| Verktyg | Beskrivning |
|---|---|
anonymize_text | Anonymisera text — replace, redact, hash, encrypt, mask eller keep per entitet |
analyze_text | Upptäck PII-entiteter — returnerar positioner, typer och konfidenspoäng |
detokenize_text | Återställ originalvärden från sessionstokens |
get_balance | Kontrollera återstående tokensaldo |
estimate_cost | Uppskatta tokenkostnad innan anonymize_text anropas |
list_sessions | Lista aktiva anonymiseringssessioner |
delete_session | Ta bort en session — radering enligt GDPR artikel 17 |
Förutsättningar
| Krav | Obligatoriskt | Beskrivning |
|---|---|---|
anonym.legal account | Ja | Pro- eller Business-plan (MCP Server är inte tillgängligt i Free/Basic) |
API key | Ja | Skickas som Authorization: Bearer YOUR_API_KEY header — inget behov av Node.js eller npm-installation |
MCP client | Ja | Alla klienter som stöder HTTP-transport (Claude Desktop, Cursor, VS Code, Windsurf, Continue, Cline) |
REST API
anonym.legal REST API — ingen SDK krävs, direkt HTTP-integration
Bas-URL
https://api.anonym.legal/v1
Autentisering
Inkludera din API-nyckel i Authorization-headern:
Authorization: Bearer your-api-key
POST/anonymize
Anonymisera text och upptäck PII-entiteter.
Förfrågningskropp
{
"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
Återställ originalvärden från sessionstokens.
{ "text": "enc_xK9mP2... email is enc_jL7nQ4...", "session_id": "abc123" }
Kodexempel
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älj rätt metod för ditt användningsfall
replace
Standard
Ersätter PII med realistisk falsk data. Bibehåller dokumentets läsbarhet.
"John Smith" → "Max Mueller"
redact
Tar bort PII helt. Irreversibelt men maximal integritet.
"john@example.com" → "[REDACTED]"
hash
SHA-256
Envägs kryptografisk hash. Konsekvent pseudonymisering.
"555-0123" → "a7f3c9d2..."
encrypt
AES-256-GCM
Kryptering av militär klass. Fullt reversibel med rätt nyckel.
"DE89370400..." → "enc_xK9mP2..."
mask
Partiell synlighet med maskerade tecken. Visar struktur.
"4532-1234-5678-9012" → "4532-****-****-9012"
Behöver du hjälp?
Vårt team hjälper dig gärna att integrera Anonymize.dev i ditt arbetsflöde.