/connect

Operations L2+ Production medium usage

/connect

Overview

The /connect command provides comprehensive management of Model Context Protocol (MCP) server connections across the Prismatic Platform's distributed infrastructure. With over 14 MCP servers forming the backbone of multi-instance coordination, this command serves as the primary interface for establishing, monitoring, and managing the communication fabric that enables parallel development operations, shared state management, and real-time synchronization between Claude Code instances.

MCP (Model Context Protocol) enables structured communication between autonomous agents and external tools. Within the Prismatic Platform, MCP servers expose specialized capabilities -- from filesystem operations and database queries to GitHub integration and memory persistence. The /connect command abstracts the complexity of managing these server lifecycles, providing operators with a unified control plane for the entire coordination network.

The command operates under the L2+ authority level and is executed by the mcp-server-coordinator agent. It is part of the platform's 216-command slash command registry, built on the AIAD (Autonomous Intelligence Agent Design) standard. Connection management is foundational to all multi-agent workflows, making this command a critical operational dependency for orchestration, parallel execution, and distributed intelligence gathering.

Beyond simple connectivity, /connect implements role-based coordination with three distinct operational modes: coordinator (central authority for task distribution), worker (execution node receiving and processing tasks), and observer (read-only monitoring of coordination state). This architecture mirrors OTP supervision patterns, ensuring fault-tolerant coordination even when individual instances fail or become temporarily unreachable.

Architecture

The connection management system follows a hub-and-spoke architecture with a shared blackboard for state coordination.

MCP COORDINATION NETWORK
========================

Coordinator Instance (Hub)
    |
    +-- Blackboard (Shared State via ETS/Horde)
    |   |
    |   +-- Active Tasks Registry
    |   +-- Instance Registry (heartbeat-based)
    |   +-- Sync State (vector clocks)
    |   +-- Message Queue (ordered delivery)
    |
    +-- Worker Instance 1 (Spoke)
    |   +-- Local State Cache
    |   +-- Task Queue (priority-ordered)
    |   +-- Health Reporter
    |
    +-- Worker Instance 2 (Spoke)
    |   +-- Local State Cache
    |   +-- Task Queue (priority-ordered)
    |   +-- Health Reporter
    |
    +-- Observer Instance (Read-Only)
        +-- State Mirror (eventual consistency)
        +-- Metrics Collector

Server Categories

CategoryServersPurpose
Core Platformprismatic-mcp (27 tools)Platform-native operations
Filesystemfilesystem-serverFile read/write/search
Version Controlgithub-serverRepository operations
Databasepostgres-serverDatabase queries and management
Searchmeilisearch-serverFull-text search operations
Memorymemory-serverPersistent knowledge storage
Contextcontext7-serverDocumentation context retrieval
Monitoringtelemetry-serverMetrics and event tracking

Usage

Basic Operations

# Check coordination status across all servers
/connect status

# List all active instances with health information
/connect list

# Join coordination network as a worker
/connect join --role worker

# Join as the coordinator (only one per network)
/connect join --role coordinator

# Join as read-only observer
/connect join --role observer

# Broadcast a message to all connected instances
/connect broadcast "Starting integration phase"

# Synchronize state with all instances
/connect sync

Advanced Operations

# Leave coordination network gracefully
/connect leave

# Force reconnection to specific server
/connect reconnect prismatic-mcp

# Check health of specific server
/connect health postgres-server

# Restart all MCP server connections
/connect restart-all

# Show detailed connection metrics
/connect status --verbose

Options & Parameters

ParameterPosition/FlagRequiredTypeDefaultDescription
action$1NostringstatusConnection action: status, list, join, leave, broadcast, sync
instance_id$2Nostring--Target instance ID for directed operations
--roleflagNoenumworkerRole in coordination: coordinator, worker, observer
--timeoutflagNointeger5000Connection timeout in milliseconds
--retryflagNointeger3Number of connection retry attempts
--verboseflagNobooleanfalseShow detailed connection diagnostics

Execution Flow

/connect [action] [options]
    |
    v
PHASE 1: VALIDATION (< 100ms)
    +-- Verify action parameter
    +-- Check authority level (L2+)
    +-- Validate instance_id if provided
    +-- Load server configuration
    |
    v
PHASE 2: DISCOVERY (< 500ms)
    +-- Enumerate configured MCP servers
    +-- Probe server availability (parallel health checks)
    +-- Build connection topology map
    +-- Identify coordinator instance
    |
    v
PHASE 3: EXECUTION (< 2s)
    +-- Execute requested action
    +-- Update blackboard state
    +-- Propagate state changes to peers
    +-- Confirm action completion
    |
    v
PHASE 4: REPORTING
    +-- Display action result
    +-- Show updated connection status
    +-- Log telemetry events
    +-- Update instance registry

Status Output Example

MULTI-INSTANCE COORDINATION STATUS
==================================

This Instance:
  ID: claude-instance-a7b3
  Role: worker
  Status: connected
  Uptime: 2h 14m

Connected Instances: 3
  - claude-instance-f2c1 (coordinator) [active]
  - claude-instance-a7b3 (worker) [active] <- YOU
  - claude-instance-e9d4 (worker) [active]

MCP Servers: 14/14 healthy
  - prismatic-mcp .......... [OK] 27 tools
  - filesystem ............. [OK] 8 tools
  - github ................. [OK] 12 tools
  - postgres ............... [OK] 6 tools
  - memory ................. [OK] 4 tools
  - context7 ............... [OK] 3 tools

Blackboard:
  Active Tasks: 5
  Pending Sync: 0
  Last Sync: 2 seconds ago

Health: EXCELLENT

Integration Points

ComponentRelationshipDetails
Prismatic AgentsExecuted by mcp-server-coordinator agentAgent manages server lifecycle and health monitoring
AIAD RegistryCommand specification and discoveryRegistered as coordination-category command
Quality GatesPre/post execution quality validationConnection health is a quality gate prerequisite
TelemetryCommand execution metricsConnection events emitted as telemetry spans
Prismatic SupervisorProcess supervisionMCP server processes supervised via OTP
Blackboard SystemShared state coordinationETS-backed shared state for multi-instance workflows

MCP Server Setup

The platform provides an automated setup script for all MCP servers:

# Initialize all MCP servers
./scripts/setup-mcp-servers.sh

# Verify server configuration
/connect status --verbose

Configuration is managed through .claude/mcp-servers.json with environment-specific overrides.

Best Practices

  1. Always check status before operations -- Run /connect status at session start to verify all servers are healthy before beginning multi-agent workflows.

  2. Use coordinator role sparingly -- Only one instance should serve as coordinator. Multiple coordinators create split-brain scenarios.

  3. Prefer observer for monitoring -- When you only need to watch coordination state, join as observer to avoid consuming worker slots.

  4. Broadcast before major operations -- Notify all instances before starting operations that may affect shared state, such as database migrations or deployment activities.

  5. Handle disconnections gracefully -- The system implements automatic reconnection with exponential backoff. Do not force-restart servers unless automatic recovery has failed.

  6. Monitor sync lag -- A Pending Sync count above zero for extended periods indicates network issues or an overloaded coordinator.

Error Handling

ErrorCauseResolution
CONNECTION_REFUSEDMCP server not runningStart server via ./scripts/setup-mcp-servers.sh
COORDINATOR_CONFLICTMultiple coordinators detectedLeave one coordinator, demote to worker
SYNC_TIMEOUTState sync exceeded timeoutIncrease --timeout or check network connectivity
BLACKBOARD_FULLShared state exceeded capacityRun /connect sync to flush pending state
AUTH_FAILUREInvalid credentials for serverVerify API keys in environment configuration
INSTANCE_NOT_FOUNDTarget instance ID unknownRun /connect list to find valid instance IDs

Recovery Procedures

# If a server becomes unresponsive
/connect reconnect <server-name>

# If coordination state is corrupted
/connect sync --force

# If all servers need restart
/connect restart-all --staggered

Advanced Usage

Multi-Instance Development Workflow

# Terminal 1: Launch as coordinator
./scripts/dev/launch-multi-claude.sh
/connect join --role coordinator

# Terminal 2: Launch as worker
/connect join --role worker

# Terminal 3: Launch as observer for monitoring
/connect join --role observer

# Coordinator distributes tasks
/connect broadcast "Phase 1: Parallel test execution"

Programmatic Connection Management

# Check connection status programmatically
{:ok, status} = PrismaticClaude.MCP.connection_status()

# Register a new MCP server at runtime
:ok = PrismaticClaude.MCP.register_server(%{
  name: "custom-server",
  url: "http://localhost:8080",
  tools: ["custom_tool_1", "custom_tool_2"]
})

# Monitor connection health via telemetry
:telemetry.attach("mcp-monitor",
  [:prismatic_claude, :mcp, :connection],
  &handle_connection_event/4,
  nil
)

Custom Server Configuration

{
  "prismatic-mcp": {
    "command": "node",
    "args": ["dist/index.js"],
    "env": {
      "PRISMATIC_API_KEY": "${PRISMATIC_API_KEY}"
    },
    "priority": 1,
    "health_check_interval": 30000,
    "restart_policy": "always"
  }
}

Doctrine Compliance

All commands operate under the NO MERCY, NO DOUBTS doctrine:

  • NO MERCY: Zero tolerance for unhealthy server connections. All 14+ servers must report healthy status before multi-agent operations proceed. No degraded-mode operation is acceptable for production workflows.
  • NO DOUBTS: Full server health verification before reporting status. Connection state is validated through active probing, not cached state. Evidence-based health reporting with measurable metrics.

The command enforces NABLA signal plurality by requiring health confirmation from multiple independent probes before declaring a server operational.

  • /agents - List and manage agent ecosystem with status monitoring
  • /commit - Smart commit with quality gates and conventional format
  • /livebook - Livebook integration for interactive Elixir notebooks
  • /code - Core coding implementation and feature development
  • /deploy-unified - Safe validated traceable deployment for all environments
  • /orchestrate - Multi-agent orchestration with 10x efficiency
  • /fix - Bug fix implementation with mandatory regression tests
  • /refactor - Safe refactoring with zero-regression guarantee

Connect & Contribute

Created by Tomáš Korcak (korczis) | Open Source under GHL