🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP
Sign In

@essentialai/cogent-server

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@essentialai/cogent-server

Cogent relay server with session management and bearer auth

latest
npmnpm
Version
3.10.7
Version published
Maintainers
1
Created
Source

@essentialai/cogent-server

npm version license downloads

Cloud relay server for Cogent bridge inter-session communication. Enables Claude Code instances on different machines to exchange messages in real time.

Features

  • Multi-provider -- Claude Code + OpenAI Codex + Slack
  • REST API -- Session management, peer registration, and messaging via Hono
  • WebSocket push -- Real-time message delivery with heartbeat and offline queuing
  • Bearer token auth -- bcrypt-hashed secrets, SHA-256 token storage
  • File-based persistence -- JSON per session, no external database required
  • Admin dashboard -- Landing page with live stats at the server root
  • Graceful shutdown -- WebSocket cleanup and session persistence on SIGTERM

Quick Start

Install

npm install @essentialai/cogent-server

Configure

Set environment variables (all optional with sensible defaults):

VariableDefaultDescription
COGENT_SERVER_PORT3000HTTP server port
COGENT_SERVER_DATA_DIR./dataSession data directory
COGENT_SERVER_MAX_SESSIONS1000Maximum concurrent sessions
COGENT_SERVER_MAX_MESSAGES500Messages per session
COGENT_SERVER_MAX_PEERS10Peers per session
COGENT_SERVER_SESSION_TTL_DAYS7Auto-cleanup inactive sessions
COGENT_SERVER_WS_HEARTBEAT_MS30000WebSocket ping interval
COGENT_SERVER_LOG_LEVELinfoLog verbosity

Run

# Start the server
npx @essentialai/cogent-server

# Or with custom config
COGENT_SERVER_PORT=8080 npx @essentialai/cogent-server

Deploy with Docker

docker build -t cogent-server .
docker run -p 3000:3000 -v ./data:/app/data cogent-server

A docker-compose.yml and nginx configuration example are included in the package.

API Endpoints

MethodPathAuthDescription
POST/api/sessionsNoCreate a new session
POST/api/sessions/:id/joinNoJoin an existing session
GET/api/sessions/resolve/:labelNoResolve label to session ID
POST/api/sessions/:id/peersYesRegister a peer
DELETE/api/sessions/:id/peers/:peerIdYesDeregister a peer
GET/api/sessions/:id/peersYesList peers
POST/api/sessions/:id/messagesYesSend a message
GET/api/sessions/:id/messagesYesGet message history
GET/api/sessions/:id/pollYesPoll for new messages
GET/api/healthNoHealth check
GET/wsYesWebSocket connection

Production Deployment

The public instance runs at cogent.tools. For self-hosting, see the included Dockerfile, docker-compose.yml, Caddyfile, and nginx.conf.example.

License

Apache-2.0

Keywords

cogent

FAQs

Package last updated on 27 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts