Skip to content

testing: expose a unified MCP+A2A in-process app builder #1047

Description

@bokelley

Problem

adcp.testing.build_asgi_app() in 8.0.0b4 still builds only the MCP leg. There
is no public in-process builder for the unified MCP+A2A application that
adcp.decisioning.serve(transport="both") runs in production.

The original request in #618 explicitly required the unified MCP+A2A app, but
the shipped helper calls create_mcp_server() and returns
mcp.streamable_http_app(). Its public signature has no transport option.

As a result, a production seller serving both transports cannot run
high-fidelity ASGI tests against its production topology. Our current test
builder must import private internals:

from adcp.server.serve import _apply_asgi_middleware, _build_mcp_and_a2a_app

app = _build_mcp_and_a2a_app(handler, ...)
app = _apply_asgi_middleware(app, asgi_middleware)

This is more than a convenience issue. The two legs use different paths and
authentication conventions, and the combined builder is where routing,
middleware order, discovery, and auth parity can be verified without binding
a socket.

Requested API

Either extend the existing helper:

app = build_asgi_app(platform, transport="both", ...)

or add a clearly named unified builder. It should:

  • support the same "mcp", "a2a", and "both" transport choices as
    production serve();
  • reuse the production composition path rather than duplicating it;
  • forward auth, ASGI middleware, context factory, validation hooks, response
    enhancer, and discovery/public URL configuration consistently;
  • return the app without starting uvicorn;
  • include tests that exercise MCP at /mcp and A2A at host root through the
    same returned app.

Relationship to #618

#618 delivered a useful public MCP-only builder. This issue tracks the
unfulfilled combined-transport part of that original request so adopters can
remove their remaining private server imports.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions