Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
🚧 Files skipped from review as they are similar to previous changes (2)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds page-object support for per-user OAuth, refactors client action flows, updates MCP registry specs with display/cancel and full creation tests for headers, OAuth, and per-user OAuth, and adjusts form validation assertions and test imports. ChangesMCP Authentication E2E Test Coverage
sequenceDiagram
participant Runner as Test Runner
participant Setup as Global Setup
participant Registry as Registry App
participant Browser as Browser/Popup
participant AuthDemo as Auth Demo Server (3002)
participant OAuthDemo as OAuth Demo Server (3003)
Runner->>Setup: runMCPSetup
Setup->>AuthDemo: start auth-demo-server (3002)
Setup->>OAuthDemo: start oauth-demo-server (3003)
Runner->>Registry: open MCP registry UI
Runner->>Browser: trigger create-client flows
Browser->>Registry: submit client creation (headers / oauth / per_user_oauth)
alt headers auth
Registry->>AuthDemo: request tools with headers
AuthDemo-->>Registry: return tool list
else oauth / per_user_oauth
Browser->>OAuthDemo: open auth popup / authorize
OAuthDemo-->>Browser: complete login & redirect
Browser->>Registry: popup closed, registry refreshed
end
Registry-->>Runner: client appears in registry
🎯 4 (Complex) | ⏱️ ~45 minutes
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
32cc6f3 to
444c1e7
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@tests/e2e/features/mcp-registry/mcp-registry.spec.ts`:
- Around line 409-436: The test is swallowing popup-close failures and only
checks client row existence (mcpRegistryPage.clientExists), causing false
positives; remove the .catch() on popup.waitForEvent('close') and await it
properly (e.g., await popup.waitForEvent('close', { timeout: 15000 })) so
failures surface, and replace or augment the simple existence assertion with a
post-auth success assertion (e.g., call a helper like
mcpRegistryPage.getClientStatus or mcpRegistryPage.clientIsConnected, or assert
a specific table cell/text such as "Connected" or presence of tools/actions for
that client row) after mcpRegistryPage.createClient and the popup flow to ensure
OAuth actually completed.
In `@tests/e2e/global-setup.ts`:
- Around line 324-392: The startup code for auth-demo-server and
oauth-demo-server currently only checks authServer.pid/oauthServer.pid and waits
1s, which can miss early failures; modify the blocks that spawn authServer
(symbol: authServer, auth-demo-server) and oauthServer (symbol: oauthServer,
oauth-demo-server) to call the existing checkServerReady function for ports 3002
and 3003 respectively after spawn and before logging success, and only push the
process into MCP_SERVERS and log "started" once checkServerReady resolves; keep
the existing pid/unref logic but wrap it so failures in binding cause the catch
branch to run and include these servers in the same readiness pattern used for
port 3001.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 92d25dc9-17a0-40dc-a4b2-ac4e80535132
📒 Files selected for processing (4)
tests/e2e/features/mcp-registry/mcp-registry.data.tstests/e2e/features/mcp-registry/mcp-registry.spec.tstests/e2e/features/mcp-registry/pages/mcp-registry.page.tstests/e2e/global-setup.ts
Confidence Score: 5/5Test-only changes with no impact on production code; safe to merge once the open reliability concerns from earlier review rounds are resolved. All changes are confined to the e2e test layer. The new test suites, data factories, and page-object helpers are well-structured. The known reliability issues (missing readiness polling for the new demo servers, unhandled error events on spawned processes, swallowed popup-close timeout, and the getToolsCount race) were identified and flagged in prior review rounds; no new blocking issues were found in this pass. The open items in Important Files Changed
Reviews (8): Last reviewed commit: "fix: adds e2e tests for mcp headers auth..." | Re-trigger Greptile |
There was a problem hiding this comment.
♻️ Duplicate comments (1)
tests/e2e/global-setup.ts (1)
343-347:⚠️ Potential issue | 🟠 Major | ⚡ Quick winGate auth/oauth server startup on actual readiness before marking success.
Line 343 and Line 378 only gate on
pid+ sleep, so early bind failures can still be reported as “started,” and Line 388-391 then reports “ready” unconditionally. This can make the new auth/OAuth E2E flows flaky.Suggested patch
+ let authReady = false + let oauthReady = false + // Build and start auth-demo-server on port 3002 try { @@ console.log('Starting auth-demo-server on port 3002...') const authServer = spawn(authServerExec, [], { cwd: authServerDir, detached: true, stdio: ['ignore', 'pipe', 'pipe'], }) authServer.stdout?.on('data', (data) => console.log(`[Auth Server] ${data.toString().trim()}`)) authServer.stderr?.on('data', (data) => console.error(`[Auth Server Error] ${data.toString().trim()}`)) - if (authServer.pid) { - authServer.unref() - MCP_SERVERS.push(authServer) - await setTimeout(1000) - console.log('✓ auth-demo-server started on http://localhost:3002/') - } + if (!authServer.pid) throw new Error('Failed to start auth-demo-server - no PID assigned') + authReady = await checkServerReady(3002, 20) + if (!authReady) throw new Error('auth-demo-server failed readiness check on :3002') + authServer.unref() + MCP_SERVERS.push(authServer) + console.log('✓ auth-demo-server started on http://localhost:3002/') } catch (err) { console.warn(`⚠️ Failed to start auth-demo-server (header auth tests may skip): ${(err as Error).message}`) } @@ console.log('Starting oauth-demo-server on port 3003...') const oauthServer = spawn(oauthServerExec, [], { cwd: oauthServerDir, detached: true, stdio: ['ignore', 'pipe', 'pipe'], }) oauthServer.stdout?.on('data', (data) => console.log(`[OAuth Server] ${data.toString().trim()}`)) oauthServer.stderr?.on('data', (data) => console.error(`[OAuth Server Error] ${data.toString().trim()}`)) - if (oauthServer.pid) { - oauthServer.unref() - MCP_SERVERS.push(oauthServer) - await setTimeout(1000) - console.log('✓ oauth-demo-server started on http://localhost:3003/') - } + if (!oauthServer.pid) throw new Error('Failed to start oauth-demo-server - no PID assigned') + oauthReady = await checkServerReady(3003, 20) + if (!oauthReady) throw new Error('oauth-demo-server failed readiness check on :3003') + oauthServer.unref() + MCP_SERVERS.push(oauthServer) + console.log('✓ oauth-demo-server started on http://localhost:3003/') } catch (err) { console.warn(`⚠️ Failed to start oauth-demo-server (OAuth tests may fail): ${(err as Error).message}`) } @@ console.log('✓ MCP servers ready') console.log(' - HTTP/SSE server: http://localhost:3001/') - console.log(' - Auth demo server: http://localhost:3002/') - console.log(' - OAuth demo server: http://localhost:3003/') + if (authReady) console.log(' - Auth demo server: http://localhost:3002/') + if (oauthReady) console.log(' - OAuth demo server: http://localhost:3003/') console.log(' - STDIO server: test-tools-server/dist/index.js')Also applies to: 378-383, 388-391
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@tests/e2e/global-setup.ts` around lines 343 - 347, The startup check currently only verifies authServer.pid and waits a fixed timeout (authServer, MCP_SERVERS, await setTimeout) which can falsely report success; instead gate success on actual readiness by waiting for the child/server to emit a listening event or by polling the server (e.g., an HTTP GET to http://localhost:3002/ until it responds 200 within a timeout) before pushing to MCP_SERVERS and logging success; update all similar blocks (the ones around authServer usage at the earlier and later ranges) to use the same readiness probe and fail/timeout with a clear error if the probe does not succeed.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@tests/e2e/global-setup.ts`:
- Around line 343-347: The startup check currently only verifies authServer.pid
and waits a fixed timeout (authServer, MCP_SERVERS, await setTimeout) which can
falsely report success; instead gate success on actual readiness by waiting for
the child/server to emit a listening event or by polling the server (e.g., an
HTTP GET to http://localhost:3002/ until it responds 200 within a timeout)
before pushing to MCP_SERVERS and logging success; update all similar blocks
(the ones around authServer usage at the earlier and later ranges) to use the
same readiness probe and fail/timeout with a clear error if the probe does not
succeed.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 7346eb59-dc9e-4a40-b014-27076a62437d
📒 Files selected for processing (4)
tests/e2e/features/mcp-registry/mcp-registry.data.tstests/e2e/features/mcp-registry/mcp-registry.spec.tstests/e2e/features/mcp-registry/pages/mcp-registry.page.tstests/e2e/global-setup.ts
🚧 Files skipped from review as they are similar to previous changes (2)
- tests/e2e/features/mcp-registry/pages/mcp-registry.page.ts
- tests/e2e/features/mcp-registry/mcp-registry.spec.ts
444c1e7 to
77573ac
Compare
77573ac to
fa5d218
Compare
6bea147 to
f3772b8
Compare
fa5d218 to
febbbba
Compare
f3772b8 to
0851234
Compare
febbbba to
3210390
Compare
0851234 to
0526f0c
Compare
3210390 to
1a9fad3
Compare
1acb751 to
d7445a0
Compare
4639d59 to
b9741d6
Compare
a474806 to
73d0466
Compare
b9741d6 to
1ce451e
Compare
73d0466 to
d9e850a
Compare
1ce451e to
c70246a
Compare
d9e850a to
300d027
Compare
c70246a to
46c15e2
Compare
46c15e2 to
8bd0b92
Compare
Merge activity
|
The base branch was changed.
…3467) ## Summary Adds end-to-end test coverage for MCP header-based authentication, OAuth 2.0, and Per-User OAuth 2.0 auth flows. This includes new test data factories, test suites exercising the full authorization flow (including popup-based browser consent), and global setup automation to build and start the required demo servers (`auth-demo-server` on port 3002 and `oauth-demo-server` on port 3003). ## Changes - Added `createHeadersAuthClientData`, `createOAuthClientData`, and `createPerUserOAuthClientData` factory functions in `mcp-registry.data.ts` for use in auth-related test scenarios. - Added three new `test.describe` blocks covering header auth UI visibility, header auth client creation and tool discovery, OAuth 2.0 field display and full browser popup authorization flow, and Per-User OAuth 2.0 field display and consent-then-popup authorization flow. - Removed the redundant "should require name for client" test that duplicated coverage already provided by the name format validation test. - Fixed `selectAuthType` to convert underscores to hyphens when resolving `data-testid` attributes (e.g., `per_user_oauth` → `auth-type-per-user-oauth`). - Extended OAuth config form-filling to handle both `oauth` and `per_user_oauth` auth types, which share the same input fields. - Increased `clientExists` wait time from 500 ms to 5000 ms to accommodate the latency introduced by OAuth redirect flows. - Extended `global-setup.ts` to automatically build (if not already built) and spawn `auth-demo-server` and `oauth-demo-server` as background processes before the test suite runs, with graceful warnings if either server fails to start. - Added `per_user_oauth` to the `MCPAuthType` union type. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI - [x] Tests ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs - [x] Tests ## How to test Ensure the demo servers are available under `examples/mcps/auth-demo-server` and `examples/mcps/oauth-demo-server`. The global setup will build and start them automatically. ```sh # Run the full e2e suite (global setup handles server lifecycle) cd tests/e2e pnpm exec playwright test features/mcp-registry/mcp-registry.spec.ts ``` For the OAuth and Per-User OAuth tests, the suite opens a browser popup and completes a login form on the `oauth-demo-server` using the credentials `demo-user`. Ensure the server is reachable at `http://localhost:3003/mcp` before running. For header auth tests, the `auth-demo-server` must be reachable at `http://localhost:3002/` and configured to accept `X-API-Key: super-secret-key` and `X-Tool-Token: tool-exec-secret`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations Test credentials (`super-secret-key`, `tool-exec-secret`, `demo-user`) are hardcoded exclusively for local demo servers used in the e2e test environment and are not used in any production path. ## Checklist - [x] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [x] I verified the CI pipeline passes locally if applicable
…3467) ## Summary Adds end-to-end test coverage for MCP header-based authentication, OAuth 2.0, and Per-User OAuth 2.0 auth flows. This includes new test data factories, test suites exercising the full authorization flow (including popup-based browser consent), and global setup automation to build and start the required demo servers (`auth-demo-server` on port 3002 and `oauth-demo-server` on port 3003). ## Changes - Added `createHeadersAuthClientData`, `createOAuthClientData`, and `createPerUserOAuthClientData` factory functions in `mcp-registry.data.ts` for use in auth-related test scenarios. - Added three new `test.describe` blocks covering header auth UI visibility, header auth client creation and tool discovery, OAuth 2.0 field display and full browser popup authorization flow, and Per-User OAuth 2.0 field display and consent-then-popup authorization flow. - Removed the redundant "should require name for client" test that duplicated coverage already provided by the name format validation test. - Fixed `selectAuthType` to convert underscores to hyphens when resolving `data-testid` attributes (e.g., `per_user_oauth` → `auth-type-per-user-oauth`). - Extended OAuth config form-filling to handle both `oauth` and `per_user_oauth` auth types, which share the same input fields. - Increased `clientExists` wait time from 500 ms to 5000 ms to accommodate the latency introduced by OAuth redirect flows. - Extended `global-setup.ts` to automatically build (if not already built) and spawn `auth-demo-server` and `oauth-demo-server` as background processes before the test suite runs, with graceful warnings if either server fails to start. - Added `per_user_oauth` to the `MCPAuthType` union type. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI - [x] Tests ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs - [x] Tests ## How to test Ensure the demo servers are available under `examples/mcps/auth-demo-server` and `examples/mcps/oauth-demo-server`. The global setup will build and start them automatically. ```sh # Run the full e2e suite (global setup handles server lifecycle) cd tests/e2e pnpm exec playwright test features/mcp-registry/mcp-registry.spec.ts ``` For the OAuth and Per-User OAuth tests, the suite opens a browser popup and completes a login form on the `oauth-demo-server` using the credentials `demo-user`. Ensure the server is reachable at `http://localhost:3003/mcp` before running. For header auth tests, the `auth-demo-server` must be reachable at `http://localhost:3002/` and configured to accept `X-API-Key: super-secret-key` and `X-Tool-Token: tool-exec-secret`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations Test credentials (`super-secret-key`, `tool-exec-secret`, `demo-user`) are hardcoded exclusively for local demo servers used in the e2e test environment and are not used in any production path. ## Checklist - [x] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [x] I verified the CI pipeline passes locally if applicable
…3467) ## Summary Adds end-to-end test coverage for MCP header-based authentication, OAuth 2.0, and Per-User OAuth 2.0 auth flows. This includes new test data factories, test suites exercising the full authorization flow (including popup-based browser consent), and global setup automation to build and start the required demo servers (`auth-demo-server` on port 3002 and `oauth-demo-server` on port 3003). ## Changes - Added `createHeadersAuthClientData`, `createOAuthClientData`, and `createPerUserOAuthClientData` factory functions in `mcp-registry.data.ts` for use in auth-related test scenarios. - Added three new `test.describe` blocks covering header auth UI visibility, header auth client creation and tool discovery, OAuth 2.0 field display and full browser popup authorization flow, and Per-User OAuth 2.0 field display and consent-then-popup authorization flow. - Removed the redundant "should require name for client" test that duplicated coverage already provided by the name format validation test. - Fixed `selectAuthType` to convert underscores to hyphens when resolving `data-testid` attributes (e.g., `per_user_oauth` → `auth-type-per-user-oauth`). - Extended OAuth config form-filling to handle both `oauth` and `per_user_oauth` auth types, which share the same input fields. - Increased `clientExists` wait time from 500 ms to 5000 ms to accommodate the latency introduced by OAuth redirect flows. - Extended `global-setup.ts` to automatically build (if not already built) and spawn `auth-demo-server` and `oauth-demo-server` as background processes before the test suite runs, with graceful warnings if either server fails to start. - Added `per_user_oauth` to the `MCPAuthType` union type. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI - [x] Tests ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs - [x] Tests ## How to test Ensure the demo servers are available under `examples/mcps/auth-demo-server` and `examples/mcps/oauth-demo-server`. The global setup will build and start them automatically. ```sh # Run the full e2e suite (global setup handles server lifecycle) cd tests/e2e pnpm exec playwright test features/mcp-registry/mcp-registry.spec.ts ``` For the OAuth and Per-User OAuth tests, the suite opens a browser popup and completes a login form on the `oauth-demo-server` using the credentials `demo-user`. Ensure the server is reachable at `http://localhost:3003/mcp` before running. For header auth tests, the `auth-demo-server` must be reachable at `http://localhost:3002/` and configured to accept `X-API-Key: super-secret-key` and `X-Tool-Token: tool-exec-secret`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations Test credentials (`super-secret-key`, `tool-exec-secret`, `demo-user`) are hardcoded exclusively for local demo servers used in the e2e test environment and are not used in any production path. ## Checklist - [x] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [x] I verified the CI pipeline passes locally if applicable
…aximhq#3467) ## Summary Adds end-to-end test coverage for MCP header-based authentication, OAuth 2.0, and Per-User OAuth 2.0 auth flows. This includes new test data factories, test suites exercising the full authorization flow (including popup-based browser consent), and global setup automation to build and start the required demo servers (`auth-demo-server` on port 3002 and `oauth-demo-server` on port 3003). ## Changes - Added `createHeadersAuthClientData`, `createOAuthClientData`, and `createPerUserOAuthClientData` factory functions in `mcp-registry.data.ts` for use in auth-related test scenarios. - Added three new `test.describe` blocks covering header auth UI visibility, header auth client creation and tool discovery, OAuth 2.0 field display and full browser popup authorization flow, and Per-User OAuth 2.0 field display and consent-then-popup authorization flow. - Removed the redundant "should require name for client" test that duplicated coverage already provided by the name format validation test. - Fixed `selectAuthType` to convert underscores to hyphens when resolving `data-testid` attributes (e.g., `per_user_oauth` → `auth-type-per-user-oauth`). - Extended OAuth config form-filling to handle both `oauth` and `per_user_oauth` auth types, which share the same input fields. - Increased `clientExists` wait time from 500 ms to 5000 ms to accommodate the latency introduced by OAuth redirect flows. - Extended `global-setup.ts` to automatically build (if not already built) and spawn `auth-demo-server` and `oauth-demo-server` as background processes before the test suite runs, with graceful warnings if either server fails to start. - Added `per_user_oauth` to the `MCPAuthType` union type. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI - [x] Tests ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs - [x] Tests ## How to test Ensure the demo servers are available under `examples/mcps/auth-demo-server` and `examples/mcps/oauth-demo-server`. The global setup will build and start them automatically. ```sh # Run the full e2e suite (global setup handles server lifecycle) cd tests/e2e pnpm exec playwright test features/mcp-registry/mcp-registry.spec.ts ``` For the OAuth and Per-User OAuth tests, the suite opens a browser popup and completes a login form on the `oauth-demo-server` using the credentials `demo-user`. Ensure the server is reachable at `http://localhost:3003/mcp` before running. For header auth tests, the `auth-demo-server` must be reachable at `http://localhost:3002/` and configured to accept `X-API-Key: super-secret-key` and `X-Tool-Token: tool-exec-secret`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations Test credentials (`super-secret-key`, `tool-exec-secret`, `demo-user`) are hardcoded exclusively for local demo servers used in the e2e test environment and are not used in any production path. ## Checklist - [x] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [x] I verified the CI pipeline passes locally if applicable
…aximhq#3467) ## Summary Adds end-to-end test coverage for MCP header-based authentication, OAuth 2.0, and Per-User OAuth 2.0 auth flows. This includes new test data factories, test suites exercising the full authorization flow (including popup-based browser consent), and global setup automation to build and start the required demo servers (`auth-demo-server` on port 3002 and `oauth-demo-server` on port 3003). ## Changes - Added `createHeadersAuthClientData`, `createOAuthClientData`, and `createPerUserOAuthClientData` factory functions in `mcp-registry.data.ts` for use in auth-related test scenarios. - Added three new `test.describe` blocks covering header auth UI visibility, header auth client creation and tool discovery, OAuth 2.0 field display and full browser popup authorization flow, and Per-User OAuth 2.0 field display and consent-then-popup authorization flow. - Removed the redundant "should require name for client" test that duplicated coverage already provided by the name format validation test. - Fixed `selectAuthType` to convert underscores to hyphens when resolving `data-testid` attributes (e.g., `per_user_oauth` → `auth-type-per-user-oauth`). - Extended OAuth config form-filling to handle both `oauth` and `per_user_oauth` auth types, which share the same input fields. - Increased `clientExists` wait time from 500 ms to 5000 ms to accommodate the latency introduced by OAuth redirect flows. - Extended `global-setup.ts` to automatically build (if not already built) and spawn `auth-demo-server` and `oauth-demo-server` as background processes before the test suite runs, with graceful warnings if either server fails to start. - Added `per_user_oauth` to the `MCPAuthType` union type. ## Type of change - [ ] Bug fix - [ ] Feature - [ ] Refactor - [ ] Documentation - [ ] Chore/CI - [x] Tests ## Affected areas - [ ] Core (Go) - [ ] Transports (HTTP) - [ ] Providers/Integrations - [ ] Plugins - [ ] UI (React) - [ ] Docs - [x] Tests ## How to test Ensure the demo servers are available under `examples/mcps/auth-demo-server` and `examples/mcps/oauth-demo-server`. The global setup will build and start them automatically. ```sh # Run the full e2e suite (global setup handles server lifecycle) cd tests/e2e pnpm exec playwright test features/mcp-registry/mcp-registry.spec.ts ``` For the OAuth and Per-User OAuth tests, the suite opens a browser popup and completes a login form on the `oauth-demo-server` using the credentials `demo-user`. Ensure the server is reachable at `http://localhost:3003/mcp` before running. For header auth tests, the `auth-demo-server` must be reachable at `http://localhost:3002/` and configured to accept `X-API-Key: super-secret-key` and `X-Tool-Token: tool-exec-secret`. ## Breaking changes - [ ] Yes - [x] No ## Related issues ## Security considerations Test credentials (`super-secret-key`, `tool-exec-secret`, `demo-user`) are hardcoded exclusively for local demo servers used in the e2e test environment and are not used in any production path. ## Checklist - [x] I read `docs/contributing/README.md` and followed the guidelines - [x] I added/updated tests where appropriate - [x] I updated documentation where needed - [x] I verified builds succeed (Go and UI) - [x] I verified the CI pipeline passes locally if applicable

Summary
Adds end-to-end test coverage for MCP header-based authentication, OAuth 2.0, and Per-User OAuth 2.0 auth flows. This includes new test data factories, test suites exercising the full authorization flow (including popup-based browser consent), and global setup automation to build and start the required demo servers (
auth-demo-serveron port 3002 andoauth-demo-serveron port 3003).Changes
createHeadersAuthClientData,createOAuthClientData, andcreatePerUserOAuthClientDatafactory functions inmcp-registry.data.tsfor use in auth-related test scenarios.test.describeblocks covering header auth UI visibility, header auth client creation and tool discovery, OAuth 2.0 field display and full browser popup authorization flow, and Per-User OAuth 2.0 field display and consent-then-popup authorization flow.selectAuthTypeto convert underscores to hyphens when resolvingdata-testidattributes (e.g.,per_user_oauth→auth-type-per-user-oauth).oauthandper_user_oauthauth types, which share the same input fields.clientExistswait time from 500 ms to 5000 ms to accommodate the latency introduced by OAuth redirect flows.global-setup.tsto automatically build (if not already built) and spawnauth-demo-serverandoauth-demo-serveras background processes before the test suite runs, with graceful warnings if either server fails to start.per_user_oauthto theMCPAuthTypeunion type.Type of change
Affected areas
How to test
Ensure the demo servers are available under
examples/mcps/auth-demo-serverandexamples/mcps/oauth-demo-server. The global setup will build and start them automatically.For the OAuth and Per-User OAuth tests, the suite opens a browser popup and completes a login form on the
oauth-demo-serverusing the credentialsdemo-user. Ensure the server is reachable athttp://localhost:3003/mcpbefore running.For header auth tests, the
auth-demo-servermust be reachable athttp://localhost:3002/and configured to acceptX-API-Key: super-secret-keyandX-Tool-Token: tool-exec-secret.Breaking changes
Related issues
Security considerations
Test credentials (
super-secret-key,tool-exec-secret,demo-user) are hardcoded exclusively for local demo servers used in the e2e test environment and are not used in any production path.Checklist
docs/contributing/README.mdand followed the guidelines