Commit a457ac1
ux(mcp): confirm revoke + warn about active AI clients
Tonight's debugging session opened with you revoking my Claude Code
key and then us spending 30 minutes diagnosing why my MCP tools were
returning 401. The server-side revoke worked instantly (correct
behavior — bearer is validated per request), but my Claude Code
session kept sending the now-stale bearer because nothing told it
the key was gone. By the time we figured it out, my session had to
restart anyway.
Two-line UX win to prevent the same surprise next time anyone clicks
Revoke:
1. Confirmation dialog spells out exactly what's about to happen:
AI clients keep their connection process alive but every tool call
returns 401 until you restart them with a new key. Operator
acknowledges before the API call goes through.
2. Toast message after revoke is now action-oriented:
"Key 'foo' revoked. Restart any AI client that was using it."
instead of just "API key revoked".
Also passes the full key object (not just the id) to handleRevoke so
the dialog and the toast can reference the key name.
The deeper fix — actively closing live HTTP connections using a
revoked key — would require dropping FastMCP's `stateless_http=True`
mode and tracking sessions in memory keyed by hash. Bigger change;
not justified for this UX issue alone. This commit covers the
operator-facing gap.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 9183764 commit a457ac1
1 file changed
Lines changed: 37 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
357 | 381 | | |
358 | 382 | | |
359 | | - | |
| 383 | + | |
360 | 384 | | |
361 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
362 | 389 | | |
363 | 390 | | |
364 | 391 | | |
| |||
890 | 917 | | |
891 | 918 | | |
892 | 919 | | |
893 | | - | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
894 | 926 | | |
895 | 927 | | |
896 | 928 | | |
| |||
0 commit comments