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.
- Claude Code
- Cursor
#!/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"#!/bin/bash
# Agent Monitor — JumpCloud command (Cursor, macOS)
# Writes hooks.json and mint.sh 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/Cursor"
HOOKS_FILE="${TARGET_DIR}/hooks.json"
SCRIPT_FILE="${TARGET_DIR}/mint.sh"
mkdir -p "$TARGET_DIR"
# Write hooks.json
cat > "$HOOKS_FILE" <<'HOOKS'
{
"version": 1,
"hooks": {
"beforeSubmitPrompt":
[ {"command": "sh /Library/Application Support/Cursor/mint.sh"} ],
"beforeShellExecution":
[ {"command": "sh /Library/Application Support/Cursor/mint.sh"} ],
"beforeMCPExecution":
[ {"command": "sh /Library/Application Support/Cursor/mint.sh"} ],
"beforeReadFile":
[ {"command": "sh /Library/Application Support/Cursor/mint.sh"} ],
"afterShellExecution":
[ {"command": "sh /Library/Application Support/Cursor/mint.sh"} ],
"afterMCPExecution":
[ {"command": "sh /Library/Application Support/Cursor/mint.sh"} ],
"afterAgentResponse":
[ {"command": "sh /Library/Application Support/Cursor/mint.sh"} ]
}
}
HOOKS
# Write mint.sh
cat > "$SCRIPT_FILE" <<SCRIPT
#!/bin/sh
MINTMCP_USER=\${MINTMCP_USER:-\$USER}
URL="https://app.mintmcp.com/h/${ORG_KEY},\${MINTMCP_USER}/cursor"
json_input=\$(cat)
if resp=\$(curl -sS --fail-with-body -H "Content-Type: application/json" -d "\$json_input" "\$URL"); then
printf '%s' "\$resp"
else
status=\$?
printf '%s' "\$resp" >&2
exit \$status
fi
exit 0
SCRIPT
/bin/chmod 0644 "$HOOKS_FILE"
/bin/chmod 0755 "$SCRIPT_FILE"
/usr/sbin/chown root:wheel "$HOOKS_FILE"
/usr/sbin/chown root:wheel "$SCRIPT_FILE"
echo "[AgentMonitor] Created ${HOOKS_FILE} and ${SCRIPT_FILE} with MintMCP hooks enabled"Add the command to JumpCloud
- In the JumpCloud Admin Portal, go to DEVICE MANAGEMENT > Commands and click (+) New Command > Command.
- Name it "MintMCP Agent Monitor Hooks (macOS)".
- Set Type to Mac and, under Run As, enter root so the command can write to
/Library/Application Support. - Paste the script (with your org key filled in) into the Command field.
- On the Device Groups (or Devices) tab, bind the command to the machines running Claude Code or Cursor.
- 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.
- 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.
- Claude Code
- Cursor
#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"#Requires -Version 5
# Agent Monitor — JumpCloud command (Cursor, Windows)
# Writes hooks.json and mint.ps1 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:/ProgramData/Cursor"
New-Item -ItemType Directory -Force -Path $TargetDir | Out-Null
$Hooks = @'
{
"version": 1,
"hooks": {
"beforeSubmitPrompt": [ {"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:/ProgramData/Cursor/mint.ps1"} ],
"beforeShellExecution": [ {"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:/ProgramData/Cursor/mint.ps1"} ],
"beforeMCPExecution": [ {"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:/ProgramData/Cursor/mint.ps1"} ],
"beforeReadFile": [ {"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:/ProgramData/Cursor/mint.ps1"} ],
"afterShellExecution": [ {"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:/ProgramData/Cursor/mint.ps1"} ],
"afterMCPExecution": [ {"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:/ProgramData/Cursor/mint.ps1"} ],
"afterAgentResponse": [ {"command": "powershell -NoProfile -ExecutionPolicy Bypass -File C:/ProgramData/Cursor/mint.ps1"} ]
}
}
'@
$Script = @'
$OrgKey = "__ORG_KEY__"
$MintUser = if ($env:MINTMCP_USER) { $env:MINTMCP_USER } else { $env:USERNAME }
$Url = "https://app.mintmcp.com/h/$OrgKey,$MintUser/cursor"
$JsonInput = [Console]::In.ReadToEnd()
try {
$resp = Invoke-WebRequest -UseBasicParsing -Method Post -Uri $Url -ContentType "application/json" -Body $JsonInput
[Console]::Out.Write($resp.Content)
} catch {
if ($_.Exception.Response) {
$reader = New-Object System.IO.StreamReader($_.Exception.Response.GetResponseStream())
[Console]::Error.Write($reader.ReadToEnd())
} else {
[Console]::Error.Write($_.Exception.Message)
}
exit 1
}
exit 0
'@
$Script = $Script.Replace("__ORG_KEY__", $OrgKey)
[System.IO.File]::WriteAllText("$TargetDir/hooks.json", $Hooks)
[System.IO.File]::WriteAllText("$TargetDir/mint.ps1", $Script)
Write-Output "[AgentMonitor] Created $TargetDir/hooks.json and $TargetDir/mint.ps1 with MintMCP hooks enabled"Add the command to JumpCloud
- In the JumpCloud Admin Portal, go to DEVICE MANAGEMENT > Commands and click (+) New Command > Command.
- Name it "MintMCP Agent Monitor Hooks (Windows)".
- Set Type to Windows and choose PowerShell. Windows commands run as SYSTEM (LocalSystem), which can write to
C:\Program FilesandC:\ProgramData. - Paste the script (with your org key filled in) into the Command field.
- On the Device Groups (or Devices) tab, bind the command to the machines running Claude Code or Cursor.
- Set the Launch Event: Run Manually for a one-time push, or Run as Repeating to re-apply the file and correct drift.
- 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.
- macOS
- Windows
# 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"
# Claude Code
Get-Content "C:\Program Files\ClaudeCode\managed-settings.json"
# Cursor
Get-Content "C:\ProgramData\Cursor\hooks.json"
Get-Content "C:\ProgramData\Cursor\mint.ps1"
Launch the client and perform some actions. Verify activity appears in MintMCP Agent Monitor.
Hook events captured
- Claude Code
- Cursor
| Hook | Description |
|---|---|
PreToolUse | Fired before any tool execution (Bash, Edit, Write, etc.) |
PostToolUse | Fired after any tool execution completes |
UserPromptSubmit | Fired when the user submits a prompt |
| Hook | Description |
|---|---|
beforeSubmitPrompt | Fired when the user submits a prompt |
beforeShellExecution | Fired before a shell command runs |
afterShellExecution | Fired after a shell command completes |
beforeMCPExecution | Fired before an MCP tool runs |
afterMCPExecution | Fired after an MCP tool completes |
beforeReadFile | Fired before a file is read |
afterAgentResponse | Fired after the agent responds |
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.ps1exists inC:\ProgramData\Cursorand check the Hooks Output panel in Cursor for errors.
Reach out to support@mintmcp.com if you have issues.