Repository navigation
test(mcp): verify package-first client against enterprise mocks - #2699
Closed
reachjalil wants to merge 21 commits into
Closed
reachjalil wants to merge 21 commits into
reachjalil wants to merge 21 commits into
Conversation
# Conflicts: # pnpm-lock.yaml
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Contributor
|
@reachjalil is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
This was referenced Jul 13, 2026
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Warning
Verification-only branch — do not merge as the production feature.
This draft composes #2670 and #2694 on current upstream
devso they can be tested together without destroying their separate review boundaries.Managerial summary
This rehearsal answers one question: can the new package-first enterprise MCP client operate correctly against realistic, independently packaged Microsoft and ServiceNow fixtures?
Yes, after the rehearsal found and corrected one important source-attribution defect in #2694.
The final automated journey proves for both providers:
It separately proves that an invalid client secret fails specifically at OAuth token exchange.
Microsoft 365 and fixture scope
This PR verifies the provider-neutral remote MCP package against Microsoft-shaped and ServiceNow-shaped mock fixtures. It does not add those provider products as production quick-add connectors.
OpenWork's existing Microsoft 365 quick add remains a separate native OAuth/Microsoft Graph integration and does not exercise
@openwork/enterprise-mcp-client. Jalil verified that native connection independently. The Microsoft Enterprise row below is a deterministic remote-MCP fixture, not a claim that Microsoft 365 quick add was migrated.The long-term direction is to consolidate reusable remote MCP behavior behind package contracts. Migrating native Microsoft 365 or every connection type is outside this verification PR.
Sources and upstream status
devThe source branches remain the authoritative implementation PRs. Fixes found here were committed back to their source owner before this rehearsal was rerun.
Verification matrix
lookup_incidentssafe readoauth-token-exchangeAADSTS7000215fixtureoauth-token-exchangeWhat the rehearsal found
Failure-source attribution bug
The token endpoint returned
invalid_client, then the MCP SDK performed a later successful authorization-server metadata request while cleaning up. The client reported the last request (oauth-server-discovery) instead of the last failed request (oauth-token-exchange).That would have sent an administrator to the wrong owner and violated the core diagnostic requirement.
The correction in #2694 now tracks:
lastRequestPhasefor successful-operation tracing; andlastFailedRequestPhasefor terminal error attribution.Azure localhost callback mismatch
The original mock redirect validator accepted literal loopback IPs but rejected
http://localhost/.... The real Azure development registration and successful Den callback uselocalhost. #2670 now accepts exactlocalhost,127.0.0.1, and[::1]loopback callbacks. The protected lab UI uses a separate exact literal loopback origin (127.0.0.1by default, optionally[::1]) and never treatslocalhostas equivalent.The callback is never normalized: the mock registers and compares exactly what Den displays.
Automated validation
Result: 23 client-package tests plus 4 mock-owned cross-package integration scenarios passed:
The test command builds the mock through its public package export before importing it. It does not bypass the package boundary with a relative source import.
The source mock suites also pass:
Interactive review environment
Full instructions are in
docs/enterprise-mcp-client-verification.md.The local setup runs:
DEN_ENABLE_ENTERPRISE_MCP_CLIENT=true;For OAuth, register Den's exact callback. If Den prints
http://localhost:<port>/..., keeplocalhost. The lab UI's own exact literal loopback origin is a separate security boundary.The integration test is owned by the standalone mock lab, so the production client package has no mock dependency. This keeps Den's pruned Docker workspace installable while still testing both packages through their public contracts.
Manual package-path checkpoint
With
DEN_ENABLE_ENTERPRISE_MCP_CLIENT=true, Jalil observed a successful browser callback for the external MCP connection. Safe mock events prove OAuth discovery, user authorization, token acquisition, resource validation, MCP initialization, andnotifications/initialized. OpenWork then displayed Connected as you. Full catalog pagination and the representative safe read are automated evidence above, not yet a personal UI checkpoint.What this proves—and does not
Proved:
Not proved:
This rehearsal reduces integration risk. It does not replace approved nonproduction tenant verification or maintainer acceptance of either source PR.