Problem
RequestContext doesn't carry the inbound transport identifier. Auth and tenant are exposed via ContextVars (adcp.server.auth.current_principal, etc.), but the request's transport is not.
Webhook payload shape selection is transport-dependent: A2A buyers expect Task / TaskStatusUpdateEvent envelopes; MCP buyers expect McpWebhookPayload. Platform methods that fire webhooks (or the in-house webhook service that does so on their behalf) need this signal — without it the platform defaults to one transport and the other side gets the wrong shape (we hit this as #202 locally).
Workaround
We run an 85-LOC ASGI middleware (TransportDetectMiddleware) that classifies the URL path (/mcp or /mcp/* → MCP; host root including /.well-known/agent-card.json → A2A; admin paths → no-op) and stuffs the result into a current_transport ContextVar that platform code reads. Works, but it's URL-path inference outside the SDK's dispatch, and any change to how the framework routes transports silently breaks our detection.
Proposed SDK shape
from adcp.server import current_transport # contextvar set by the dispatcher
# Or as a field on RequestContext:
@dataclass
class RequestContext:
...
transport: Literal["mcp", "a2a"]
The dispatcher already knows which transport invoked it (it picked the route). It's just not surfacing the value to handlers.
Files
Problem
RequestContextdoesn't carry the inbound transport identifier. Auth and tenant are exposed via ContextVars (adcp.server.auth.current_principal, etc.), but the request's transport is not.Webhook payload shape selection is transport-dependent: A2A buyers expect
Task/TaskStatusUpdateEventenvelopes; MCP buyers expectMcpWebhookPayload. Platform methods that fire webhooks (or the in-house webhook service that does so on their behalf) need this signal — without it the platform defaults to one transport and the other side gets the wrong shape (we hit this as #202 locally).Workaround
We run an 85-LOC ASGI middleware (
TransportDetectMiddleware) that classifies the URL path (/mcpor/mcp/*→ MCP; host root including/.well-known/agent-card.json→ A2A; admin paths → no-op) and stuffs the result into acurrent_transportContextVar that platform code reads. Works, but it's URL-path inference outside the SDK's dispatch, and any change to how the framework routes transports silently breaks our detection.Proposed SDK shape
The dispatcher already knows which transport invoked it (it picked the route). It's just not surfacing the value to handlers.
Files
core/platforms/_delegate._build_identity— used to pick A2A vs MCP webhook payload shape.transportfield would have made feat(signing): async revocation-list + JWKS fetchers #202 trivial.