Repository navigation
Feat/1509 enterprise managed auth - #1512
Conversation
Integrate #1511 server import modals with EMA Client Settings imports in App.tsx. Co-authored-by: Cursor <[email protected]>
|
@claude review |
|
Claude finished @BobDickinson's task in 2m 39s —— View job Review: Enterprise-Managed Authorization (EMA)I read the core EMA flow ( Correctness
Security
Minor / cleanup
Tasks
Nice work on this — the layering and the inline rationale comments make it easy to follow. The items above are refinements, not blockers. |
|
Those are some good findings. I'll address them before merge. |
…em as “needs IdP login” and redirecting.
Claude Review Follow-upFixed
Not fixed (intentional)Public resource client blockedReview: Why deferred: xaa.dev resource registration is a confidential client (secret required). No deployment in scope needs a public/no-secret resource AS.
|
|
@BobDickinson Resolving conflicts and will review / smoke test. |
…se-managed-auth # Conflicts: # clients/web/src/App.tsx # clients/web/src/components/groups/ServerSettingsForm/ServerSettingsForm.tsx # clients/web/src/components/groups/ServerSettingsModal/ServerSettingsModal.stories.tsx # clients/web/src/components/groups/ServerSettingsModal/ServerSettingsModal.test.tsx # clients/web/src/components/groups/ServerSettingsModal/ServerSettingsModal.tsx # clients/web/src/test/core/mcp/serverList.test.ts # core/mcp/remote/node/server.ts # core/mcp/serverList.ts
|
@claude review |
|
Claude finished @cliffhall's task in 3m 47s —— View job Review: EMA — follow-up roundI re-reviewed the current branch state, focused on verifying the six fixes from the prior round and hunting for anything new. I read the ✅ Prior-round fixes — all verified correct
Investigated and dismissed
New findings (all minor / non-blocking)
None of these block merge — they're robustness refinements on top of an already-solid implementation. Nice work tightening up the refresh and keychain paths since the last round. |
…date normalizeIdpIssuer import Addresses two non-blocking findings from the Claude review on #1512: - POST /api/storage/client now returns 400 (not a generic 500) with the load-path formatting when parseClientConfig throws a ZodError on a malformed body. A bad body is a client error; the keychain/500 path is unchanged for genuine write failures. Adds an integration test for the 400 path. - idpOidc.ts imports normalizeIdpIssuer from its canonical source ./storage.js (matching wire.ts) instead of the ./idpSession.js re-export. Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
|
Thanks for the thorough re-review. Responding to each finding — note this round's commit ( #1 — Client-config validation returns 500 instead of 400 ✅ Fixed in #3 — #2 — Concurrent IdP token refresh has no in-flight dedup — Deferred (acknowledged). #4 — Partial-write split state in The merge itself (conflict resolution across |
|
@claude review |
|
Claude finished @cliffhall's task in 1m 29s —— View job Review: EMA — verification of
|
|
Thanks — appreciate the verification pass.
Calling the merge + the two follow-up fixes done here. Thanks for the review. |





Summary
Implements Enterprise-Managed Authorization (EMA / XAA) for the web client (#1509 — Phases 1–2 + 3b). When a server has
oauth.enterpriseManaged: true, Inspector authenticates against a tenant IdP (install-level config), then mints resource access tokens (legs 2–3) for the server's protected-resource authorization server. Standard OAuth servers are unchanged.Full design, checklist, staging notes, and test plan:
specification/v2_enterprise_managed_auth.md.New concept: install-level Client Settings
Inspector previously had per-server settings in
mcp.json(catalog) and runtime OAuth state (tokens, PKCE, etc.). EMA introduces a third layer: install-level client configuration — settings that apply to the Inspector install as a whole, not to any single MCP server.The first use case is the Enterprise IdP (OIDC client credentials for legs 1–2). Later this blob can grow (client identity, capability toggles) until a fuller "client profiles" model lands.
enterpriseManagedflag~/.mcp-inspector/mcp.json~/.mcp-inspector/storage/client.jsonenterpriseManaged)OAuthStorageadapter (web: sessionStorage today)Important separation: IdP credentials belong in
client.json, not inmcp.jsonor the OAuth token store. Per-serveroauth.clientId/clientSecretunder EMA mean resource authorization server credentials (leg 3), not IdP credentials.Client config storage API
Client config uses the same generic storage backend as other install-level blobs (
oauth, session stores, etc.):clientGET/POST/DELETE/api/storage/client~/.mcp-inspector/storage/client.jsonImplementation:
core/client/—ClientConfigtypes, Zod validation (parseClientConfig/serializeClientConfig), file helpers (loadClientConfig/saveClientConfig→store-io.ts, mode0o600)core/client/remote.ts—loadClientConfigRemote/saveClientConfigRemotefor web (Hono backend incore/mcp/remote/node/server.tsserves/api/storage/:storeId)loadClientConfigRemoteinApp.tsx); Client Settings modal debounces saves viauseClientSettingsDraft→saveClientConfigRemoteNodeClientStorage/loadClientConfigdirectly; not wired in this PROn-disk shape (initial):
Enable/disable: turning off EMA in Client Settings sets
enabled: falsebut retains IdP credentials so re-enable does not require re-entry (isEnterpriseManagedAuthEnabled()/getActiveEnterpriseManagedAuthIdp()incore/client/types.ts).At connect time, web passes active IdP into
InspectorClientOptions.enterpriseManagedAuthand the full install block (including disabled state) asinstallEnterpriseManagedAuthfor error messaging.EMA auth flow (core)
core/auth/ema/idpOidc.ts) via existing OAuth stackwire.ts)wire.ts)emaFlow.ts(trySilentEmaAuth,completeEmaIdpAuthorizationAndMint, 401 refresh)OAuthManager— branches onoauth.enterpriseManaged; quick connect + callback disambiguationEmaTransportOAuthProvider— 401 re-auth (re-run legs 2–3 when IdP session valid)idpSessions; resource tokens saved withenterpriseManaged: true; sign-out clears IdP session + tagged resource entries (clearEnterpriseManagedResourceServers())getOAuthState()— connection snapshot withprotocol: "ema"for Connection InfoWeb UX
enterpriseManagedcheckbox; resource AS client id/secret/scopes; OAuth section hidden for stdio/oauth/callback(protocol from server config, not OAuthstate)EmaClientNotConfiguredErrorwhen EMA server but IdP missing/disabled (persistent toast)Other fixes & infra
AuthTabaligned toOAuthFlowState/getOAuthFlowState()rename (no EMA wiring yet)xaa-ema-http.jsonfixturewire/emaFlowunit tests,inspectorClient-ema-e2e.test.tsyaml+ vitest alias fix for test-servers config loaderOut of scope (follow-up)
client.jsonviaNodeClientStorage)RemoteOAuthStorage/oauth.json(IdP sessions survive browser refresh)RemoteOAuthStorageEMA E2E, 401 re-auth integration stretchManual staging against live xaa.dev verified (documented in spec §Staging validation).
Test plan
npm run validate(web, cli, tui, launcher)npm run test:integration(web)npm run test:storybook(web)Notable automated coverage
core/client/—parseClientConfig, enable/disable semanticsclients/web/src/test/core/auth/ema/— wire + emaFlowclients/web/src/test/integration/mcp/inspectorClient-ema-e2e.test.ts— silent connect, reconnect,enterpriseManagedstorage tagclientConfigError,connection-state, OAuthManager EMA not-configured pathsservers-route.test.ts— keychain secret migration on server-id rename