Self-hosted worker stuck on "Waiting for self-hosted worker" after enabling/disabling MCP toggle in cursor.com/agents

Thanks a lot @deanrie

I’ve followed your advice on how to recover this situation. This is what I’ve done s it can help others:

The fix — exact steps:

  1. Kill the running worker process
  2. Full logout — agent logout (removes auth tokens completely, not just a re-login)
  3. Clear local worker ID state — echo ‘{“version”:1,“workerIdsByDisplayName”:{}}’ > ~/.cursor/agent-cli-state.json
  4. Fresh login — agent login (generates a new auth token with no stale worker IDs attached)
  5. Start the worker — agent worker start
  6. Create a brand new session in cursor.com/agents (not from a snapshot)

The key step was agent logout before agent login. A re-login alone doesn’t revoke the old token — you need to fully revoke first so the new token has no history of old worker IDs on the backend.