Protect JS from inside
your AI coding assistant
The JSGuardian MCP server exposes protection as tools that Claude Code, Cursor, and any MCP-compatible AI can call. Ask in plain English — no switching context, no manual steps.
Requires Fortress plan · Generate an API key from your account
Backups are always created before any file is modified
The JSGuardian MCP server will never overwrite or modify a file without creating a backup first. Backups are saved to a .jsguardian-backups/ folder next to each protected file.
See it in action
✅ File protected successfully Input: /project/src/licensing.js Output: /project/src/licensing.protected.js Backup: /project/src/.jsguardian-backups/licensing.js.bak Size: 4,521 bytes → 87,432 bytes (×19.3) Preset: maximum
Tool Reference
5 tools available. Your AI will call them automatically based on your instructions.
protect_file(file_path, preset?, overwrite?, output_path?)file_path*stringAbsolute or relative path to the .js file. Must exist and end in .js.
preset"maximum"|"stealth"default: "maximum"All users get maximum protection. stealth = same protection, no visible markers (Fortress only).
overwritebooleandefault: falseIf true, replaces the original file. A backup is ALWAYS created first regardless.
output_pathstringCustom output path. Defaults to <original>.protected.js next to the original.
Success message with: input path, output path, backup path, original size, protected size, size ratio, preset used.
// Claude prompt: "Protect src/licensing.js using the Maximum preset" // What happens: // 1. File is read from src/licensing.js // 2. Backup created: src/.jsguardian-backups/licensing.js.2026-06-02T14-30-00.bak // 3. API call: POST /api/v1/protect with code + preset=maximum // 4. Protected code written to: src/licensing.protected.js // 5. Result reported with sizes + backup location
Installation
Choose your AI tool. The MCP server runs via node.
Generate an API key
Go to Account → API Keys and create a key starting with jsg_live_.
Add to your AI tool config
// Add to ~/.claude/settings.json
{
"mcpServers": {
"jsguardian": {
"command": "node",
"args": ["/root/criptor/mcp/index.js"],
"env": {
"JSGUARDIAN_API_KEY": "jsg_live_your_key_here"
}
}
}
}Restart and verify
Restart Claude Code (quit and reopen), then type /mcp to verify jsguardian appears.
Test it
REST API
Use directly in CI/CD pipelines, build scripts, or any language.
POST https://jsguardian.com/api/v1/protect
Authorization: Bearer jsg_live_your_key_here
Content-Type: application/json
{
"code": "function add(a, b) { return a + b; }\nmodule.exports = { add };",
"filename": "math.js"
}
// Response 200:
{
"jobId": "uuid",
"filename": "math.protected.js",
"originalSize": 52,
"protectedSize": 38204,
"code": "...(full protected JavaScript)..."
}const res = await fetch('https://jsguardian.com/api/v1/protect', {
method: 'POST',
headers: {
'Authorization': 'Bearer jsg_live_...',
'Content-Type': 'application/json',
},
body: JSON.stringify({ code }),
});
const { code: protected } = await res.json();import requests
res = requests.post(
'https://jsguardian.com/api/v1/protect',
headers={'Authorization': 'Bearer jsg_live_...'},
json={'code': code},
)
protected = res.json()['code']curl -X POST https://jsguardian.com/api/v1/protect \
-H "Authorization: Bearer jsg_live_..." \
-H "Content-Type: application/json" \
-d '{"code":"..."}' \
| jq .protectedSize