Skip to content

Add a "Connect your coach" flow to the dashboard - #17

Merged
aderaaij merged 2 commits into
mainfrom
feat/dashboard-connect-coach
Nov 13, 2026
Merged

aderaaij merged 2 commits into
mainfrom
feat/dashboard-connect-coach

Conversation

@aderaaij

Copy link
Copy Markdown
Owner

What

Settings gets an AI coach card for athletes. Connect opens a dialog: pick Claude Desktop, Claude Code, Cursor, VS Code or Other, and it creates a token named "Coach · " and shows numbered steps plus the snippet with the server address and token already filled in, ready to copy.

Why

Connecting a client meant creating a token, then going to the README and substituting the address and token into a snippet by hand. This removes the copy-paste mistakes for every client while the token-based flow is what we have.

Details

  • The address is the origin the dashboard is open at. The Claude Desktop snippet adds --allow-http when that origin is plain http and not the local machine.
  • The VS Code config keeps the token out of the file (it prompts), so the token is shown with its own copy button.
  • Hidden for admins and when MCP_ENABLED=false. /api/health now reports mcp so the dashboard can tell; the sidebar's liveness probe and Settings share one query (useLiveness).
  • Copy falls back to the legacy copy command on plain-http origins, where the clipboard API does not exist, and says so when nothing was copied.
  • Snippet building is a pure module, frontend/src/lib/coachSetup.ts. It mirrors the README's "Connect a client" section.
  • README: one line pointing at the new flow. CHANGELOG: an Unreleased entry (may conflict trivially with Add built-in HTTPS via an optional Caddy compose file #15).

A second commit corrects CLAUDE.md: this deployment uses Tailscale Serve (tailnet only), not Funnel.

Verification

On the demo stack built from this branch:

  • The card renders for the athlete and is absent for the admin.
  • The token is created and appears under Devices & tokens; all five client views render; Copy flips to "Copied".
  • An MCP initialize with the generated token returns 200 from /mcp.
  • npx mcp-remote <url> --header 'Authorization:${AUTH_HEADER}', the shape the Claude Desktop snippet uses, connects and returns the server handshake.
  • Backend suite locally: 276 passed, 3 failed in test_backup.py because pg_dump is not installed on the machine it ran on.

Not checked: the --allow-http branch and the clipboard fallback (the demo runs on localhost, where neither triggers). There are no frontend unit tests in the repo, so the snippet builder has none.

`tailscale serve status` on the host reports all three ports as tailnet
only, and the hostname has no public DNS record. Nothing is reachable
from the internet, which matters for anything that calls in from a
provider's cloud (hosted MCP connectors).
Connecting an MCP client meant creating a token in Settings, then going
to the README for a snippet and substituting the server address and the
token by hand. Settings now has an AI coach card: pick Claude Desktop,
Claude Code, Cursor, VS Code or another client, and it creates a token
and shows the steps and the snippet with both already filled in.

The address is the origin the dashboard is open at, so it is right for
however the athlete reaches the server; the Claude Desktop snippet adds
--allow-http when that origin is plain http. The VS Code config keeps
the token out of the file, so the token is shown and copied separately.

The card is hidden for admins, who have no training data, and when the
endpoint is off: /api/health now reports `mcp` for that. The sidebar's
liveness probe and Settings share one query.

Copying falls back to the legacy copy command, because the clipboard
API does not exist on a plain-http origin, and the button says so when
nothing was copied.
@aderaaij
aderaaij merged commit cda3ee6 into main Nov 13, 2026
3 checks passed
@aderaaij
aderaaij deleted the feat/dashboard-connect-coach branch November 13, 2026 17:34
aderaaij added a commit that referenced this pull request Nov 13, 2026
Fix the coach setup instructions found in review of #17
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