Cursor
Give Cursor's agent an approval tool through MCP, with the key kept out of the configuration file.
Cursor’s agent can use MCP tools. Connect the approvals server and it gains a request_approval tool to call before an action you want a person to sign off, with the answer kept on the same record as your other agents.
Connect the server
Create a key under Agents in your workspace first. Then:
Put the key in your shell profile, such as ~/.zshrc:
export VARIANTGATE_KEY=gl_YOUR_KEYAdd the server to ~/.cursor/mcp.json:
{
"mcpServers": {
"variantgate": {
"headers": {
"Authorization": "Bearer ${env:VARIANTGATE_KEY}"
},
"url": "https://api.variantgate.com/mcp"
}
}
}Cursor reads ${env:VARIANTGATE_KEY} from the environment it starts in, so the key stays out of the file. Restart Cursor after changing your shell profile. For one project only, put the same entry in that project’s .cursor/mcp.json.
Tell the agent when to ask
Tools say what an agent can do, not when. Add a few lines to the instructions Cursor gives its agent, such as a project rule:
Before you send, pay, publish, deploy or delete anything, call
request_approval with one sentence saying exactly what will happen.
Then call check_approval until it is no longer pending.
Act only if "allowed" is true. Otherwise stop and say why.This relies on the model choosing to ask, which is fine for an assistant you are watching. For an action that must never happen without a yes, put the check in the code that performs it; see how to add human approval to an AI agent.
Check that it works
Ask the agent to do something on your list, such as sending a test email. A request appears in the inbox; deny it once and check that the agent stops.