Commit graph

2,220 commits

Author SHA1 Message Date
cliffhall
cfbdfdf2bd Merge remote-tracking branch 'origin/v2/main' into 1579-wave-1
# Conflicts:
#	AGENTS.md
#	clients/cli/README.md
#	clients/web/src/App.test.tsx
#	clients/web/src/App.tsx
#	clients/web/src/test/core/auth/utils.test.ts
#	core/mcp/node/transport.ts
#	test-servers/src/composable-test-server.ts
2026-07-03 17:39:07 -04:00
Cliff Hall
d825af3781
Merge pull request #1608 from modelcontextprotocol/feat/mid-session-auth
Mid-session authorization (web, TUI, CLI)
2026-07-03 15:33:35 -04:00
Bob Dickinson
d6fe2688e2 Merge branch 'v2/main' into feat/mid-session-auth
Sync with PR base: docs V2 auth nav (#1606) and related v2/main updates.
2026-07-03 11:35:11 -07:00
cliffhall
143e0d3f71 test+docs: add inspectorTabs test; document mid-session auth modules
- Add a dedicated `inspectorTabs.test.ts` (was relying only on incidental
  coverage from App.test.tsx) — covers the tab-id constants and both branches
  of the `isInspectorTabId` type guard; 100% per-file.
- AGENTS.md: extend the `core/auth/` structure-tree entry to describe the new
  mid-session recovery modules (challenge parsing, scope union, shared OAuth UX
  copy, force-reauthorization) and the node loopback callback flow.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZyeWManYTvcXxjcrhxSQc
2026-07-03 13:20:29 -04:00
cliffhall
14404bc405 refactor: remove unsafe non-null assertions / double-cast in auth paths
Address the TypeScript-safety review items on the mid-session auth work:

- oauthManager: replace the unguarded `this.oauthConfig.storage!` assertions on
  the EMA re-mint/persist paths with a `requireStorage()` helper that throws a
  clear error; in `getOAuthState` reuse the already-narrowed local `storage`.
- cli: `parseRunnerOAuthCallbackUrl` always returns a config, so make
  `callMethod`'s `callbackUrlConfig` (and the always-passed `cliAuthOverrides`)
  required instead of asserting them non-null at three call sites.
- test-servers/resolve-config: drop the `as unknown as T` double cast; collect
  into a base-shaped array and do a single honest downcast at the return.

No behavior change; validate + coverage green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZyeWManYTvcXxjcrhxSQc
2026-07-03 13:16:05 -04:00
cliffhall
74c6491b52 refactor(web): resolve Mantine/CSS rule violations in mid-session auth UI
- App.tsx: replace the inline `style={{}}` on the re-auth banner wrapper with
  Mantine style props (pos/top/bg) plus a `.reauth-banner-bar` class for the
  z-index/box-shadow that have no Mantine shorthand.
- App.tsx: extract the ~100-line inline `onAuthorize` and the inline `onCancel`
  step-up handlers into named `handleStepUpAuthorize`/`handleStepUpCancel`.
- ReAuthBanner: move the flat `styles={{ root }}` (background/border) into a
  `reauth` Alert theme variant; replace the raw `<span>` with `<Text>`.
- StepUpAuthModal: extract the inline `onClick` wrapper into `handleAuthorize`.

No behavior change; validate + integration green.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZyeWManYTvcXxjcrhxSQc
2026-07-03 13:03:01 -04:00
cliffhall
f4b6095719 test: close ≥90% per-file coverage gaps for mid-session auth
The mid-session auth work passed `validate`/CI but failed the local-only
`npm run test:coverage` per-file gate (≥90% lines/statements/functions/
branches) on 12 files. Add targeted unit/integration tests so every changed
file clears the gate; annotate provably-dead defensive branches with justified
`/* v8 ignore */` comments rather than relaxing the gate.

Files brought to ≥90 on all four dimensions:
- core/auth: mcpAuth, oauthUx, utils, challenge, node/runner-interactive-oauth
- core/mcp: oauthManager, inspectorClient, node/authChallengeFetch,
  remote/remoteClientTransport, remote/node/{remote-session,server}
- clients/web/src/utils: oauthResume, browserTabVisibility

`npm run test:coverage` now passes (3575 tests, 0 threshold failures);
`npm run validate` green across all four clients.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DZyeWManYTvcXxjcrhxSQc
2026-07-03 12:54:37 -04:00
Bob Dickinson
a066873e37 Fixes for remaining issues 2026-07-02 18:36:44 -07:00
Bob Dickinson
8f1ed7588d Prettier fix on last commit 2026-07-02 18:03:18 -07:00
Bob Dickinson
52023ff1c3 fix(auth): clear OAuth callback timer and reorder EMA scope persist
Clear the loopback callback timeout in runner-interactive-oauth finally
so already_authorized and error paths do not hang the CLI/TUI. Check EMA
step-up satisfaction against minted token scope before persisting the
requested union, matching the standard OAuth path.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-07-02 17:55:34 -07:00
Cliff Hall
c03f2a7df9
Merge pull request #1606 from modelcontextprotocol/docs/v2-auth-nav-and-spec-index
docs(spec): add V2 New Spec Impact review; tidy V2 Auth nav menus
2026-07-02 20:16:53 -04:00
Bob Dickinson
0635d09e83 Fixed CI failure (test fixture) and added local CI script 2026-07-02 17:07:25 -07:00
Bob Dickinson
26876a98d7 Added pretest target to build test server 2026-07-02 16:44:04 -07:00
Bob Dickinson
479e757315 Merge remote-tracking branch 'origin/v2/main' into feat/mid-session-auth 2026-07-02 16:38:33 -07:00
Bob Dickinson
562bdd00f1 All of the mid-session and step-up auth work 2026-07-02 16:35:31 -07:00
cliffhall
d68202a88b docs(spec): add V2 Auth landing page and canonicalize spec top menus (closes #1605)
Add a specification/v2_auth.md landing page summarizing the four auth specs
(EMA / XAA, Hardening, Mid-session, Smoke testing) with a section submenu,
mirroring the V2 UX index pattern.

Add a V2 Auth link (after V2 UX) and a V2 New Spec Impact link to every spec
page's top menu so the top-level nav is uniform, and restructure the four
v2_auth_*.md pages onto the shared two-tier menu (top menu + auth submenu).

Docs only.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
2026-07-02 17:20:06 -04:00
cliffhall
859911d5ad revert(rollup): remove CONTRIBUTORS docs (#1537/#1517) from Wave-1 rollup — tracked separately, not Wave 1 2026-07-02 13:03:41 -04:00
Cliff Hall
c2bc6a6a63
Merge pull request #1603 from modelcontextprotocol/1550-ci-coverage-gate
ci: enforce the ≥90% per-file coverage gate in CI
2026-07-02 12:49:20 -04:00
Cliff Hall
747148fac3
Merge pull request #1597 from modelcontextprotocol/v2/1596-test-stability
test(web): eliminate timeout flakiness in the web test suite
2026-07-02 12:46:53 -04:00
cliffhall
fa274fae06 chore: retarget #1597 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:46:47 -04:00
Cliff Hall
7d4caf8081
Merge pull request #1537 from modelcontextprotocol/chore/1517-contributors-md
docs: add CONTRIBUTORS.md issues-only policy (#1517)
2026-07-02 12:46:31 -04:00
cliffhall
9f0e4d88e2 chore: retarget #1537 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:46:25 -04:00
Cliff Hall
7e1496a338
Merge pull request #1592 from modelcontextprotocol/v2/1548-web-remote-oauth-storage
Web: migrate auth store to shared /store API (RemoteOAuthStorage parity with TUI/CLI)
2026-07-02 12:46:16 -04:00
cliffhall
ca00935d1e chore: retarget #1592 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:46:11 -04:00
Cliff Hall
8b8e46ffee
Merge pull request #1591 from modelcontextprotocol/v2/1559-hostcontext-utils
feat(web): extract hostContext utilities for the Apps host
2026-07-02 12:45:50 -04:00
cliffhall
1fdf03e2ec chore: retarget #1591 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:45:46 -04:00
Cliff Hall
42fb853038
Merge pull request #1590 from modelcontextprotocol/v2/1563-node-proxy
feat(core): honor HTTPS_PROXY/HTTP_PROXY/NO_PROXY in the Node transport
2026-07-02 12:45:30 -04:00
cliffhall
30dc370ddf chore: retarget #1590 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:45:23 -04:00
Cliff Hall
d307639354
Merge pull request #1589 from modelcontextprotocol/v2/1562-oauth-state-hardening
auth hardening: generateOAuthState requires WebCrypto; OAuth callback rejects unparseable state
2026-07-02 12:45:04 -04:00
cliffhall
56ca566296 chore: retarget #1589 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:44:58 -04:00
Cliff Hall
3de93b9beb
Merge pull request #1588 from modelcontextprotocol/v2/1558-sandbox-csp
feat(web): add sandbox CSP builder library (closes #1558)
2026-07-02 12:44:43 -04:00
cliffhall
060b64af1d chore: retarget #1588 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:44:37 -04:00
Cliff Hall
b96fd6eb0d
Merge pull request #1587 from modelcontextprotocol/v2/1557-mcp-app-demo
feat(test-servers): mcp_app_demo preset + _meta on tool/resource defs
2026-07-02 12:44:17 -04:00
cliffhall
3b4c958426 chore: retarget #1587 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:44:12 -04:00
Cliff Hall
53cca10323
Merge pull request #1586 from modelcontextprotocol/v2/1560-downloadfile
feat(web): downloadFile.ts enhancements (downloadBlob, fileNameFromUri, isHttpUrl)
2026-07-02 12:43:52 -04:00
cliffhall
949bc3b514 chore: retarget #1586 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:43:48 -04:00
Cliff Hall
98dff8b0d3
Merge pull request #1585 from modelcontextprotocol/v2/1561-redact-headers
feat(core): redact sensitive headers in the fetch log
2026-07-02 12:43:29 -04:00
cliffhall
ff9269c417 chore: retarget #1585 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:43:24 -04:00
Cliff Hall
72ae119d09
Merge pull request #1584 from modelcontextprotocol/v2/1556-core-appinfo
feat(core): add AppInfo + extractAppInfo() to core/mcp/apps.ts
2026-07-02 12:43:04 -04:00
cliffhall
985ef32de0 chore: retarget #1584 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:42:59 -04:00
Cliff Hall
0fe9c4e4d9
Merge pull request #1583 from modelcontextprotocol/v2/1564-cli-exit-codes
feat(cli): exit-code map + structured JSON error envelopes
2026-07-02 12:42:49 -04:00
cliffhall
436257b17f chore: retarget #1583 onto 1579-wave-1 rollup (empty commit enables base change; tree unchanged) 2026-07-02 12:42:26 -04:00
cliffhall
61ca22003f ci: enforce the ≥90% per-file coverage gate in CI (closes #1550)
Add a CI step that runs `npm run coverage` so a PR that drops any file
below 90% on lines/statements/functions/branches fails the job. Remove
the now-redundant standalone `Run web integration tests` step, since
web's `test:coverage` already runs `--project=unit --project=integration
--coverage`, and update AGENTS.md to reflect that CI now enforces the gate.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
2026-07-02 11:59:32 -04:00
cliffhall
e19d11070a merge: #1599 gate src/lib coverage (#1594) 2026-07-01 22:48:03 -04:00
cliffhall
4b180d919a merge: #1598 redact bodies+URL query (#1593) 2026-07-01 22:48:00 -04:00
cliffhall
775b98a019 docs(core): clarify redaction scope + add nested request-body test
Address round-1 review feedback on fetchTracking redaction:
- Cross-reference REDACTED_VALUE / REDACTED_HEADER_VALUE so a reader
  understands why two identical "[REDACTED]" constants coexist.
- Document that redactBody deliberately scopes to form-encoded + JSON
  (multipart/binary bodies pass through; OAuth never uses multipart).
- Add a tracker-path test asserting a nested sensitive key in a JSON
  request body is redacted in the recorded copy while the live outbound
  body stays byte-identical.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
2026-07-01 22:34:40 -04:00
cliffhall
1fd1313c96 test(web): gate src/lib/** under the coverage include globs (closes #1594)
Broaden the web vitest `coverage.include` from the single-file
`src/lib/sandbox-csp.{ts,tsx}` entry to `src/lib/**/*.{ts,tsx}` so the
per-file >=90 four-dimension gate applies to every library module under
`src/lib`, not just sandbox-csp.

- Add unit tests for the previously-ungated `environmentFactory.ts`
  (createWebEnvironment) and `types/customHeaders.ts` value helpers,
  bringing both to 100% on all four dimensions.
- Annotate downloadFile.ts's provably-dead `?? ""` fallback (String.split
  always returns a non-empty array so .pop() is never undefined) with a
  justified `v8 ignore`, closing its last uncovered branch (92.3 -> 100).

All five src/lib files now report 100/100/100/100.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
2026-07-01 22:23:43 -04:00
cliffhall
524bf2d543 feat(core): redact sensitive body + URL-query fields in fetch log (closes #1593)
Extends the header redaction from #1585. Before a fetch entry reaches any
sink, mask known-sensitive credentials in the request/response bodies and
the URL query string, in addition to headers:

- redactBody(): form-urlencoded + JSON bodies, recursive over nested
  objects/arrays, best-effort (never throws), values-only.
- redactUrlQuery(): masks sensitive query params, preserves path,
  non-sensitive params, and any fragment.
- Sensitive fields: client_secret, code, refresh_token, access_token,
  id_token, code_verifier, client_assertion, assertion, password, token
  (case-insensitive), reusing the [REDACTED] sentinel.

Applied to the request success + error entries and the async response-body
callback. Live outbound requests are byte-identical — only the logged copy
is redacted.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01S3fTN8H3R8YV4yUGvZjYnX
2026-07-01 22:20:42 -04:00
cliffhall
b2ff34a901 merge: chore/1517-contributors-md (#1537) 2026-07-01 22:06:17 -04:00
cliffhall
c6b5af3b81 merge: v2/1596-test-stability (#1597) 2026-07-01 22:05:57 -04:00