inspector/core/react
Repository files (latest commit first)
Filename Latest commit message Latest commit date
cliffhall bc408f5869 feat(auth): file-backed and in-memory SecretStore for hosts with no keychain
Closes #1950

Before this, a box with no reachable OS keychain — the published
container (no D-Bus session, #1848), Android/Termux (no platform binary,
#1905), a minimal Linux install without libsecret — could not persist an
OAuth client secret or a stdio `env:` value at all. `KeyringSecretStore`
degraded into a store that silently holds nothing: `get` returned null,
`delete` no-opped, and `set` hard-failed with a 503. That is the correct
failure behavior, but it left the documented, supported way to run the
Inspector with no secret persistence whatsoever.

Adds the two missing implementations and, more importantly, the policy
that picks one and the surfaces that say which was picked.

- `FileSecretStore` — one `0600` JSON document at
  `~/.mcp-inspector/secrets.json`, encrypted with AES-256-GCM whenever
  `MCP_INSPECTOR_SECRET_KEY` is set (scrypt, per-file random salt). The
  whole map is encrypted as a unit rather than value-by-value so the
  account names — `${serverId}:${field}` — are hidden too; a per-value
  scheme would leave a readable index of which servers you hold a client
  secret for. A file that can no longer be decrypted reads as empty
  (matching the interface's read tolerance) but *refuses to be written*,
  because replacing a file of still-valid secrets to satisfy an additive
  request destroys data.

- `secret-store-selection.ts` — the policy.
  `MCP_INSPECTOR_SECRET_STORE=keyring|file|memory` wins outright;
  otherwise probe the keychain and, if unreachable, fall back loudly. The
  fallback is `memory` in a container whose secrets directory is not on a
  mount, and `file` otherwise — so mounting the volume the README already
  recommends for the catalog flips the same run to durable storage with
  no configuration, and an unmounted container gets the honest answer
  rather than a file `--rm` will discard. Cached per process so the
  banner, `/api/config`, and the store doing the writing cannot disagree.

- Automatic, but never silent. The downgrade prints at startup, rides
  `GET /api/config`, and is named in a permanent 32px footer at the
  bottom of both dialogs that accept a secret. A startup banner is seen
  once by whoever started the process; a toast is seen once; a
  dismissible banner is the thing a user dismisses before doing the work
  it describes. The plaintext and memory cases render their caveat inline
  in a warning tone — a warning you must hover to discover is not one.

- `SecretStoreUnavailableError` is now the base every store's `set`
  throws, so the routes translate one condition into a 503 instead of
  matching `KeychainUnavailableError` by name.

Docs: the container section of the root README gains a table of which
store you get and how to make secrets survive, plus the
`MCP_INSPECTOR_SECRET_KEY` upgrade/mismatch rules.

Tests: the existing interface contract block is extracted to
`secretStoreContract.ts` and run against all three implementations, so
none can drift on the availability contract. `FileSecretStore` is tested
against a real temp filesystem — mode, cross-instance round-trip, that
the ciphertext does not contain the plaintext, the read-modify-write
race, and every refusal path. Full `npm run ci` passes, per-file gate
included.

Signed-off-by: cliffhall <cliff@futurescale.com>
2026-08-22 12:06:31 -04:00
..
useClientSettingsDraft.ts chore: close quality-gate coverage gaps (#1689) (#1766) 2026-07-24 17:20:12 -04:00
useEmaIdpLoginState.ts fix(auth): guard OAuth-storage async paths against unhandled rejections 2026-07-08 10:59:40 -04:00
useFetchRequestLog.ts feat(core): port v1.5 hook layer (#1243) (#1300) 2026-05-13 17:43:07 -04:00
useInitialConfig.ts feat(auth): file-backed and in-memory SecretStore for hosts with no keychain 2026-08-22 12:06:31 -04:00
useInspectorClient.ts fix: salvage a list result's valid entries when one is malformed (#1909) 2026-08-15 16:52:11 -04:00
useListError.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
useManagedPrompts.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
useManagedRequestorTasks.ts SDK v2 migration (behavior-neutral, versionNegotiation: 'legacy') (#1624) 2026-07-15 10:44:24 -04:00
useManagedResources.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
useManagedResourceTemplates.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
useManagedTools.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
useMessageLog.ts feat(core): port v1.5 hook layer (#1243) (#1300) 2026-05-13 17:43:07 -04:00
usePagedPrompts.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
usePagedRequestorTasks.ts Address @claude review: format core/, typed output-validation error, document progress heuristic 2026-07-15 11:08:54 -04:00
usePagedResources.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
usePagedResourceTemplates.ts SDK v2 migration (behavior-neutral, versionNegotiation: 'legacy') (#1624) 2026-07-15 10:44:24 -04:00
usePagedTools.ts fix: surface list-fetch failures in paginated mode (#1998) 2026-08-17 20:40:23 -04:00
usePendingClientRequests.ts feat(web): render pending sampling/elicitation requests (#1407) (#1411) 2026-06-02 17:52:20 -04:00
useResourceSubscriptions.ts Resources: subscriptions/listen model on modern servers (era fork) (#1630) (#1730) 2026-07-20 19:33:40 -04:00
useServers.ts fix(web): accept CRLF-delimited SSE frames on the servers events stream 2026-08-16 20:07:16 -04:00
useSettingsDraft.ts fix(servers): make settings form re-render on every keystroke (#1361) (#1362) 2026-05-26 13:42:14 -04:00
useStderrLog.ts feat(core): port v1.5 hook layer (#1243) (#1300) 2026-05-13 17:43:07 -04:00