list_processes
View all active terminal processes managed by the MCP Terminal server to monitor system activity and manage running applications.
Instructions
List all running processes managed by this MCP server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/processManager.ts:126-142 (handler)The implementation of the `listProcesses` method in `ProcessManager` which retrieves and formats the list of running processes.
async listProcesses(): Promise<{ processes: { id: string; status: "running"; command: string; logFile: string }[] }> { const processes: { id: string; status: "running"; command: string; logFile: string }[] = []; for (const [id, processInfo] of this.processes) { // Get command from spawn arguments (stored in process.spawnargs) const command = processInfo.process.spawnargs?.join(' ') || ''; processes.push({ id, status: 'running', command, logFile: processInfo.logFile, }); } return { processes }; } - src/index.ts:77-84 (registration)Registration of the `list_processes` tool in the MCP server definition.
{ name: 'list_processes', description: 'List all running processes managed by this MCP server', inputSchema: { type: 'object', properties: {}, }, }, - src/index.ts:110-113 (handler)Request handler logic in `src/index.ts` that maps the MCP tool call `list_processes` to the `processManager.listProcesses()` method.
case 'list_processes': { const result = await processManager.listProcesses(); return { content: [{ type: 'text', text: JSON.stringify(result) }] }; } - src/types.ts:44-51 (schema)Type definition for the output of the `list_processes` tool.
export interface ListProcessesOutput { processes: { id: string; status: "running"; command: string; logFile: string; }[]; }