Storefront has been decoupled into micro-frontends with a dedicated commerce app and shared shell.

Read the architecture guide →

ADR-002: Use stateless Streamable HTTP for MCP transport

MCP clients communicate with the server over stateless Streamable HTTP, keeping protocol transport independent of client session persistence.

November 4, 2026AcceptedIntegration

1. Context & Problem

BookWorm’s shared AI integration server serves multiple independent consumers—including the Chat and Rating systems—each with its own conversation lifecycles, workflows, and scaling patterns. If the shared integration server had to track connection-level session state for every consumer, it would become coupled to each client’s workflow lifetime and complicate routing and scaling.

The team needed a standard network communication approach that lets any authorized consumer fetch tools, context, or prompts without making the integration server responsible for storing conversational or workflow state.

2. Business Value

  • Simpler scaling and higher resilience: Because the integration server does not hold session state between requests, traffic can be routed to any available instance without sticky connections.
  • Clear separation of responsibilities: Each consuming application owns its own conversation and workflow history, avoiding tangled session lifecycles across teams.
  • Consistent integration experience: Chat, Rating, and future AI consumers connect through one shared integration surface and discovery model.
  • Security preserved: Stateless communication eliminates server-side session clutter while continuing to require full caller authentication and permission checks on every request.

3. How It Works

Instead of keeping long-lived server sessions open for each client, every request to the shared AI integration server is self-contained:

  1. A consuming application—such as Chat or Rating—discovers the integration service and sends a request carrying its authorization credentials and any context needed for that specific lookup.
  2. The integration server verifies the caller’s identity and permissions, handles the request, and returns the response immediately (supporting streamed delivery where needed).
  3. Any ongoing conversation history or multi-step workflow state stays with the consuming application (for example, Chat manages interactive customer sessions, while Rating manages its own review workflows).

4. Trade-offs & Lessons Learned

  • Zero server session affinity vs. self-contained requests: Removing server-side transport state eliminates session cleanup and sticky-routing constraints, but requires clients to send all necessary context with each call rather than assuming the server remembers earlier turns.
  • Stateless does not mean anonymous: Session statelessness applies strictly to transport continuity, not security; caller identity, token exchange, service discovery, and network availability remain hard dependencies.
  • Shared standard vs. client-specific tuning: Using one stateless transport across all consumers avoids maintaining duplicate transport stacks, at the cost of requiring every consumer to fit the shared protocol contract.

Alternatives Evaluated

  • Stateful transport sessions: Rejected because tracking protocol sessions on a shared server introduces lifecycle management, instance affinity, and confusion between transport state and conversational state.
  • Separate transport mechanisms per consumer: Rejected because it duplicates server operations and transport configuration across teams.
  • Treating statelessness as a substitute for authentication: Rejected because lack of server session state does not remove the need for strict authorization checks.

5. Technical Reference

  • Decision status: Accepted (2026-11-04)
  • Affected systems & services: MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs, Chat APIServicev1.0.0Chat APIInternal HTTP host for BookWorm's interactive multi-agent chat workflow, agent discovery, and session persistence. Ownerai-capabilities-teamDiagramRepositoryOpen docs, Rating APIServicev1.0.0Rating APIInternal HTTP and A2A gRPC service for collecting, listing, deleting, and summarizing customer feedback for Catalog book...PublishesFeedbackCreatedIntegrationEvent, FeedbackDeletedIntegrationEventSubscribesCreateFeedback, DeleteFeedback +3APIsOpenAPI, AsyncAPIOwnercatalog-experience-teamDiagramRepositoryOpen docs, mcp-tools, chat-system, rating-system
  • Transport configuration: MCP ServerServicev1.0.0MCP ServerInternal stateless Streamable HTTP MCP service that exposes read-only Catalog lookup tools and reusable AI prompts. PublishesListBooksGrpc, GetBookDetailsGrpc +2Ownerai-capabilities-teamDiagramRepositoryOpen docs uses Streamable HTTP transport configured for stateless sessions at /mcp.
  • Client connectivity: Clients discover the service endpoint through service discovery and connect via the shared MCP client integration using token exchange and configured caller authentication/authorization policies.
  • State boundary: Consuming applications (chat-api, rating-api) own conversational and workflow persistence; /mcp retains no transport session state between requests.