Repository navigation
feat(connect): support stateless MCP 2026 - #4055
Conversation
Test evidence — openwork-connect-and-the-agent-endpoint-implement-stateless-mcp-2026 — 0/0 screenshots passed · 5 assertions✅ 0/0 screenshots passed · 5 assertions · 5 expectations passed · 0 failed · 0 pending
ℹ️ ASSERTION — 1. OpenWork Connect negotiates the current stateless protocolThe outbound client uses automatic SDK negotiation, reaches a 2026-07-28 server through server/discover without initialize or Mcp-Session-Id, and does not misclassify authorization or server failures as legacy-protocol signals.
ℹ️ ASSERTION — 2. The public agent MCP is stateless on the modern wireThe HTTP witness observes a fresh server for every server/discover, tools/list, and tools/call request; 2026 protocol, method, name, client, and capability metadata; and no request or response session identifier.
ℹ️ ASSERTION — 3. Compatibility and notification behavior remain explicitA 2025 SDK client completes initialize and tools/list without a session identifier even when the SDK clones its Request, while modern listeners receive catalog changes through subscriptions/listen only for their authenticated organization and user audience.
ℹ️ ASSERTION — 4. Protocol and authorization boundaries fail closedThe server rejects a protocol header/body mismatch with JSON-RPC error -32020. OAuth prefers resource-specific scopes, rejects unadvertised selections, independently verifies a canonical issuer behind a resource discovery alias, discards alias-supplied endpoints, binds persisted client and token records to their issuer, and preserves issuer-mismatch diagnostics over a captured HTTP 401.
ℹ️ ASSERTION — 5. Managed Connect failures preserve safe API boundariesAn unreachable server plus DCR rejection and modern discovery or legacy initialize failures return the bounded managed-MCP 502 without provider secrets or telemetry noise, while malformed internal SDK data remains a captured generic 500.
Test run created 2026-08-25T01:20:19.827Z · Source: |
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (8cbda049a3275950782132d59525c829ad769084). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
8cbda04 to
f9a4b1d
Compare
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
3f0ef6d to
1f2cdd4
Compare
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (1f2cdd49e35b3c3d7e8ec437727704d7b86aab1c). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
… binding The SDK synthesizes the authorization server URL as the resource root with a trailing slash when no protected-resource metadata exists, while the canonical metadata issuer carries none, and the SDK itself compares the two with RFC 8414's single trailing-slash tolerance. The strict string guards rejected that pair, so the first connect against a metadata-less server registered a client, backfilled the slashful URL as the selected issuer, and then failed every save with an issuer mismatch until an administrator intervened. Credential, registration, verification-stamp, and binding checks now share the root-alias equivalence, the Den backfill prefers the canonical metadata issuer, discovery states are stamped with the canonical issuer, a transient metadata outage no longer invalidates persisted discovery or flags issuer review, and an unchanged discovery load no longer rewrites the connection row on every request.
The health sink promoted protocol_ready only when the handshake success diagnostic reported the legacy initialize request phase, which the negotiation rework no longer emits, so every diagnostic capped at reachable. The negotiated protocol era on the success event now drives the promotion for both eras. The unauthenticated bearer challenge on a server/discover probe also classifies under the protocol-negotiation phase, so the routine 401 challenge that starts every OAuth flow is suppressed instead of being recorded as a provider HTTP failure.
…ts it The scope-selection rewrite dropped the SDK's append of offline_access for refresh-token grants when the authorization server advertises it, which would stop refresh tokens on providers that require the scope explicitly and force recurring reconnects. The patched scope selection restores that append after the advertised-scope validation.
Bun's human-readable summary line varies across local versions, so the agent-endpoint leg now asserts the suite's results from a JUnit report written to a temporary path, keeping the witness stable wherever the eval runs.
A per-member OAuth token response could stamp its issuer into the shared connection's configuration without independent verification, letting one member's provider response repoint the organization-wide issuer used by every other member's OAuth flow. The connection-wide issuer selection now derives only from the administrator's configuration or the connection's own verified discovery state; a token-response issuer still participates in the mismatch guard but is never written to the shared row.
There was a problem hiding this comment.
Warden security clearance: clear. No blocking findings (security or desktop↔den sync) in this diff (42374758203b307b0644a7f7e733b828232bba63). Automated clearance satisfies the required-review gate only — a human still reviews and merges. Analysis run
Summary
/mcp/agentendpoint through the official v2 stateless HTTP handler with a fresh server per request, strict protocol validation, andsubscriptions/listenSafety hardening
Preserved Connect optimizations
/mcp/agentsurface compact: ordinary provider tools remain behind boundedsearch_capabilitiesandexecute_capabilityinstead of being projected into the client contextserver/discoveradvertises protocol capabilities only and does not include the provider tool catalogopenwork/mcpApplaunch reference, then re-list and revalidate the exact connection, tool visibility, and liveui://binding before the unchanged Desktop sandbox renderer loads itVerification
pnpm evals:pr specs/mcp-stateless-2026-transport.test.ts— passed at1f2cdd49e35b3c3d7e8ec437727704d7b86aab1c: 5/5 evidence assertions, 0 failed, 0 pending, 0 skippeddistoutput presentpnpm --filter @openwork/enterprise-mcp-client test— 83/83 passedpnpm --filter openwork-server exec bun test src/local-managed-mcp.e2e.test.ts— 8/8 passed, 147 assertionspnpm --filter @openwork/desktop test— 259 passed, 0 failed, 1 expected platform skipwindow.matchMediasuite-order failures remain. The same seven failures were reproduced on untouchedorigin/dev, while all 43 affected tests pass together in isolation. This PR changes noapps/appsource.[email protected]advisory already present ondevScaling note
Request handling is stateless across replicas. Subscription notifications use an in-process, authenticated-audience-scoped event bus; this matches the current one-replica Den API deployment default. A future multi-replica Den API topology will need a shared event bus for cross-replica notification fan-out.