Skip to main content
Glama
StrawHatAI

Claude Desktop Commander MCP

by StrawHatAI

list_sessions

Retrieve all active terminal sessions managed by Claude's MCP server. Quickly monitor and manage ongoing processes on your computer.

Instructions

List all active terminal sessions.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • The handler function that lists active terminal sessions by calling terminalManager.listActiveSessions() and formatting the output as text content.
    export async function listSessions() { const sessions = terminalManager.listActiveSessions(); return { content: [{ type: "text", text: sessions.length === 0 ? 'No active sessions' : sessions.map(s => `PID: ${s.pid}, Blocked: ${s.isBlocked}, Runtime: ${Math.round(s.runtime / 1000)}s` ).join('\n') }], }; }
  • Zod schema defining empty input arguments for the list_sessions tool.
    export const ListSessionsArgsSchema = z.object({});
  • src/server.ts:79-83 (registration)
    Tool metadata registration in the ListTools response, including name, description, and input schema conversion.
    name: "list_sessions", description: "List all active terminal sessions.", inputSchema: zodToJsonSchema(ListSessionsArgsSchema), },
  • src/server.ts:228-229 (registration)
    Dispatch case in CallToolRequest handler that invokes the listSessions function.
    case "list_sessions": return listSessions();

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/StrawHatAI/claude-dev-tools'

If you have feedback or need assistance with the MCP directory API, please join our Discord server