Skip to content

journeys: an MCP client connects through OAuth end to end; the credit override reminder asks for a reply once - #148

Merged
ndbroadbent merged 1 commit into
mainfrom
journeys-oauth
Dec 3, 2026
Merged

ndbroadbent merged 1 commit into
mainfrom
journeys-oauth

Conversation

@ndbroadbent

@ndbroadbent ndbroadbent commented Dec 3, 2026 •

Copy link
Copy Markdown
Member

Two changes.

1. An OAuth journey (mcp-client-connects-with-oauth)

The end-to-end proof that /mcp accepts OAuth access tokens (PR #145), in the journeys suite (scripts/screenshots/journeys.mjs, run by scripts/journeys/run.sh). It does what an MCP client does, on the .test hosts behind Caddy with the GitHub stub:

  1. Discover: signed out, POST /mcp on the MCP host answers 401; /.well-known/oauth-protected-resource/mcp names https://mcp.visualci.test/mcp and the MCP host as its authorization server; /.well-known/oauth-authorization-server puts consent at https://app.visualci.test/oauth/authorize and tokens at https://mcp.visualci.test/oauth/token, with S256 PKCE.
  2. Register: dynamic client registration ("Journeys MCP Client", public client, loopback redirect http://127.0.0.1:33418/callback).
  3. Authorize: PKCE S256, scope=mcp, resource=https://mcp.visualci.test/mcp. Signed out, so the browser goes to /login, signs in through the GitHub stub and comes back to the consent page, which names the client and ada@journeys.test. It clicks Allow, and a real loopback listener (as a desktop client runs one) gets the redirect; the state matches and the code is taken.
  4. Token: code and verifier for an access token starting vca_ and a refresh token starting vcr_.
  5. Use: with Authorization: Bearer vca_… on /mcp (from a cookie-free HTTP client, so only the token can sign it in): initialize, tools/list (lists whoami, list_builds, get_build), and whoami, which is Ada with via.source = oauth.
  6. Negative checks: the same token on /mcp/admin is refused (401 or 403); a refresh with the vcr_ token gives a new, different vca_, and tools/list works with it.

2. Credit override reminder: no repeated "reply" line

The credit-override ending-soon email's body already says "If you still need more, reply to this email…", so it no longer ends with "Questions? Reply to this email." (HTML and text). Every other email keeps the line, byte for byte. app/tests/emails.rs gains a test that checks this for each sample. No golden holds the email's text.

VisualCI builds that will change

  • Main build: the two credit_override_ending email snapshots (HTML and text) lose the "Questions? Reply to this email." line. Nothing else changes.
  • journeys build: two new shots, journeys/mcp-client-connects-with-oauth/01-sign-in (the /login page) and 02-consent (the consent page). Neither holds a timestamp or random id.

Checks run (on a build box, with this branch's own Postgres and RustFS)

  • cargo fmt --all --check, cargo clippy --locked --workspace --all-targets -- -D warnings: clean.
  • cargo test --locked --workspace: all pass.
  • scripts/journeys/run.sh as CI runs it: all 7 journeys pass, the new one included.

Not merged here: it merges under the main-merge lock.


Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

@visualci-com

visualci-com Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #223 · 2 changed, 339 unchanged · approved by visualci features agent for Nathan Broadbent

This PR vs base: 2 changed since #221, across 1 build

Snapshot Before After
emails/credit_override_ending-acme-s-extra-visualci-credits-run.html (changed) text text, see the build
emails/credit_override_ending-acme-s-extra-visualci-credits-run.txt (changed) text text, see the build

docspring/visualci · journeys · build #222 · 2 added, 12 unchanged · approved by visualci features agent for Nathan Broadbent

This PR vs base: 2 added since #220, across 1 build

Snapshot Before After
journeys/mcp-client-connects-with-oauth/01-sign-in (added) –
journeys/mcp-client-connects-with-oauth/02-consent (added) –

Updated as builds change. Agents can review with VisualCI's MCP tools.

@ndbroadbent
ndbroadbent merged commit 587b2a6 into main Dec 3, 2026
14 checks passed
@ndbroadbent
ndbroadbent deleted the journeys-oauth branch December 3, 2026 20:22
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