This directory contains the tools for enforcing the Unbound plugin across a fleet of devices.
The MDM setup script (mdm-setup.py) automates the full enterprise deployment in a single command:
- Fetches a per-device API key from the Unbound MDM endpoint using the device serial number
- Sets
UNBOUND_CLAUDE_API_KEYfor all users on the machine - Deploys
managed-settings.jsonso Claude Code auto-installs the plugin and users cannot disable it
sudo python3 mdm-setup.py --url https://api.getunbound.ai --api_key <MDM_AUTH_KEY>The script auto-detects the device serial number, fetches the API key, and configures everything.
- macOS and Linux (Windows support planned)
- Root/admin privileges (
sudo) - An MDM auth key from your Unbound dashboard (Settings → MDM)
- Python 3 (pre-installed on macOS)
# Basic — auto-detect serial, fetch key, deploy settings
sudo python3 mdm-setup.py --url https://api.getunbound.ai --api_key <MDM_AUTH_KEY>
# With app name (for multi-team setups)
sudo python3 mdm-setup.py --url https://api.getunbound.ai --api_key <MDM_AUTH_KEY> --app_name "engineering"
# Debug mode
sudo python3 mdm-setup.py --url https://api.getunbound.ai --api_key <MDM_AUTH_KEY> --debugsudo python3 mdm-setup.py --clearThis removes managed-settings.json and UNBOUND_CLAUDE_API_KEY from all users.
On macOS, uses system_profiler SPHardwareDataType. On Linux, reads /sys/class/dmi/id/product_serial, falls back to dmidecode, then /etc/machine-id.
GET {base_url}/api/v1/automations/mdm/get_application_api_key/
?serial_number=<SERIAL>&app_type=claude-code[&app_name=<NAME>]
Authorization: Bearer <MDM_AUTH_KEY>
Returns:
{
"api_key": "...",
"email": "user@example.com",
"first_name": "...",
"last_name": "..."
}Writes export UNBOUND_CLAUDE_API_KEY="<key>" to shell rc files for every real user account on the machine. On macOS: ~/.zprofile and ~/.bash_profile. On Linux: ~/.zshrc, ~/.bashrc, ~/.zprofile, and ~/.bash_profile (covers both login and non-login shells). Sets correct file ownership via chown.
Copies managed-settings.json to the system-wide Claude Code path:
| OS | Path |
|---|---|
| macOS | /Library/Application Support/ClaudeCode/managed-settings.json |
| Linux | /etc/claude-code/managed-settings.json |
| Windows | C:\Program Files\ClaudeCode\managed-settings.json |
When enabledPlugins is set in managed settings, Claude Code installs the listed plugins automatically and users cannot disable them.
Checks that the API key works by hitting {base_url}/v1/models. If unreachable, the plugin runs in fail-open mode.
Add mdm-setup.py as a script in your MDM tool. Example Jamf policy:
#!/bin/bash
python3 /path/to/mdm-setup.py --url https://api.getunbound.ai --api_key "$MDM_AUTH_KEY"Pass the MDM auth key as a Jamf script parameter or via a secure configuration profile.
If you prefer not to use the automated script:
- Deploy
managed-settings.json.tmplto the system path (see table above) asmanaged-settings.json - Set
UNBOUND_CLAUDE_API_KEYfor each user via a login script or MDM configuration profile
On an enrolled machine, open Claude Code and run /unbound:setup. It should detect the existing key and confirm connectivity.