Transport-level routing for MCP/ACP protocols

We appreciate your patience. The service is temporarily operating in an external runtime environment.

Workers Overview

Worker implementations for stdio Bus kernel - high-performance message routing for agent protocols.

Getting Started

Quickstart guide and setup instructions

Overview

Introduction to stdio Bus workers

What are Workers?

Workers are child processes spawned by the stdio Bus kernel that implement specific protocol functionality. The stdio Bus kernel provides the core message routing infrastructure, while workers handle the actual protocol implementations (ACP, MCP, etc.) and use cases.

Workers communicate with the stdio Bus kernel via stdin/stdout using NDJSON (Newline-Delimited JSON), enabling high-performance, language-agnostic protocol implementations.

Architecture

The stdio Bus architecture consists of two main layers:

  1. stdio Bus kernel - The core message routing daemon that manages worker processes and routes messages between clients and workers
  2. Workers Registry - A collection of worker implementations that run as child processes of the kernel

Loading diagram...

stdio Bus architecture with workers
stdio Bus Architecture overview showing client connections, daemon components, and worker processes

Workers Launcher

The Workers Launcher is responsible for initializing and managing the lifecycle of worker processes. It ensures automatic discovery of agents from the ACP Registry and provides dynamic management of worker processes with session affinity routing. The launcher serves as a critical component in maintaining the seamless execution of multiple agents with varying protocols, offering support for orchestration and scalability within the stdio Bus framework.

Launcher: npx @stdiobus/workers-registry

Available Workers

The @stdiobus/workers-registry package provides the following worker implementations:

ACP Worker

Protocol: ACP (Agent Client Protocol)

Launch: acp-worker

Purpose: Complete ACP protocol support including initialize, session management, prompts, and MCP server integration

Use Cases: Running ACP agents with tool execution capabilities

Registry Launcher

Protocol: ACP (Agent Client Protocol)

Launch: registry-launcher

Purpose: Automatic agent discovery from ACP Registry, dynamic agent process management, and session affinity routing

Use Cases: Running multiple ACP agents (Claude, Goose, Cline, GitHub Copilot, etc.) with automatic routing based on agentId

MCP-to-ACP Proxy

Protocol: MCP → ACP (protocol bridge)

Launch: mcp-to-acp-proxy

Purpose: Enables MCP clients to communicate with ACP agents by translating between protocols

Use Cases: IDE integration, connecting MCP-based tools to ACP agents

Echo Worker

Protocol: NDJSON (JSON-RPC)

Launch: echo-worker

Purpose: Testing stdio Bus kernel functionality and serving as a reference implementation for custom workers

Use Cases: Protocol testing, development, and learning

MCP Echo Server

Protocol: MCP (Model Context Protocol)

Launch: mcp-echo-server

Purpose: Provides example MCP tools (echo, reverse, uppercase, delay, error) for testing

Use Cases: Testing MCP integration, development, and debugging

NDJSON Protocol

Workers communicate with stdio Bus kernel via stdin/stdout using NDJSON (Newline-Delimited JSON), a simple and efficient protocol for streaming JSON messages.

Protocol Rules

  1. Input (stdin): stdio Bus sends JSON-RPC messages, one per line
  2. Output (stdout): Workers write JSON-RPC responses, one per line
  3. Errors (stderr): All logging and debug output goes to stderr
  4. Critical: Never write non-JSON to stdout - it will break the protocol

Message Types

Request (requires response):

{"jsonrpc":"2.0","id":"1","method":"test","params":{"foo":"bar"}}
Code block in JSON, 1 line

Response:

{"jsonrpc":"2.0","id":"1","result":{"status":"ok"}}
Code block in JSON, 1 line

Notification (no response):

{"jsonrpc":"2.0","method":"notify","params":{"event":"started"}}
Code block in JSON, 1 line

Session Affinity

Messages with the same sessionId are routed to the same worker instance, ensuring session state is maintained:

{"jsonrpc":"2.0","id":"1","method":"test","sessionId":"sess-123","params":{}}
Code block in JSON, 1 line

Workers must preserve sessionId in responses for proper routing.

Graceful Shutdown

Workers must handle SIGTERM for graceful shutdown:

  1. Stop accepting new messages
  2. Complete in-flight processing
  3. Exit with code 0

stdio Bus sends SIGTERM during shutdown or worker restarts.

Getting Started

To get started with workers:

  1. Install the package: npm install @stdiobus/workers-registry
  2. Get stdio Bus kernel: Available via Docker or build from source
  3. Configure workers: Create a configuration file specifying which workers to run
  4. Run stdio Bus: Start the kernel with your configuration

See the Installation Guide for detailed setup instructions.

Next Steps

Resources

stdioBus
© 2026 stdio Bus. All rights reserved.