Active Sessions

See which AI agents are currently connected via MCP, what tools they are calling, and how long they have been active.

Overview

Every time an AI client connects via MCP (remb serve or the direct HTTP endpoint), Remb registers a session in Redis. Sessions track the agent type, tool call count, last active timestamp, and any errors encountered. This lets you see exactly which tools your agent is using and when.

CLI

# Table view (default)
remb sessions

# Alias
remb agents

# JSON — pipe to jq for scripting
remb sessions --format json | jq '.sessions[].agentLabel'

Table columns: Agent (IDE or label) | Session ID (prefix) |Tools (call count) | Last Active | Started |Last Tool | Errors

Dashboard

Go to Settings → Sessions in the dashboard for a live view of all connected agents. The dashboard also shows the activity feed — a real-time log of every tool call as it happens.

REST API

GET /api/user/sessions
Authorization: Bearer rmb_your_api_key

# Response
{
  "sessions": [
    {
      "sessionId": "cli-1746145200000",
      "userId": "...",
      "source": "mcp",
      "ideType": "cursor",
      "agentLabel": "Cursor",
      "toolCallCount": 42,
      "lastToolName": "remb__memory_search",
      "lastActiveAt": "2026-05-02T00:00:00.000Z",
      "startedAt": "2026-05-01T22:00:00.000Z",
      "errorCount": 0
    }
  ]
}

Session Lifecycle

EventWhat happens
initialize (MCP handshake)Session registered in Redis with source, IDE type, session ID.
tools/callSession touched — lastActiveAt and toolCallCount updated.
Inactivity (default: 4 hours)Orphan reaper removes stale sessions from Redis SET.
Manual disconnectSession closed; removed from active SET.

Session Data

Sessions are stored in Redis under mcp:session:{sessionId} with a TTL. The mcp:user:{userId}:sessions SET maps users to their active session IDs. An orphaned-session reaper runs every 4 hours to GC stale SET members.

Sessions older than the Redis TTL are automatically expired. If remb sessionsshows no sessions, start remb serve and connect your AI client — sessions only appear while the MCP proxy is active.