Skip to main content
Glama
qckfx
by qckfx

kill_process

Terminate a specified Node.js process by its ID using the debugging and process management capabilities of the Node.js Debugger MCP Server.

Instructions

Kill a managed Node.js process

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
pidYesProcess ID to kill

Implementation Reference

  • The main handler function for the 'kill_process' tool. It retrieves the managed process by PID, sends SIGTERM signal to kill it, removes from managed processes, and returns appropriate success or error response.
    private async killProcess(args: { pid: number }) { const managedProcess = this.managedProcesses.get(args.pid); if (!managedProcess) { return { content: [ { type: "text", text: `Process ${args.pid} not found in managed processes`, }, ], isError: true, }; } try { managedProcess.process.kill("SIGTERM"); this.managedProcesses.delete(args.pid); return { content: [ { type: "text", text: `Killed process ${args.pid}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error killing process: ${error}`, }, ], isError: true, }; } }
  • src/index.ts:157-167 (registration)
    Registration of the 'kill_process' tool in the ListToolsRequestSchema response, including name, description, and input schema.
    { name: "kill_process", description: "Kill a managed Node.js process", inputSchema: { type: "object", properties: { pid: { type: "number", description: "Process ID to kill" } }, required: ["pid"], }, },
  • Input schema for the 'kill_process' tool, defining the required 'pid' parameter as a number.
    inputSchema: { type: "object", properties: { pid: { type: "number", description: "Process ID to kill" } }, required: ["pid"], },
  • src/index.ts:247-248 (registration)
    Dispatch case in CallToolRequestSchema handler that invokes the killProcess method for 'kill_process' tool calls.
    case "kill_process": return await this.killProcess(args as { pid: number });

Other Tools

Related Tools

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/qckfx/node-debugger-mcp'

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