Skip to main content

Set up Agent Monitor for Cursor

Install hook scripts to send Cursor agent activity to MintMCP for monitoring and rule enforcement.

Prerequisites

  • Agent Monitor Setup access with admin permissions
  • Cursor v1.7+ with Hooks enabled (Cursor Settings → Hooks)

Generate an organization key

  1. Go to Agent Monitor Setup
  2. Select the Cursor tab
  3. Click Generate Organization Key if needed
Cursor setup page

Install hook files

User-specific installation

Create the hooks directory:

mkdir -p ~/.cursor

Create ~/.cursor/hooks.json with the configuration from MintMCP:

{
"version": 1,
"hooks": {
"beforeSubmitPrompt": [{ "command": "sh mint.sh" }],
"beforeShellExecution": [{ "command": "sh mint.sh" }],
"beforeMCPExecution": [{ "command": "sh mint.sh" }],
"beforeReadFile": [{ "command": "sh mint.sh" }]
}
}

Save ~/.cursor/mint.sh with the script from the MintMCP UI.

Enterprise deployment

Deploy hooks organization-wide by placing hooks.json and mint.sh in a shared location. See Cursor's hooks documentation for details.

Verify

  1. Open Cursor Settings → Hooks and confirm sh mint.sh appears for each hook
Hooks configuration in Cursor
  1. Run an agent action (read a file, execute a command)
  2. Check Live Activity for the logged action
Hook logs in Cursor

Troubleshooting

If activity doesn't appear:

  • Confirm both files exist in ~/.cursor
  • Check the Hooks Output panel in Cursor for errors
  • Verify your organization key hasn't been regenerated