connector.json
Declarative specification for AI-to-AI orchestration. Where MCP defines how AI connects to tools, connector.json defines how AI coordinates with other AI.What It Solves
- Route tasks to different LLMs based on cost or capability
- Run multiple AI sessions in parallel with isolated environments
- Define multi-phase workflows across heterogeneous AI tools
- Fail over to a different provider when one goes down
Spec Overview
Core Sections
session — Environment
How to set up each AI session. Maps to daemon-external plugins that transform PTY session configuration without modifying the terminal engine.
| Field | Type | Description |
|---|---|---|
worktree | string | Git worktree slug for isolated workspace |
sandbox | bool | OS-level process isolation (no network, restricted writes) |
scratchpad | bool | Shared knowledge directory across workers |
env | object | Environment variables injected into session |
permission | string | Permission policy for the session |
timeout_ms | number | Session timeout in milliseconds |
resume | string | Resume an existing worktree session |
models — Routing
Which AI to use for which role. Named aliases that pipeline phases reference.
primary is unavailable, the runtime falls back to fallback automatically.
Cost-aware routing: cheap models for research, expensive models for implementation.
pipeline — Orchestration
Multi-phase workflow with parallel workers.
workers accepts either a number (N identical workers sharing the phase’s model) or an array of worker objects (each with its own model, prompt, machine).
Beyond Pipeline — Communication Topologies
Pipeline is one topology. connector.json supports all:| Type | Field | Description |
|---|---|---|
| Pipeline | "pipeline": { "phases": [...] } | Sequential phases, parallel workers within each |
| Dialogue | phases[].type: "dialogue" | Two agents in multi-round conversation |
| Meeting | "type": "meeting" | All participants hear every voice |
| Mesh | "type": "mesh" | Any agent talks to any agent directly |
| Recursive | Agent runs its own connector.json | Unlimited depth, agents spawn sub-teams |
Relationship to MCP
MCP is a field inside connector.json, not a competing spec.Relationship to OpenCLIs
| OpenCLIs concept | connector.json field |
|---|---|
wrapper_steps | pipeline.phases[].steps |
initiate_md | agent.flow |
trust_domains | trust.domains |
| MCP CLI wrapping | tools.mcp |
Runtime
connector.json is a spec. The runtime that executes it is the NIIA daemon + headless PTY infrastructure.niia run connector.json.
Design Principles
- Declarative — describe what, not how
- LLM-agnostic — any AI CLI that runs in a terminal
- Infrastructure-level — orchestration in daemon, not in prompts
- MCP-complementary — MCP for tools, connector.json for workflows
- File is the plugin — new JSON = new workflow, no code changes
Status
| Component | Status |
|---|---|
| Spec v2.0 | Draft |
session.worktree | Implemented |
session.sandbox | Implemented (macOS) |
models routing | Designed |
pipeline orchestration | Designed |
niia run connector.json | Planned |