Skip to main content
Glama

stop_gui

Stop the web interface for managing Claude Code conversation sessions to conserve system resources.

Instructions

Stop the web GUI server

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • Inline handler for the 'stop_gui' MCP tool. Checks if the web server instance exists, attempts a graceful shutdown via the /api/shutdown endpoint, calls stopWebServer to kill the process if necessary, clears the instance, and returns a success message.
    server.tool('stop_gui', 'Stop the web GUI server', {}, async () => { if (webServerInstance) { const port = webServerInstance.port // Call shutdown API first for graceful shutdown try { await fetch(`http://localhost:${port}/api/shutdown`, { method: 'POST' }) } catch { // Server might already be stopping } // Then kill the process if still running await stopWebServer(webServerInstance) webServerInstance = null return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Web GUI stopped successfully' }, null, 2), }, ], } } return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Web GUI was not running' }, null, 2), }, ], } })
  • Helper function stopWebServer that terminates the web server child process spawned by startWebServer, used by the stop_gui handler.
    export async function stopWebServer(server: WebServer): Promise<void> { server.process.kill('SIGTERM') }
  • Global variable storing the current web server instance, shared between start_gui and stop_gui tools.
    let webServerInstance: Awaited<ReturnType<typeof startWebServer>> | null = null
  • Registration of the 'stop_gui' tool on the MCP server with description, empty schema, and inline handler.
    server.tool('stop_gui', 'Stop the web GUI server', {}, async () => { if (webServerInstance) { const port = webServerInstance.port // Call shutdown API first for graceful shutdown try { await fetch(`http://localhost:${port}/api/shutdown`, { method: 'POST' }) } catch { // Server might already be stopping } // Then kill the process if still running await stopWebServer(webServerInstance) webServerInstance = null return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Web GUI stopped successfully' }, null, 2), }, ], } } return { content: [ { type: 'text', text: JSON.stringify({ success: true, message: 'Web GUI was not running' }, null, 2), }, ], } })

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/DrumRobot/claude-sessions-mcp'

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