# Function initializeEventBusBridge

MCP exports - MCP server implementation Split from index.ts for file size compliance (Issue #285) Updated Issue #538: Added missing tool registration exports

- initializeEventBusBridge(
  observer: InteractionSwarmObserver,
  logger: ILogger,
  config?: Partial<
  {
  enabled: boolean;
  maxHistorySize: number;
  subscriptions: {
  consensus: boolean;
  agent: boolean;
  protocol: boolean;
  session: boolean;
  message: boolean;
  byzantine: boolean;
  };
  logging: {
  frequentEventLevel: "debug"
  | "info";
  importantEventLevel: "debug" | "info";
  };
  },
  >,
  ): EventBusBridgeResult

  Initializes the EventBus bridge with SwarmObserver integration.

  Subscribes to configured event patterns and:

  1. Logs events at appropriate levels (debug for frequent, info for important)
  2. Records interactions to SwarmObserver for graph-based analysis
  3. Tracks event statistics for observability

  #### Parameters

  - observer: InteractionSwarmObserver

    SwarmObserver instance for interaction tracking

  - logger: ILogger

    Logger instance for event logging

  - `Optional` config: Partial<
    {
    enabled: boolean;
    maxHistorySize: number;
    subscriptions: {
    consensus: boolean;
    agent: boolean;
    protocol: boolean;
    session: boolean;
    message: boolean;
    byzantine: boolean;
    };
    logging: {
    frequentEventLevel: "debug"
    | "info";
    importantEventLevel: "debug" | "info";
    };
    },
    >

    Optional EventBus configuration

  #### Returns EventBusBridgeResult

  Bridge result with cleanup function

  - Defined in packages/nexus-agents/src/mcp/eventbus-bridge.ts:161