Technical Architecture of AI App Marketplaces and MCP Extension Practices

    This article examines the technical architecture of AI assistant app marketplaces, focusing on how the ecosystem evolves from simple tool calling to embedding full applications directly within the assistant interface. It details the core mechanisms of open protocol extensions and the connector system, which handle capability declaration, context injection, and UI bridging. The article then outlines critical engineering practices, including enforcing least-privilege permissions, ensuring UI rendering isolation, defining verifiable tool declarations, and implementing robust failure and fallback strategies. Finally, it provides deployment recommendations and a six-point assessment checklist to determine whether an embedded application framework is mature enough for production governance.

    1. Background: Why App Marketplaces Are Shifting from “Calling” to “Embedding”

    Early AI assistant ecosystems generally relied on a “tool calling” model. In this setup, the assistant triggered external capabilities via function or plugin interfaces, received the results as text or structured data, and organized them into a natural language response. While efficient for simple queries and calculations, this model reveals significant limitations when tasks involve multi-step operations, state persistence, visual rendering, and in-place interaction:

    • Interaction Discontinuity: Users must leave the chat window to complete operations in another system, breaking the context.
    • State Loss: The assistant cannot perceive what is currently displayed in an external interface, making in-place processing impossible.
    • Limited Capability Expression: Plain text responses struggle to support rich interactive formats like charts, forms, maps, and editors.

    To address these issues, a new architectural approach has emerged: running third-party applications as complete, embedded applications inside the AI assistant. Beyond merely invoking their capabilities, the assistant can now take actions directly on the content displayed within the application window. These capabilities typically rely on an open context protocol extension, allowing partner applications to run across any AI client that supports the protocol without needing separate adaptations for each host environment.

    2. Core Mechanisms: Open Protocol Extensions and the Connector System

    2.1 The Role of Protocol Extensions

    This extension can be understood as a “standard contract layer” between the application and the host. It defines the exchange formats for three types of information: the context provided by the host to the application, the callable capabilities declared by the application to the host, and the UI hosting method for their interaction. Because the contract is open, the same application implementation can be reused across different hosts, which is a prerequisite for scaling an application marketplace.

    2.2 Two Responsibilities of the Connector System

    The connector system typically handles two layers of responsibility:

    1. Discovery and Declaration: When an application starts, it declares its identity, required permissions, list of available tools, and UI resources to the host.
    2. Session and Bridging: It establishes an isolated runtime container for the application, forwards context and invocation requests, and renders the application’s UI into the region designated by the host.

    2.3 Typical Interaction Sequence

    1. User opens an application
    2. -> Host creates an isolated container and injects context (summary of current view, user intent)
    3. -> Application declares its tool list and UI resources
    4. -> User/Assistant triggers an operation
    5. -> Application returns structured results + UI update instructions
    6. -> Host renders the UI, and the assistant continues the conversation based on the results

    The critical point here is “bidirectional visibility”: the application can read the content in the host window, and the assistant can act on elements within the application’s UI. This makes cross-interface tasks possible, such as “Highlight the anomalous rows in this table” or “Generate a summary based on the current filter criteria.”

    3. Key Technical Considerations

    3.1 Permissions and Least Exposure

    Context injection is the most sensitive design point. It is recommended to follow the principle of least necessity: only pass fields required for the current task, mask or summarize sensitive fields, and default to a “session-level, revocable” policy for permission grants.

    1. {
    2. "context": {
    3. "view_type": "table",
    4. "visible_columns": ["id", "amount", "status"],
    5. "masked_fields": ["customer_name"],
    6. "scope": "session_only"
    7. },
    8. "grants": ["read_view", "annotate_cell"]
    9. }

    3.2 Rendering Isolation and UI Security

    Since third-party UIs render inside the host, strict style and script isolation is mandatory to prevent polluting the host UI or accessing host global objects. Common practices include using independent document containers, restricting script capabilities, and exposing only a whitelisted message channel, strictly forbidding the application from directly manipulating the host’s structured data.

    3.3 Verifiability of Tool Declarations

    Tool lists must include explicit input/output schemas and side-effect annotations (read-only/write/irreversible). Based on these annotations, the host decides whether to require secondary confirmation. Irreversible operations should default to a manual confirmation path rather than allowing the model to decide on its own.

    3.4 Failure and Fallback Strategies

    Embedded applications introduce more failure points: container startup failures, protocol version mismatches, and UI resource loading timeouts. A robust implementation requires version negotiation, timeout circuit breakers, and fallback strategies. The goal of a fallback is not to “pretend success,” but to clearly inform the user that a capability is currently unavailable and provide an alternative path.

    4. Engineering Implementation Recommendations

    • Versioned Contracts: Both the protocol and tool schemas require explicit version numbers, maintaining backward compatibility for at least one major version.
    • Observability: Record trace IDs, latency, and result status for every cross-boundary call, making it easier to pinpoint whether an issue lies with the host or the application.
    • Canary Releases and Rollbacks: Launch new applications to a small traffic flow first, and maintain the ability to take them offline with a single action.
    • Leveraging Cloud Infrastructure: Container platforms can host isolated runtimes, object storage can hold static UI resources, message queues can decouple asynchronous tasks, and logging/monitoring services can cover the end-to-end pipeline.

    5. Assessment Checklist

    To evaluate whether an embedded application solution is mature, you can use six self-check questions: Is context exposure minimized and revocable? Is the UI truly isolated? Are tool side effects annotated and tiered for confirmation? Is the protocol versioned and negotiable? Are failures observable and capable of fallback? Can applications be reused across hosts without a rewrite? Only when all six conditions are met can the architecture be considered evolved from “just running” to “governable.”

    6. Conclusion

    The core competitiveness of an AI app marketplace is shifting from “how many tools are integrated” to “whether it can natively host complete applications within a conversation and perform safe, in-place operations.” Using open protocol extensions as the contract layer, the connector system as the runtime, and least privilege combined with isolated rendering as the security foundation is a generalizable engineering path for this direction. Built on top of general cloud infrastructure, such as that provided by Baidu AI Cloud, teams can focus their energy on interaction design and governance capabilities rather than repeatedly building runtime and operations foundations.