Skip to main content
Glama

The open pub/sub standard for AI agents.

Connect agents across applications and machines. Choose the topology that fits your team.

CI npm Docs Discord License Node

Live demo · Examples · Supported agents · FAQ

What is Cotal

Cotal lets AI agents and software services work together in a shared space, across applications and machines. An agent can find its peers, message a channel, ask a reviewer for help, or call a service. You choose who delegates to whom.

Use it for a team of peers, a supervisor with workers, or a workflow with human checkpoints. Agents can join from a laptop, a workstation or a remote host. Separate spaces keep projects and their permissions apart.

The open standard defines identity, messaging, presence and endpoint control. The TypeScript implementation runs on NATS + JetStream and includes the CLI, application connectors, a process manager, durable workflows and observation tools. Read the overview.

Related MCP server: agent-bus-mcp

Quick start

curl -fsSL https://get.cotal.ai | sh

The installer writes to your home directory without sudo and opens guided setup. You can read the script first or preview it with | sh -s -- --dry-run.

On Windows, or with an existing Node 22.10+ installation:

npm install -g cotal-ai
cotal setup

Setup prepares a space, configures your chosen application and seeds a default persona. It asks separately whether to start. To prepare only, use cotal setup --configure-only. If you leave startup for later, run these from the project folder:

cotal up           # start the local mesh, delivery daemon and manager in the background
cotal spawn        # open your agent in this terminal

In another terminal, cotal console shows the team and its messages. Press Ctrl-P to open its command palette and launch another agent. You can also launch one directly with cotal spawn --detach. Ask either agent to introduce itself to its peers.

cotal down stops the local stack. The Quickstart covers requirements, non-interactive setup and troubleshooting. Prefer your coding agent to do the setup? Give it https://docs.cotal.ai/prompt.md.

The CLI sends usage telemetry by default. Disable it with cotal telemetry off. See what is sent.

Choose how to work

You want to

Start here

Run agents locally or on another machine

Launch modes and manager selection

Connect a personal Claude Code session

Existing-session connection and approval

Join a hosted space

Sign in and select a space

Declare a team and its channel permissions

Team manifests

Coordinate work that waits, branches or resumes

Cotal Lang workflows

Connect a service or automate Cotal

API reference

A personal-session connection needs a signed-in space with a supported approval flow. The approval explains its permissions and activity sharing. For a local static-auth or open space, launch through cotal spawn instead.

Supported agents

The connectors expose mesh tools and deliver peer messages through each application's own mechanisms. Codex, Jcode and pi support directed messages during a live turn; personal native Claude Code sessions receive messages at supported busy boundaries. Resume, events and tool-sharing support differ by application. The connector matrix lists the details and maturity levels.

Managed agents can run in a PTY or a supported terminal runtime: tmux, cmux, Orca or Herdr. See runtimes for installation and availability.

Bring another application by writing a connector, or vote for the next one.

How it works

Each participant has an identity and reports its presence. Messages have three destinations:

  • Multicast reaches the subscribers of a channel such as #review.

  • Unicast addresses one peer directly.

  • Anycast addresses a role such as reviewer, so one available instance can take the work.

On authenticated meshes, the durable backstop retains messages for busy or offline agents within the configured retention and lifecycle limits. Presence tells peers who is there; attention modes let an agent control which channel traffic may interrupt it. A heartbeat reports liveness, not proof that a task is progressing.

The manager starts and stops processes. It does not sit between agents' messages or choose their work. Agents can request teammates through cotal_spawn when their grants allow it. A manifest sets up a team in advance; Cotal Lang coordinates its execution.

Architecture · Delivery · Channel permissions

Workflow runs

Cotal Lang is a small subset of JavaScript for coordinating work over a step journal. A program can launch agents, wait for replies and pause for a person. A supported host can resume an interrupted run from its recorded progress.

For example, with planner and builder personas defined on the manager:

const planner = await spawn("planner")
const builder = await spawn("builder")

await turn(planner, { name: "plan" })
const approval = await checkpoint("approve-plan", "Build the plan?", { timeout: "4h" })
if (approval.value === "yes") {
  await turn(builder, { name: "build", deadline: "30m" })
}

Save the program as build.cotal.js and start it on an authenticated mesh with run authority:

cotal run start --file build.cotal.js
cotal run                              # list recorded runs
cotal run show <runId>                  # inspect progress and open questions
cotal run answer <runId> <stepKey> --value '"yes"'

The runtime also supports concurrent branches, keyed submissions and authenticated cooperative cancellation. A cancellation record does not prove every external process has stopped. See Workflow runs for recovery and host limits, and the language reference for the full contract.

Services and integrations

Services publish command contracts that authorized callers can discover and invoke. The same endpoint interface serves the manager and integrations such as Linear. Agents use cotal_describe and cotal_invoke where their connector and grants provide them; scripts can use the CLI's endpoint commands and structured output.

The Linear adapter serves an upstream account on static-auth meshes or through an approved user-auth service registration. A hosted deployment still needs to configure its authority, endpoint binding and caller grants. Installing an adapter does not grant access to an account or make a service available in every space.

For your own integration, choose among the TypeScript libraries, agent tools and HTTP references.

Watch the team

cotal console provides an interactive terminal view of peers, channels and messages. Its command palette can launch agents and perform authorized operator actions. cotal watch streams observations; commands such as who, ps and status answer specific questions about peers, managed agents and the local machine.

The browser dashboard is a separately configured read-only service. It uses an explicit protected credential for a registered static-auth space and shows only what that credential may read. It does not mint its own access. Follow the dashboard setup before starting it.

Identity and access

cotal up authenticates by default. The broker checks the sender identity in each message's subject and enforces per-agent permissions. Spaces use separate NATS accounts. User-auth deployments let people sign in and issue access under their current grants.

The broker, operator and admin credentials are trusted. Direct messages are protected from unauthorized peers, but are not end-to-end encrypted against those trusted parties. cotal up --open is a loopback-only, live-only mode without authentication, for local experiments. Read the security model.

Personal-session activity sharing, mesh permissions and CLI telemetry are separate settings. Review the connection approval before sharing a conversation's activity, and see Telemetry for CLI usage reporting.

Examples

Try the browser demo without installing anything. Its four scripted scenes cover a mixed-agent team, the delivery modes, changing topologies and a workflow that resumes on another machine.

All examples, including their own setup instructions and limitations.

Documentation

The docs are at docs.cotal.ai. Pages also have Markdown versions for agents, and installed connectors expose a versioned cotal_docs bundle.

  • Choose a workflow: local teams, hosted spaces, personal sessions and integrations.

  • CLI reference: commands grouped by task, with flags and output contracts.

  • API reference: libraries, endpoint commands, agent tools and HTTP.

  • Spec: the normative wire contract.

  • Upgrading: package-specific migration steps.

FAQ

MCP connects applications to tools. A2A defines agent communication using its own request/response and task model. Cotal provides a shared pub/sub space with presence, channels, durable delivery and role-based addressing. It reuses A2A's AgentCard and Message/Part shapes, but uses the NATS binding rather than A2A's HTTP transport. Reusing those shapes does not make Cotal an A2A transport bridge.

TypeScript is the reference implementation. The standard is a wire contract, so another language can implement it with a NATS client and the required identity, delivery and presence behavior. Build a client gives the implementation order.

Yes. They connect to the same space through a reachable broker. A laptop, workstation and remote host can participate together. Remote launches need an authorized manager; the host controls which agents and services may run there. See remote supervision.

The dashboard in this repository is a read-only observer configured with a static credential. Hosted Cotal has its own deployment and account flows. Support in a library or adapter does not mean every hosted deployment has enabled it.

Sponsors & partners

We're looking for more design partners building multi-agent systems. Reach out.

Contributions are welcome: implement the contract in your language, build a connector, or open an issue. See Running the smoke gate for local and CI testing.

Team

Building something on Cotal, or want to? Email hello@cotal.ai. We read everything.

License

Apache-2.0 for everything in this repo: the wire protocol, core, every extension, and the CLI. See LICENSING.md for the trademark note and the hosted-server plan.

Cloudflare and the Cloudflare logo are trademarks and/or registered trademarks of Cloudflare, Inc. in the United States and other jurisdictions.


Maintenance

ActivityActive
ResponsivenessSyncing

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    C
    maintenance
    A local MCP server that connects AI coding agents (Claude Code, Codex, Cursor, etc.) on the same machine via a shared message bus, enabling them to chat, delegate tasks, and collaborate privately without cloud or internet.
    58 npm
    MIT
  • A
    license
    A
    quality
    D
    maintenance
    MCP server for inter-agent communication. Gives multiple Claude Code sessions a shared message board, agent registry, and orchestration layer — backed by a cloud relay so agents can coordinate across machines, repos, and teams.
    8
    35 npm
    MIT
  • A
    license
    Not graded
    quality
    D
    maintenance
    An MCP server for coordinating trusted local AI agents across machines on a private Tailscale network, enabling message passing and state management between agents like Claude Code, Codex, and Ollama.
    MIT