Skip to main content
Cursor supports MCP servers over HTTP transport. Point it at mcp-gate and every tool call will be evaluated against your Sentrail policies.

Prerequisites

  • A Sentrail workspace with an MCP server connected (Tools → MCP → Connect)
  • An API key with the mcp scope

Configuration

Add the Sentrail MCP server to your Cursor MCP configuration. Open Cursor Settings → MCP or edit ~/.cursor/mcp.json:
{
  "mcpServers": {
    "sentrail": {
      "url": "https://<project-ref>.supabase.co/functions/v1/mcp-gate/sse",
      "headers": {
        "Authorization": "Bearer agk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
        "X-Agent-Id": "cursor"
      },
      "transport": "sse"
    }
  }
}
Replace agk_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx with your actual API key.
Do not commit your API key to version control. Cursor allows environment variable references — use $SENTRAIL_API_KEY if your setup supports it.

Verifying the connection

After saving, open the Cursor MCP panel. The sentrail 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:
  1. Cursor sends tools/list to mcp-gate — gets back your upstream tool list (cached 60s)
  2. Cursor sends tools/call to mcp-gate
  3. mcp-gate evaluates the call against your Sentrail policies
  4. On allow: call is forwarded to upstream; result returned to Cursor
  5. On block: Cursor receives a JSON-RPC error with the block reason
  6. On require_approval: Cursor receives a result with an approval message; the agent is paused until a reviewer decides

Agent identity

The X-Agent-Id: cursor header is recorded in all audit log entries from Cursor. Use it in policy conditions to scope rules specifically to Cursor:
{
  "name": "Cursor - require approval for all writes",
  "tool": "mcp",
  "actionPattern": "*",
  "conditions": {
    "allowedAgents": ["cursor"],
    "minRiskLevel": "medium"
  },
  "mode": "require_approval",
  "priority": 20
}

Project-level configuration

For team setups, commit a project-level config that references an environment variable:
{
  "mcpServers": {
    "sentrail": {
      "url": "https://<project-ref>.supabase.co/functions/v1/mcp-gate/sse",
      "headers": {
        "Authorization": "Bearer $SENTRAIL_API_KEY",
        "X-Agent-Id": "cursor"
      },
      "transport": "sse"
    }
  }
}
Each team member sets 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

Confirm the Sentrail endpoint ends with /mcp-gate/sse. Cursor does not support stdio transport for remote servers.
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.
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.