asyncapi: 3.0.0
info:
  title: PlatPhorm MCP Event Interface
  version: "0.1.0"
  description: Public-safe AsyncAPI contract for MCP registry, gateway, factory, and handoff events. Protected payloads and private tool arguments are never published on public event surfaces.
servers:
  public:
    host: mcp.platphormnews.com
    protocol: https
channels:
  mcp/tool-calls/{toolCallId}/events:
    address: mcp/tool-calls/{toolCallId}/events
    messages:
    mcp_initialize:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_started:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_read:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_get:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_allowed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_blocked:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_delegated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_updated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_drift_detected:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_generated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_validated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_published:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_created:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_sent:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
  mcp/handoffs/{handoffId}/events:
    address: mcp/handoffs/{handoffId}/events
    messages:
    mcp_initialize:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_started:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_read:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_get:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_allowed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_blocked:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_delegated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_updated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_drift_detected:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_generated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_validated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_published:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_created:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_sent:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
  mcp/registry/events:
    address: mcp/registry/events
    messages:
    mcp_initialize:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_started:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_read:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_get:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_allowed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_blocked:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_delegated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_updated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_drift_detected:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_generated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_validated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_published:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_created:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_sent:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
  mcp/gateway/events:
    address: mcp/gateway/events
    messages:
    mcp_initialize:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_started:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_read:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_get:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_allowed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_blocked:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_delegated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_updated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_drift_detected:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_generated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_validated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_published:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_created:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_sent:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
  mcp/factory/events:
    address: mcp/factory/events
    messages:
    mcp_initialize:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_started:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_tools_call_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_resources_read:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_list:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_prompts_get:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_allowed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_blocked:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_gateway_delegated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_updated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_registry_drift_detected:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_generated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_validated:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_factory_tool_published:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_created:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_sent:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_completed:
      payload:
        $ref: "#/components/schemas/McpEvent"
    mcp_handoff_failed:
      payload:
        $ref: "#/components/schemas/McpEvent"
operations:
  publishMcpEvent:
    action: send
    channel:
      $ref: "#/channels/mcp~1registry~1events"
components:
  schemas:
    McpTraceContext:
      type: object
      required: [traceId]
      properties:
        traceId:
          type: string
        spanId:
          type: string
        parentSpanId:
          type: string
        traceparent:
          type: string
        tracestate:
          type: string
    McpEvent:
      type: object
      required: [schemaVersion, id, type, trace, publicSafe, payload, createdAt]
      properties:
        schemaVersion:
          const: platphorm.mcp.event.v1
        id:
          type: string
        type:
          enum:
            - mcp.initialize
            - mcp.tools.list
            - mcp.tools.call.started
            - mcp.tools.call.completed
            - mcp.tools.call.failed
            - mcp.resources.list
            - mcp.resources.read
            - mcp.prompts.list
            - mcp.prompts.get
            - mcp.gateway.allowed
            - mcp.gateway.blocked
            - mcp.gateway.delegated
            - mcp.registry.updated
            - mcp.registry.drift_detected
            - mcp.factory.tool.generated
            - mcp.factory.tool.validated
            - mcp.factory.tool.published
            - mcp.handoff.created
            - mcp.handoff.sent
            - mcp.handoff.completed
            - mcp.handoff.failed
        toolName:
          type: string
        resourceUri:
          type: string
        promptName:
          type: string
        handoffId:
          type: string
        trace:
          $ref: "#/components/schemas/McpTraceContext"
        publicSafe:
          type: boolean
        payload:
          type: object
          additionalProperties: true
        createdAt:
          type: string
          format: date-time
x-platphorm-policy:
  auth: PLATPHORM_API_KEY is required for private delivery, replay, mutation, protected tool execution, and audit export.
  privacy: Raw x-vercel-ja4-digest, Authorization, X-PlatPhorm-API-Key, cookies, private tool arguments, and protected tool results are never public event fields.
