Apache-2.0 Open Core ยท Zero Outbound Telemetry

Nesthing Legal Guard โ€” Developer Docs

Zero-dependency Node.js (≥ 18) CLI & MCP Server + standalone Dockerized Legal PDF Parser for Singapore & Malaysia PDPA workflows โ€” or test instantly via our hosted Sandbox REST API.

1. 30-Second Local CLI Quickstart (Zero npm Dependencies)

Clone and run all 6 checksum, reversible redaction, and MCP tests in under 1 second:

git clone https://github.com/nesthing-ai/nesthing-legal-guard.git
cd nesthing-legal-guard
npm test

# Locally redact SG NRIC/FIN, MY MyKad, SG UEN, emails & phones (saves mode 0600 local vault)
node bin/legal-guard.mjs redact \
  --text "Guarantor Tan Wei Ming (S1234567D, UEN 202312345K, MyKad 900102-14-5678, [email protected])" \
  --party "Tan Wei Ming" \
  --vault-out local-vault.json

# Restore placeholders locally after LLM review
node bin/legal-guard.mjs unmask --file llm-reply.txt --vault local-vault.json

2. Hosted Sandbox & Production REST API

Sign up at portal.nesthing.com to generate an instant ns_test_... key (fair metering: 0 charge on 4xx/5xx):

curl -X POST https://portal.nesthing.com/api/v1/redact \
  -H "Authorization: Bearer ns_test_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Guarantor Tan Wei Ming (NRIC S1234567D, MyKad 900102-14-5678, UEN 202312345K). Vendor shall indemnify Client under SIAC arbitration and PDPA.","custom_parties":["Tan Wei Ming"]}'

3. Local MCP Server for Claude Desktop & Cursor

Runs strictly over local stdio with zero outbound network requests:

{
  "mcpServers": {
    "nesthing-legal-guard": {
      "command": "node",
      "args": ["/absolute/path/to/nesthing-legal-guard/bin/legal-guard-mcp.mjs"]
    }
  }
}

4. Hardened Two-Column Legal PDF Parser (Docker, 256MB RAM)

PyMuPDF two-column sorting, pdfplumber Markdown tables, encrypted/page-cap 422 circuit breakers, and NUL-byte sanitization:

cd pdf-parser
docker build -t nesthing-legal-pdf-parser .
docker run --rm -p 8091:8091 --memory="256m" nesthing-legal-pdf-parser

curl -X POST http://localhost:8091/v1/parse/upload -F "[email protected]"

5. Open Source Core vs. Commercial Licensing

TierPricingWhat You Get
Tier 0: Open Source & Sandbox$0 ยท Apache-2.0CLI, MCP Server, Offline PDF Parser Docker, n8n starter + 100 Sandbox API calls/mo.
Tier 1: Partner White-Label$299/mo + $99/firmWhite-label nesthing-lawyer-portal HITL UI, HMAC Signing Gateway, 10 hardened n8n workflows, L2 support.
Tier 2: Private Firm TurnkeyFrom $3,500 + $250/moSingle-tenant private server deployment for SG/MY boutique law firms (3โ€“30 lawyers) & in-house legal.