Skip to main content

Deploy Agent Monitor with JumpCloud

Push managed hooks configuration through JumpCloud Commands so macOS and Windows devices send AI coding agent activity to the MintMCP dashboard (no plugin required).

Requirements

  • A MintMCP org key (see Find your org key).
  • The JumpCloud agent installed on target devices. It's already present on any JumpCloud-managed device.
  • A device group containing the machines that run Claude Code or Cursor — create it before you create the command.
  • No existing managed hooks file on devices — these scripts create it fresh and overwrite any prior version.

Find your org key

Go to Agent Monitor setup. Your org key starts with llmorgkey_.

macOS

Prepare the script

Paste your org key from Agent Monitor setup — the script updates automatically so you can copy it ready to go.

#!/bin/bash
# Agent Monitor — JumpCloud command (Claude Code, macOS)
# Writes managed-settings.json with native HTTP hooks for MintMCP.

set -euo pipefail

ORG_KEY="YOUR_ORG_KEY_HERE"

if [[ ! "$ORG_KEY" =~ ^llmorgkey_ ]]; then
echo "[AgentMonitor] ERROR: ORG_KEY not set. Edit the script and replace YOUR_ORG_KEY_HERE with your MintMCP org key."
exit 1
fi

TARGET_DIR="/Library/Application Support/ClaudeCode"
SETTINGS_FILE="${TARGET_DIR}/managed-settings.json"
mkdir -p "$TARGET_DIR"

cat > "$SETTINGS_FILE" <<JSON
{
"env": {
  "MINTMCP_ORG_KEY": "${ORG_KEY}"
},
"hooks": {
  "PreToolUse": [
    {
      "matcher": ".*",
      "hooks": [
        {
          "type": "http",
          "url": "https://app.mintmcp.com/hooks/claudecode",
          "headers": {
            "X-MINTMCP-ORG-KEY": "\$MINTMCP_ORG_KEY",
            "X-MINTMCP-USER": "\$USER"
          },
          "allowedEnvVars": [
            "MINTMCP_ORG_KEY",
            "USER"
          ]
        }
      ]
    }
  ],
  "PostToolUse": [
    {
      "matcher": ".*",
      "hooks": [
        {
          "type": "http",
          "url": "https://app.mintmcp.com/hooks/claudecode",
          "headers": {
            "X-MINTMCP-ORG-KEY": "\$MINTMCP_ORG_KEY",
            "X-MINTMCP-USER": "\$USER"
          },
          "allowedEnvVars": [
            "MINTMCP_ORG_KEY",
            "USER"
          ]
        }
      ]
    }
  ],
  "UserPromptSubmit": [
    {
      "hooks": [
        {
          "type": "http",
          "url": "https://app.mintmcp.com/hooks/claudecode",
          "headers": {
            "X-MINTMCP-ORG-KEY": "\$MINTMCP_ORG_KEY",
            "X-MINTMCP-USER": "\$USER"
          },
          "allowedEnvVars": [
            "MINTMCP_ORG_KEY",
            "USER"
          ]
        }
      ]
    }
  ]
}
}
JSON

/bin/chmod 0644 "$SETTINGS_FILE"
/usr/sbin/chown root:wheel "$SETTINGS_FILE"
echo "[AgentMonitor] Created ${SETTINGS_FILE} with MintMCP hooks enabled"

Add the command to JumpCloud

  1. In the JumpCloud Admin Portal, go to DEVICE MANAGEMENT > Commands and click (+) New Command > Command.
  2. Name it "MintMCP Agent Monitor Hooks (macOS)".
  3. Set Type to Mac and, under Run As, enter root so the command can write to /Library/Application Support.
  4. Paste the script (with your org key filled in) into the Command field.
  5. On the Device Groups (or Devices) tab, bind the command to the machines running Claude Code or Cursor.
  6. Set the Launch Event: Run Manually for a one-time push, or Run as Repeating (for example, every 1 day) to re-apply the file and correct drift.
  7. Click Save, then select the command and click Run Now if you chose Run Manually.

If a macOS command fails with "Operation Not Permitted," grant the JumpCloud agent Full Disk Access and re-run.

Windows

Prepare the script

Paste your org key — the script updates automatically so you can copy it ready to go.

#Requires -Version 5
# Agent Monitor — JumpCloud command (Claude Code, Windows)
# Writes managed-settings.json with native HTTP hooks for MintMCP.

$ErrorActionPreference = "Stop"

$OrgKey = "YOUR_ORG_KEY_HERE"

if ($OrgKey -notmatch '^llmorgkey_') {
Write-Error "[AgentMonitor] ORG_KEY not set. Edit the script and replace YOUR_ORG_KEY_HERE with your MintMCP org key."
exit 1
}

$TargetDir = "C:/Program Files/ClaudeCode"
$SettingsFile = "$TargetDir/managed-settings.json"
New-Item -ItemType Directory -Force -Path $TargetDir | Out-Null

$Settings = @'
{
"env": {
  "MINTMCP_ORG_KEY": "__ORG_KEY__"
},
"hooks": {
  "PreToolUse": [
    {
      "matcher": ".*",
      "hooks": [
        {
          "type": "http",
          "url": "https://app.mintmcp.com/hooks/claudecode",
          "headers": {
            "X-MINTMCP-ORG-KEY": "$MINTMCP_ORG_KEY",
            "X-MINTMCP-USER": "$USERNAME"
          },
          "allowedEnvVars": ["MINTMCP_ORG_KEY", "USERNAME"]
        }
      ]
    }
  ],
  "PostToolUse": [
    {
      "matcher": ".*",
      "hooks": [
        {
          "type": "http",
          "url": "https://app.mintmcp.com/hooks/claudecode",
          "headers": {
            "X-MINTMCP-ORG-KEY": "$MINTMCP_ORG_KEY",
            "X-MINTMCP-USER": "$USERNAME"
          },
          "allowedEnvVars": ["MINTMCP_ORG_KEY", "USERNAME"]
        }
      ]
    }
  ],
  "UserPromptSubmit": [
    {
      "hooks": [
        {
          "type": "http",
          "url": "https://app.mintmcp.com/hooks/claudecode",
          "headers": {
            "X-MINTMCP-ORG-KEY": "$MINTMCP_ORG_KEY",
            "X-MINTMCP-USER": "$USERNAME"
          },
          "allowedEnvVars": ["MINTMCP_ORG_KEY", "USERNAME"]
        }
      ]
    }
  ]
}
}
'@

$Settings = $Settings.Replace("__ORG_KEY__", $OrgKey)
[System.IO.File]::WriteAllText($SettingsFile, $Settings)
Write-Output "[AgentMonitor] Created $SettingsFile with MintMCP hooks enabled"

Add the command to JumpCloud

  1. In the JumpCloud Admin Portal, go to DEVICE MANAGEMENT > Commands and click (+) New Command > Command.
  2. Name it "MintMCP Agent Monitor Hooks (Windows)".
  3. Set Type to Windows and choose PowerShell. Windows commands run as SYSTEM (LocalSystem), which can write to C:\Program Files and C:\ProgramData.
  4. Paste the script (with your org key filled in) into the Command field.
  5. On the Device Groups (or Devices) tab, bind the command to the machines running Claude Code or Cursor.
  6. Set the Launch Event: Run Manually for a one-time push, or Run as Repeating to re-apply the file and correct drift.
  7. Click Save, then select the command and click Run Now if you chose Run Manually.

Validate on a test device

Confirm the files exist and contents look correct. You can also review each run's stdout and exit code under DEVICE MANAGEMENT > Commands > Results.

# Claude Code
cat "/Library/Application Support/ClaudeCode/managed-settings.json"

# Cursor
cat "/Library/Application Support/Cursor/hooks.json"
cat "/Library/Application Support/Cursor/mint.sh"

Launch the client and perform some actions. Verify activity appears in MintMCP Agent Monitor.

Hook events captured

HookDescription
PreToolUseFired before any tool execution (Bash, Edit, Write, etc.)
PostToolUseFired after any tool execution completes
UserPromptSubmitFired when the user submits a prompt

Troubleshooting

  • Command shows no result: confirm the JumpCloud agent is online on the device and the command is bound to a device group that includes it.
  • macOS write fails with "Operation Not Permitted": grant the JumpCloud agent Full Disk Access, then re-run.
  • Cursor activity missing on Windows: confirm mint.ps1 exists in C:\ProgramData\Cursor and check the Hooks Output panel in Cursor for errors.

Reach out to support@mintmcp.com if you have issues.