sessions
List all active session IDs and their current state to monitor running processes in the sandboxed Bash environment.
Instructions
List all active session IDs and their current state.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- packages/bash-mcp/src/index.ts:106-121 (handler)The handler function for the 'sessions' tool. Lists all active session IDs by returning the keys of the sessions map as JSON.
server.registerTool( 'sessions', { description: 'List all active session IDs and their current state.', }, async () => { return { content: [ { type: 'text', text: JSON.stringify({ sessions: Array.from(sessions.keys()) }), }, ], }; }, ); - packages/bash-mcp/src/index.ts:106-121 (registration)Registration of the 'sessions' tool on the MCP server via server.registerTool().
server.registerTool( 'sessions', { description: 'List all active session IDs and their current state.', }, async () => { return { content: [ { type: 'text', text: JSON.stringify({ sessions: Array.from(sessions.keys()) }), }, ], }; }, ); - Schema/description for the 'sessions' tool. No inputSchema defined since it takes no arguments.
{ description: 'List all active session IDs and their current state.', }, - packages/bash-mcp/src/index.ts:8-8 (helper)Global sessions map (Map<string, Bash>) that stores all active Bash sessions, used by the 'sessions' tool to list session IDs.
const sessions = new Map<string, Bash>();