MCP Allowlist doesn't work, also can't be edited

Here’s a version of the script for windows enjoyoors. You’ll need the sqlite3 executable that can be downloaded @ https://www.sqlite.org/2017/sqlite-tools-win32-x86-3170000.zip.

# enable-cursor-auto-features.ps1

# Stop on errors
$ErrorActionPreference = "Stop"

# Configuration
$ROOT = "$env:USERPROFILE\AppData\Roaming\Cursor"
$SQLITE3 = "$env:USERPROFILE\Downloads\sqlite3.exe"
$STAMP = Get-Date -Format "yyyyMMdd-HHmmss"
$KEY = 'src.vs.platform.reactivestorage.browser.reactiveStorageServiceImpl.persistentStorage.applicationUser'

# Check if sqlite3.exe exists
if (-not (Test-Path $SQLITE3)) {
    Write-Error "sqlite3.exe not found at: $SQLITE3"
    exit 1
}

# Find all state.vscdb files
$dbFiles = @()
$searchPaths = @(
    "$ROOT\User",
    "$ROOT\User\profiles"
)

foreach ($path in $searchPaths) {
    if (Test-Path $path) {
        $dbFiles += Get-ChildItem -Path $path -Filter "state.vscdb" -Recurse -ErrorAction SilentlyContinue
    }
}

if ($dbFiles.Count -eq 0) {
    Write-Warning "No state.vscdb files found in $ROOT"
    exit 0
}

Write-Host "Found $($dbFiles.Count) database file(s)" -ForegroundColor Green

# Process each database
foreach ($dbFile in $dbFiles) {
    $DB = $dbFile.FullName
    Write-Host "`nProcessing: $DB" -ForegroundColor Cyan
    
    # Create backup
    $backupFile = "$DB.bak.$STAMP"
    try {
        Copy-Item -Path $DB -Destination $backupFile -Force
        Write-Host "  [OK] Backup created: $backupFile" -ForegroundColor Green
    } catch {
        Write-Warning "  Failed to create backup: $_"
    }
    
    # SQL update commands - using literal here-string to prevent PowerShell parsing
    $sqlUpdate = @'
PRAGMA busy_timeout=5000;
BEGIN;
UPDATE ItemTable SET value=json_set(value,
  '$.shouldAutoContinueToolCall', 1,
  '$.yoloMcpToolsDisabled', 0,
  '$.isAutoApplyEnabled', 1
) WHERE key='KEYPLACEHOLDER' AND json_valid(value);
UPDATE ItemTable SET value=json_set(value,
  '$.composerState.useYoloMode', 0,
  '$.composerState.shouldAutoContinueToolCall', 1,
  '$.composerState.yoloMcpToolsDisabled', 0,
  '$.composerState.isAutoApplyEnabled', 1,
  '$.composerState.modes4[0].autoRun', 1,
  '$.composerState.modes4[0].fullAutoRun', 1
) WHERE key='KEYPLACEHOLDER' AND json_valid(value);
UPDATE ItemTable SET value=REPLACE(value,'\"mcpEnabled\": false','\"mcpEnabled\": true')
  WHERE key='KEYPLACEHOLDER' AND value LIKE '%\"mcpEnabled\": false%';
COMMIT;
'@
    
    # Replace the placeholder with actual key
    $sqlUpdate = $sqlUpdate -replace 'KEYPLACEHOLDER', $KEY
    
    # Execute update
    try {
        $sqlUpdate | & $SQLITE3 $DB 2>&1 | Out-Null
        Write-Host "  [OK] Database updated successfully" -ForegroundColor Green
    } catch {
        Write-Error "  Failed to update database: $_"
        continue
    }
    
    # Verify changes
    $sqlVerify = @'
SELECT 'DBPLACEHOLDER',
  json_extract(value,'$.composerState.shouldAutoContinueToolCall') as autoContinue,
  json_extract(value,'$.composerState.yoloMcpToolsDisabled') as yoloDisabled,
  json_extract(value,'$.composerState.modes4[0].fullAutoRun') as fullAutoRun
FROM ItemTable WHERE key='KEYPLACEHOLDER';
'@
    
    $sqlVerify = $sqlVerify -replace 'KEYPLACEHOLDER', $KEY
    $sqlVerify = $sqlVerify -replace 'DBPLACEHOLDER', $DB
    
    Write-Host "  Verification:" -ForegroundColor Yellow
    $sqlVerify | & $SQLITE3 $DB
}

Write-Host "`n=========================================" -ForegroundColor Green
Write-Host "Done! Restart Cursor and retest MCP autorun." -ForegroundColor Green
Write-Host "=========================================" -ForegroundColor Green
Write-Host "`nPress any key to exit..."
$null = $Host.UI.RawUI.ReadKey("NoEcho,IncludeKeyDown")