rm -rf, git push --force, DROP TABLE, etc.). Use Option B if you only need to govern MCP tool calls routed to an upstream server.
For
rm -rf, git push --force, DROP TABLE, and other shell-level commands, you must use Option A (local interceptor). The cloud proxy only sees MCP JSON-RPC calls — it cannot intercept commands the agent runs via bash or a terminal tool.Option A — Local interceptor (recommended)
The Sentrail CLI runs a local proxy athttp://localhost:3773. Cursor connects to it instead of the upstream MCP server. Every tools/call — including shell commands — is classified and checked against your policies before execution.
1. Install the CLI
2. Initialize
agk_…), workspace ID, and upstream MCP server URL when prompted. The command writes ~/.sentrail/config.json.
3. Add to Cursor config
Open Cursor Settings → MCP or edit~/.cursor/mcp.json:
4. Start the interceptor
5. Verify with the demo
rm -rf, git push --force, DROP TABLE, and cat README.md — and shows the Sentrail decision for each without executing anything real.
Option B — Cloud MCP proxy
Point Cursor directly at the Sentrailmcp-gate cloud endpoint. This governs MCP tools/call requests to an upstream MCP server but does not intercept local shell commands.
Prerequisites
- A Sentrail workspace with an MCP server connected (Tools → MCP → Connect)
- An API key with the
mcpscope
Configuration
Verifying the connection
After saving, open the Cursor MCP panel. Thesentrail server should appear with a green status indicator and the list of tools from your upstream MCP server.
How it works
When Cursor’s agent invokes an MCP tool:- Cursor sends
tools/listtomcp-gate— gets back your upstream tool list (cached 60s) - Cursor sends
tools/calltomcp-gate mcp-gateevaluates the call against your Sentrail policies- On allow: call is forwarded to upstream; result returned to Cursor
- On block: Cursor receives a JSON-RPC error with the block reason
- On require_approval: Cursor receives a result with an approval message; the agent is paused until a reviewer decides
Agent identity
TheX-Agent-Id: cursor header is recorded in all audit log entries from Cursor. Use it in policy conditions to scope rules specifically to Cursor:
Project-level configuration
For team setups, commit a project-level config that references an environment variable:SENTRAIL_API_KEY in their shell profile. You can generate per-developer keys with the same scopes but different names for attribution in audit logs.
Troubleshooting
Server shows as disconnected
Server shows as disconnected
Confirm the Sentrail endpoint ends with
/mcp-gate/sse. Cursor does not support stdio transport for remote servers.Tools list is empty
Tools list is empty
The tool list is fetched from your upstream MCP server. If no tools appear, check that your MCP server is running and reachable at the URL configured in Sentrail → Tools → MCP.
Approval message appears in Cursor chat
Approval message appears in Cursor chat
This is expected behavior. When a
require_approval decision is returned, Cursor surfaces the message from _meta.sentrail. Open the Sentrail dashboard → Approvals to review and decide.