Skip to main content
Glama
nexon33

Electron Terminal MCP Server

terminal_stop

Stop an active terminal session managed by the Electron Terminal MCP Server using the specified session ID, ensuring proper session termination and resource cleanup.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
sessionIdYes

Implementation Reference

  • index.js:360-384 (registration)
    Registers the 'terminal_stop' MCP tool. Input schema requires a sessionId string. The handler checks if the server is running (starts Electron if not), then sends a POST request to the API endpoint `/stop/{sessionId}` to stop the terminal session, returning the result message and exit code.
    server.tool( "terminal_stop", { sessionId: z.string() }, async ({ sessionId }) => { try { // Check if server is running, start if not if (!(await isServerRunning())) { await startElectronProcess(); } const response = await axios.post(`${apiBaseUrl}/stop/${sessionId}`); const result = response.data; return { content: [{ type: "text", text: `Session ID: ${result.sessionId}\n\n ${result.message}`, exitCode: result.exitCode }] }; } catch (error) { return formatErrorResponse(error, sessionId); } } );
  • Handler function for 'terminal_stop' tool: ensures server is running, POSTs to API to stop session, formats response or error.
    async ({ sessionId }) => { try { // Check if server is running, start if not if (!(await isServerRunning())) { await startElectronProcess(); } const response = await axios.post(`${apiBaseUrl}/stop/${sessionId}`); const result = response.data; return { content: [{ type: "text", text: `Session ID: ${result.sessionId}\n\n ${result.message}`, exitCode: result.exitCode }] }; } catch (error) { return formatErrorResponse(error, sessionId); } }
  • Input schema for 'terminal_stop' tool using Zod: requires 'sessionId' as string.
    { sessionId: z.string() },

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/nexon33/console-terminal-mcp-server'

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