Skip to content

Agent popover: make the MCP command a zero-edit paste#357

Merged
mikkel merged 1 commit into
mainfrom
agent-mcp-cmd-key
Jul 20, 2026
Merged

Agent popover: make the MCP command a zero-edit paste#357
mikkel merged 1 commit into
mainfrom
agent-mcp-cmd-key

Conversation

@mikkel

@mikkel mikkel commented Jul 20, 2026

Copy link
Copy Markdown
Member

What

The MCP install command in the 🤖 "Use in your agent" popover was a clipped readonly <input> — the your-key placeholder the user had to edit was hidden mid-string behind the cutoff. The ask ("copy this, then find and edit an invisible part of it") was incomprehensible.

Now

  • Signed in → the user's NanoGPT key (already in localStorage — this is a BYOK app) is baked into the copied command. Masked on screen (sk-n…7890) so screen-shares don't leak it; the real key goes to the clipboard. Paste into the terminal and you're done — zero edits.
  • Signed out → the command renders in a wrapping <code> block, fully visible, with your-key highlighted and a one-line hint naming the exact swap (or: sign in first and it fills itself).
  • Toasts confirm which of the two you got. The command is rebuilt on every popover open, so signing in mid-session updates it.
  • New strings translated in all 5 locales (es/fr/de/pt/ja).

The key never leaves the browser except onto the user's own clipboard — no change to the no-server promise.

Verified

Headless Edge over raw CDP, both auth states: full command visible & unclipped, mark contents, hint swap, clipboard contents asserted (placeholder vs real key), toast text. 11/11 checks green; full pre-commit suite green.

🤖 Generated with Claude Code

The MCP install line was a clipped readonly <input> hiding a your-key
placeholder mid-string — the ask (copy, then hunt inside the command for
the part to edit) was incomprehensible at a glance.

Now the command renders in a wrapping <code> block, fully visible, with
the one variable part highlighted. Signed in, the user's NanoGPT key
(already in localStorage — BYOK) is baked into the copy: masked on
screen so screen-shares don't leak it, real in the clipboard, zero edits
in the terminal. Signed out, the your-key placeholder stays highlighted
with a hint naming the exact swap. Toasts say which of the two you got.
New strings translated in all 5 locales.

Verified headlessly (CDP, both auth states, clipboard contents asserted).

Co-Authored-By: Claude Fable 5 <[email protected]>
@cloudflare-workers-and-pages

Copy link
Copy Markdown
Contributor

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
nanoodle 8ed8a98 Commit Preview URL

Branch Preview URL
Jul 20 2026, 01:39 AM

@mikkel
mikkel merged commit 60fbb3b into main Jul 20, 2026
3 checks passed
@mikkel
mikkel deleted the agent-mcp-cmd-key branch July 20, 2026 01:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant