MCP server owner handout: internal evidence companion
Internal. The handout for MCP server owners now lives in the user manuals at docs/manuals/mcp-server-owner-integration.md; send that page as-is, since it holds no internal material (#4521 split the two by file). This page is the reviewer evidence behind it: the appendix below maps every claim in the handout to code, and the section numbers it cites (1–8) are the handout's. "Above" in the appendix means the handout page.
Appendix for UpsQuad reviewers — evidence
Every claim above, mapped to code on main @ 0d3cf9fadb575233d76d9eddab2d3168d8430d81 (2026-11-15). Re-derived on 2026-11-21 for #4507 (authenticated discovery), against the tree that change lands, branched from main @ 46df2c13b80b67f4301bd06caf202c77304afd85 and merged with main @ 1118d82c812c1b9867b68461947398196ea54a57: rows 1, 2, 3, 5, 6, 7, 8, 11, 12, 16, 20, 22, 26, 33, 35 and 38 (re-pointed again after the review fix). Those rows cite files #4507 changes, and rows 2 and 6 now state the new behaviour. The other rows were not re-derived and still read from 0d3cf9fad. Public endpoint facts (issuer metadata, JWKS headers, kid) were also read live from https://auth-beta.upsquad.ai on 2026-11-15 with read-only curl. Nothing was run against beta-dev beyond that.
| # | Claim (section) | Evidence |
|---|---|---|
| 1 | Gateway initialize body, protocolVersion 2025-06-18, no client capabilities, clientInfo (3.1, 3.3) | internal/gateway/mcpproxy/group_session.go:180,185-197 |
| 2 | Session-open initialize sends Content-Type + Accept, plus Authorization: Bearer <minted> only when the member's grant carries a token (none in none mode). The client's request is never read on this leg. It dials the grant's effective endpoint. Order per request: the edge list filter (a hidden member is left out silently), then the mint (AuthorizeAggregatedWithClaims), then the initialize. A member whose configured credential cannot be minted is never dialled (upstream_credential_unavailable). Needs 2xx + Mcp-Session-Id; the body is drained and ignored (3.2, 3.3, 6.3) | internal/gateway/mcpproxy/group_session.go:217-252 (target :227, headers :231-235, drain :240-243, status :244-246, header :247-250), per-member credential before the dial :313-325; internal/gateway/mcpproxy/aggregated.go:219-253 (filter, then mint, then initialize; empty session when every member is hidden :243), :456-470 (mint), :477-494 (filter) |
| 3 | No notifications/initialized on the gateway's upstream session; agent notifications answered 202 locally; ping local; tools/list answered from the captured surface (3.2, 3.3) | internal/gateway/mcpproxy/aggregated.go:219-281,378-409 |
| 4 | Only streamable-HTTP members are eligible (3.1) | internal/gateway/mcpproxy/group.go:277-285; internal/gateway/mcpproxy/team.go:60-66 |
| 5 | Registration capture: initialize → notifications/initialized → tools/list, 8 s (the credential mint shares that deadline), 1 MiB, JSON or SSE; JSON-RPC error or non-2xx fails it (3.2, 3.5) | internal/mcpserver/probe.go:45,49,53,111-156,186-236,266-323; deadline before the mint internal/mcpserver/service.go:432-433 |
| 6 | Capture carries the credential when one is derivable without an agent, on all three requests: bearer (probing unit's slot, then org _default), oauth2 client_credentials (one token POST). No header for none; for token_exchange (refused before any POST); and when the binding has require_per_agent (refused before any vault read; a public client reads nothing and still mints). A configured credential that cannot be minted means the probe is not attempted, unreachable, class-only last_error. A 401/403 after a header-less probe names why. Redirects refused whatever the client. The first-party seed still sends none (2, 3.2, 3.5) | internal/auth/tokenexchange/discovery.go:74-99 (:82, :91); internal/mcpserver/discovery_credential.go:183-228,239-252 (a ref that is not this server's is never read: registrationVaultRefKey/foreignVaultRef, :93-173); internal/mcpserver/service.go:424-450; a registration bag carrying any vault ref is refused before any SQL, service.go:343-346``; internal/mcpserver/reprobe.go:303-321; headers on every leg internal/mcpserver/probe.go:200-202,253-255; redirects internal/mcpserver/probe.go:99; internal/mcpserver/firstparty_seed.go:489 (nil, unchanged; includes the first-party GitHub server) |
| 7 | Capture triggers: register, URL actually changed, approval while tool_schema empty; no periodic re-probe, and none on a credential or auth-mode change (follow-up #4648) (3.5) | internal/mcpserver/service.go:386,1397-1409,1550-1567; UpdateProbeResult callers: internal/mcpserver/service.go:458, internal/mcpserver/firstparty_seed.go:504, cmd/context-engine/mcp_reprobe.go:44 (no ticker in internal/mcpserver or cmd/context-engine/mcp_reprobe.go) |
| 8 | Tool name {server}__{tool}; prefix = server name, 2-64 chars, unique per org; rewritten back to the raw name on call (3.5, 3.6) | internal/gateway/mcpproxy/group.go:43,74-77,159-161; internal/mcpserver/service.go:49-50,285; internal/gateway/mcpproxy/dispatch.go:388-401 |
| 9 | tools/list advertises {"type":"object"} and no description for vendor tools; the worker falls back to "Tool: name" (3.5) | internal/gateway/mcpproxy/dispatch.go:83-116; internal/gateway/mcpproxy/group.go:103-105 (description/schema only for source tools); services/agent-worker/src/agent_worker/graph/nodes.py:1761-1762 |
| 10 | Agent runtime opens a session before every tool call; sends Accept: application/json, text/event-stream; reads the last SSE data: object; shows up to 500 chars of an error body; honours isError (3.1, 3.4, 6.1, 6.2) | services/agent-worker/src/agent_worker/mcp/client.py:153-157,315,411-424,457,480-509 |
| 11 | No upstream DELETE: DELETE only drops the gateway's Redis mapping (3.4) | internal/gateway/mcpproxy/aggregated.go:191-199; internal/gateway/mcpproxy/group_session.go:419-421 |
| 12 | Session mapping lifetime 30 min, fixed from creation (3.4) | internal/gateway/mcpproxy/sessionmap.go:32,73-121; cmd/context-engine/main.go:2233 |
| 13 | Sessionless tools/call is forwarded without Mcp-Session-Id; unknown downstream session → -32000 "initialize first" (3.4, 6.3) | internal/gateway/mcpproxy/dispatch.go:369-386; internal/gateway/mcpproxy/upstream_proxy.go:184-188,205-207 |
| 14 | tools/call header allowlist; Authorization: Bearer only when a token was minted; client Authorization/Cookie never copied; no User-Agent set (3.6, 3.7) | internal/gateway/mcpproxy/upstream_proxy.go:43-58,184-198 (no User-Agent in internal/gateway, internal/mcpserver, internal/mcp, internal/auth/tokenexchange, cmd/context-engine: grep) |
| 15 | Response relayed unchanged minus hop-by-hop; redirects not followed; 4 MiB request cap; client query appended only when the registered URL has none (:160-162); transport failure or timeout before headers → 502, after headers the status is committed and a cut body is a truncated stream (:245-262) (3.1, 3.6, 5, 6.2) | internal/gateway/mcpproxy/upstream_proxy.go:37,62-71,141-149,238-276; internal/gateway/mcpproxy/dispatch.go:411-436 |
| 16 | Timeouts: initialize 15 s, token request 10 s, tools/call 55 s (client timeout covers the body) (3.2, 4.3, 6.2) | cmd/context-engine/main.go:2244,2317,2343 |
| 17 | X-Idempotency-Key relayed and consumed by the edge dedup (3.6) | internal/gateway/mcpproxy/upstream_proxy.go:49-57,209-236 |
| 18 | Upstream modes and their exact config fields; unknown grant_type rejected; bearer needs a vault ref (4) | internal/auth/tokenexchange/config.go:29-70,86-132 |
| 19 | Write-time rules: token_endpoint https, a host, no user-info; no raw secrets in the bag (4.3) | internal/mcpserver/oauth2_settings.go:143-210 |
| 20 | Token request: HTTP Basic with url-escaped id/secret when a secret exists, else client_id in the form; form fields per grant; Accept: application/json; 200 + non-empty access_token required; token_type only defaulted; redirects refused; 1 MiB body cap (4.3, 4.4) | internal/auth/tokenexchange/exchanger.go:82-96,160-209,297-348 |
| 21 | Upstream header is always Bearer + the minted token, whatever token_type is returned (4.3) | internal/gateway/mcpproxy/upstream_proxy.go:196-198 |
| 22 | No upstream token cache: one mint per tools/call, after the edge gates, plus one per session-open initialize for each member the edge admits, and one per registration capture (4, 4.3, 4.4) | internal/gateway/mcpproxy/dispatch.go:288-376; internal/gateway/mcpproxy/aggregated.go:219-253,456-470; internal/mcpserver/service.go:424-450; internal/auth/oauth/terminator.go:325-438 |
| 23 | subject_token = the caller's inbound bearer (the agent's UpsQuad token) (1, 4.4) | internal/auth/oauth/terminator.go:323-325,371 |
| 24 | Mint failure → 403, no forward; audit reasons token_exchange_failed / no_stored_credential (4.2, 6.2) | internal/auth/oauth/terminator.go:395-420; internal/gateway/mcpproxy/dispatch.go:361-365,445-457 |
| 25 | Credential grains agent → team → org; require_per_agent fails closed (4.2) | internal/auth/tokenexchange/scoped_secret.go:72-137 |
| 26 | Secret bounds 8-8192, outer whitespace trimmed, no character below 0x20 or 0x7f (an inner space is accepted); rotation overwrites; separate vault slot per credential type (4.2) | internal/credentialscope/service.go:77-78,141-254,369-371,400-418 |
| 27 | Agent JWT: RS256, kid, typ JWT; ~10 min TTL; aud = <base>/mcp/team/<unit> as a one-element array; azp agent-runtime; claim set; no sub, jti or nbf (4.4) | internal/auth/oauth/agent_token.go:40,42-45,52-54,285-309,337-340,354-385 |
| 28 | Internal mint sets no Subject, adds runtime_session_id/delegation_purpose/session_id/human_member_id; external mint adds runtime: "external"; seat tokens are platform-audience only, so they never reach a team server (4.4) | internal/runtime/server/lifecycle_server.go:431-451; internal/auth/oauth/runtime_principal.go:8; internal/auth/oauth/token_endpoint.go:416-422; internal/auth/oauth/seat_grants.go:208-216 |
| 29 | JWKS path, one key, use sig, alg RS256, Cache-Control: public, max-age=300; metadata paths (4.4) | internal/auth/oauth/issuer_routes.go:31,33,51-63,74; live curl 2026-11-15: issuer https://auth-beta.upsquad.ai, one key, kid dev-platform-20261023-094112 |
| 30 | Validators re-fetch the JWKS on an unknown kid; key rotation bumps the kid (4.4) | docs/runbooks/platform-token-issuer.md "rotation" section; internal/auth/oauth/jwks_validator.go:28 |
| 31 | Egress guard: no tenant → deny; IP literal → deny; host must match the tenant allow-list (5) | internal/mcp/egress/guard.go:79-108 |
| 32 | Overridable private ranges and the never-overridable SSRF floor (5) | internal/mcp/egress/deny.go:8-38 |
| 33 | Approval seeds the server URL host only (IP literals and single-label hosts skipped); no MCP path seeds a token-endpoint host (5) | internal/mcpserver/service.go:1531-1542,1601-1632; internal/mcp/egress/seed_mcpapproval.go:71-102; the only INSERT INTO tenant_egress_allowlist is internal/mcp/egress/seed_pgadapter.go, reached from the MCP-approval, first-party and integration-manifest seeds |
| 34 | Connect-time re-validation (DNS rebind) (5) | internal/mcp/egress/roundtripper.go:38-48,157-162 |
| 35 | The server URL may be http:// (only https-only rule is on the token endpoint) (5) | internal/mcpserver/service.go:1657-1672 |
| 36 | Private test CA is dev-only (SSL_CERT_DIR on beta-dev context-engine) (2, 5) | test/harness/betadev-fake-as/README.md "TLS and the trust context-engine gains" |
| 37 | Edge buckets: mint 30/60 s, team gateway 120/60 s, discovery 120/60 s, inbound only; no outbound limiter in the gateway, exchanger or egress packages (5) | infra/edge/README.md rows for auth-beta.upsquad.ai (lines 39-42); infra/edge/envoy.yaml:830-836 (issuer_discovery), :876-882 (issuer_token), :950-957 (mcp_team); grep -i 'ratelimit|limiter' over internal/gateway/mcpproxy, internal/auth/tokenexchange, internal/mcp/egress finds none |
| 38 | Dead member left out of the session, bounded reasons (now including upstream_credential_unavailable), audit row, 502 only when none is reachable; sequential fan-out (6.3) | internal/gateway/mcpproxy/group_session.go:55-92,300-368; internal/gateway/mcpproxy/aggregated.go:219-253,314-364 |
| 39 | External credential helper retries a 401 once with a fresh token (6.2) | cmd/mcp-credential-helper/bridge.go:21-31,253-280 |
| 40 | Unknown tool → -32602, never a misroute (3.5) | internal/gateway/mcpproxy/dispatch.go:234-240 |
| 41 | Production gated: no platform signing key/issuer, MCP_GATEWAY_ENABLED defaults to false; federation parked (2, 4.4) | docs/architecture/governed-mcp-and-the-team-gateway.md §3 and §8 (#1864, #1953); not re-derived in this pass |
| 42 | Worked-example shapes and fixture behaviour (7) | test/harness/betadev-smoke-mcp/{smoke_mcp.py,README.md}; test/harness/betadev-refund-mcp/refund_mcp.py:17-28,162-232; test/harness/betadev-fake-as/fake_as.py:17-40,166-271, test/harness/betadev-fake-as/README.md registration table; url.Values.Encode sorts keys, which gives the form order shown |
Out of scope for vendors, recorded for reviewers. The single-server route /mcp/{id} forwards every method with the minted credential (internal/gateway/mcpproxy/mcpproxy.go:251-300). No agent runtime uses it, and the public edge does not publish it, so the handout describes only the team and group routes.