MCP, A2A, and ACP - thangchung/mcp-labs GitHub Wiki

Introduction

  • Model Context Protocol (MCP) developed by Anthropic
erDiagram
    title "Model Context Protocol Schema (2025-03-26)"

    %% -- Main Entity --
    "ModelContextProtocol" {
        string protocol "Protocol identifier, e.g., 'model-context-protocol' *"
        string version "Schema version, e.g., '2025-03-26' *"
        ModelProfile model "The model that generated this context"
        string system "The system prompt"
        Tool tools[] "Tools available to the model"
        Message conversation[] "The conversation history *"
        LlmRequestOptions llm_request_options "LLM request options used"
    }

    %% -- Reusable Definitions --
    "Message" {
        string role "'system', 'user', 'assistant', or 'tool' *"
        string content "The message content"
        ToolCall tool_calls[] "Tool calls made by the assistant"
        string tool_call_id "ID for a tool result message (Required if role is 'tool')"
        string name "Name of the tool for a tool result message"
    }

    "Tool" {
        string type "Type of tool, e.g., 'function' *"
        object function "The function definition *"
    }

    "ToolCall" {
        string id "Unique ID for the tool call *"
        string type "Type of tool call, e.g., 'function' *"
        object function "The function that was called *"
    }

    "ModelProfile" {
        string id "Unique model identifier *"
        string name "Human-readable model name *"
        string provider "Model provider, e.g., 'openai' *"
        string mode "Model mode, e.g., 'chat-completion'"
    }

    "LlmRequestOptions" {
        number temperature "Sampling temperature"
        number top_p "Nucleus sampling probability"
        integer max_tokens "Max tokens to generate"
        string[] stop "Stop sequences"
        number presence_penalty "Presence penalty"
        number frequency_penalty "Frequency penalty"
    }

    %% -- Relationships --
    ModelContextProtocol ||--|{ Message : "contains"
    ModelContextProtocol |o--|{ Tool : "can have"
    ModelContextProtocol |o--|| ModelProfile : "generated by"
    ModelContextProtocol |o--|| LlmRequestOptions : "uses"
    Message              |o--|{ ToolCall : "can include"
  • Agent Communication Protocol (ACP) developed by IBM Research
  • Agent2Agent (A2A) Protocol developed by Google
erDiagram
    title "A2A (App to App) JSON Schema"

    %% -- Main Entity --
    "A2A Message" {
        string version "Protocol version, e.g., '1.0' *"
        string message_id "Unique message ID *"
        string message_type "'start_task', 'update_task', etc. *"
        string sender_id "Sender's package name *"
        Intent intent "The task to be performed *"
        CallContext call_context "Context for voice calls"
        Transcription transcription "User's speech transcription"
        Error error "Error details"
        AppInfo app_info "Information about the destination app *"
        ScreenContext execution_context[] "Context from the screen"
    }

    %% -- Definitions from $defs --
    "Intent" {
        string name "The intent name, e.g., 'actions.intent.CREATE_NOTE' *"
        Param params[] "Parameters for the intent"
    }

    "Param" {
        string name "Parameter name *"
        string values[] "An array of parameter values"
    }

    "AppInfo" {
        string app_name "Destination app's package name *"
        integer min_app_version_code "Minimum supported app version"
        integer max_app_version_code "Maximum supported app version"
    }

    "ScreenContext" {
        string activity_name "Name of the Android activity"
        ViewHierarchy view_hierarchies[] "View hierarchies from the screen"
    }

    "ViewHierarchy" {
        string type "'xml' or 'protobuf' *"
        string content "The serialized view hierarchy content *"
    }

    "CallContext" {
        string call_id "Unique ID for the call session *"
    }

    "Transcription" {
        string text "The transcribed text *"
        boolean is_final "True if this is the final transcription *"
    }

    "Error" {
        string code "Error code, e.g., 'INVALID_REQUEST' *"
        string message "Developer-facing error message *"
    }


    %% -- Relationships --
    "A2A Message" ||--|| AppInfo : "requires"
    "A2A Message" ||--|| Intent : "defines"
    "A2A Message" |o--|| CallContext : "may have"
    "A2A Message" |o--|| Transcription : "may have"
    "A2A Message" |o--|| Error : "may have"
    "A2A Message" |o--|{ ScreenContext : "may provide"

    Intent |o--|{ Param : "can have"

    ScreenContext |o--|{ ViewHierarchy : "can contain"                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

Articles

flowchart TD
    %% Containers
    subgraph AgentA_Service["Agent A (Requester)"]
        A1[FastAPI Server]
        A2[Task Initiator]
        A3[ACP Message Builder]
        A4[MCP Client]
    end

    subgraph AgentB_Service["Agent B (Analyzer)"]
        B1[FastAPI Server]
        B2[ACP Message Handler]
        B3[LLM-Based Analyzer]
        B4[MCP Client]
    end

    subgraph MCP_Service["MCP (Model Context Protocol)"]
        M1[Task Context API]
        M2[Memory Update API]
        M3[In-memory Context Store]
    end

    subgraph A2A_Router["A2A Router (Agent-to-Agent Protocol)"]
        R1[HTTP Router]
        R2[Endpoint Registry - optional]
    end

    %% Interactions
    A2 --> A3
    A3 --> R1
    R1 --> B2
    B2 --> B3
    B3 --> B4
    B4 --> M1
    B4 --> M2
    B3 --> B2
    B2 --> R1
    R1 --> A1
    A1 --> A4
    A4 --> M2

Tools & frameworks