Skip to main content
Glama

Electron Terminal MCP Server

terminal_get_output

Retrieve command output from a terminal session in an Electron application. Use the session ID to fetch results programmatically for automation or integration.

Input Schema

NameRequiredDescriptionDefault
sessionIdYes

Input Schema (JSON Schema)

{ "$schema": "http://json-schema.org/draft-07/schema#", "additionalProperties": false, "properties": { "sessionId": { "type": "string" } }, "required": [ "sessionId" ], "type": "object" }

Implementation Reference

  • Handler function for the 'terminal_get_output' MCP tool. It retrieves terminal output for a given session ID by calling the Electron backend API at /output/{sessionId}, strips ANSI codes, and returns the formatted output.
    server.tool( "terminal_get_output", { sessionId: z.string() }, async ({ sessionId }) => { try { // Check if server is running, start if not if (!(await isServerRunning())) { await startElectronProcess(); } const response = await axios.get(`${apiBaseUrl}/output/${sessionId}`); const result = response.data; // Clean up terminal output using strip-ansi const cleanOutput = stripAnsi(result.output); return { content: [{ type: "text", text: `Session ID: ${result.sessionId}\n\n ${cleanOutput}`, exitCode: result.exitCode }] }; } catch (error) { return formatErrorResponse(error, sessionId); } } );
  • Input schema for the 'terminal_get_output' tool, requiring a sessionId string.
    { sessionId: z.string() },
  • index.js:331-332 (registration)
    Registration of the 'terminal_get_output' tool using server.tool.
    server.tool( "terminal_get_output",

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