Repository navigation
feat(mcp): add package-first enterprise mock lab - #2670
benjaminshafii merged 9 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
@reachjalil is attempting to deploy a commit to the Different AI Team on Vercel. A member of the Team first needs to authorize it. |
Agent integration rehearsal update — 2026-07-11This source branch is published at e1569ec and was exercised in the independent combined rehearsal, #2675. The rehearsal confirmed the realistic pre-registered ServiceNow-style confidential-client path, the read-only catalog test, distinct credential and provider-permission failures, stable UI row targeting, bounded callback replacement, listener cleanup, fail-closed runtime controls, and operation-only denial and throttling faults. Status remains deliberately separate:
This PR remains based on upstream dev because the controlled parent branch exists only on the Jalil fork. #2674 is the approval ledger; this PR is the source and evidence branch. |
e1569ec to
ababe2a
Compare
|
Validation update for exact head
Disposition: test-ready, but intentionally left draft and unmerged. |
* feat(den): add Microsoft 365 permission parity * feat(mcp): add package-first enterprise mock lab (#2670) * feat(mcp): add enterprise mock foundation artifacts * chore(mcp): wire enterprise mock workspaces * ci(mcp): enforce enterprise mock checks * fix(mcp): emit a truly invalid schema fault * feat(mcp): configure exact mock OAuth redirects * feat(mcp): strengthen mock OAuth verification * fix(mcp): accept Azure localhost OAuth callbacks * fix(mcp): close mock sockets across scenario restarts * fix(mcp): make mock listener restarts explicit * fix(oauth): surface safe token exchange failures (#2698) * fix(oauth): surface safe token exchange failures * test(oauth): use synthetic provider diagnostics * feat(mcp): add package-first enterprise MCP client (#2694) * feat(mcp): add enterprise MCP client package * refactor(mcp): harden enterprise client contracts * fix(mcp): preserve the first failing request phase --------- Co-authored-by: Benjamin Shafii <[email protected]> * feat(den): add Microsoft 365 permission parity * fix(oauth): use localhost for local Den callbacks --------- Co-authored-by: Benjamin Shafii <[email protected]>
Important
Review status: focused local and GitHub verification pass. Jalil confirmed a real native Microsoft 365 connection and manually completed the package-driven OAuth/MCP initialization path against this lab. Catalog and safe-read behavior are additionally automated. This remains a draft while the fault walkthrough is reviewed.
Managerial summary
We set out to create a safe development environment where enterprise MCP behavior can be reproduced without depending on a customer tenant for every test.
This PR establishes that foundation in two clean layers:
@openwork/enterprise-mcp-mock-server: a reusable TypeScript package containing provider profiles, OAuth/MCP contracts, deterministic faults, runtime state, and test helpers.@openwork-ee/enterprise-mock-lab: a standalone EE administrator app used to create, configure, start, stop, reset, probe, and delete local mock instances.It does not change Den's production connection implementation. Den integration is reviewed separately in #2694, and combined proof is isolated in #2699.
Microsoft 365 and package scope
The Microsoft-named profiles in this lab are fixtures, not new production connectors. They let the generic remote MCP client rehearse Microsoft-shaped OAuth, catalog, and failure behavior without claiming that OpenWork added Microsoft Enterprise MCP, Work IQ, or Agent 365 as quick-add integrations.
OpenWork's existing Microsoft 365 quick add remains a separate native OAuth/Microsoft Graph integration. Jalil verified that native connection successfully, but it does not exercise this mock package or the package-first remote MCP client.
The longer-term direction is to put reusable remote MCP behavior behind package contracts. This PR provides the test foundation; it does not migrate native Microsoft 365 or claim that every connection already uses the package.
What existed and what this adds
preserve-compatible-oauthretains only compatible, unexpired authority and resets all unsafe transient state.Provider behavior represented
The package includes dated, explicit mock fixture profiles for:
The profiles model OAuth discovery, exact redirect validation, confidential clients, PKCE, scopes/resources, token/refresh behavior, Streamable HTTP MCP initialization, sessions, pagination, catalogs, provider authorization failures, throttling, and operation errors.
These are deterministic development fixtures, not claims of live-provider conformance. Synthetic fields and known gaps are labeled in the profiles and documentation.
Important Azure localhost behavior
Real Microsoft 365 verification confirmed that Den's local callback is an exact URL such as:
The mock now accepts exact HTTP OAuth callbacks on
localhost,127.0.0.1, and[::1], matching native-app loopback development behavior. It still rejects lookalike hosts, credentials, fragments, and non-loopback HTTP callbacks.The admin lab uses an exact literal loopback origin:
127.0.0.1by default, with literal[::1]also supported. It does not treatlocalhostas equivalent. This is a separate trust boundary from the provider OAuth callback and should not be normalized or interchanged.Matching the real Microsoft and ServiceNow failures
Microsoft's
oauth-invalid-clientscenario now returns an Entra-shaped safe response:invalid_client;AADSTS7000215/ error code7000215;The ServiceNow profile returns its own provider-specific
invalid_clientresponse and does not leak Microsoft terminology. Its wording is explicitly synthetic until an approved live ServiceNow tenant capture is available.Neither response echoes the submitted secret.
Diagnostic levels
Verification completed
localhost, IPv4 loopback, IPv6 loopback, and unsafe-lookalike callback cases passed;git diff --checkpassed.The combined client-to-mock proof in #2699 additionally verifies healthy and wrong-secret paths for both Microsoft Enterprise and ServiceNow through the packages' public exports.
What this does not prove
Suggested review path
127.0.0.1by default;[::1]when explicitly configured).localhostcallback.Related PRs
dev.