stop_gui
Stop the web GUI server for managing Claude Code conversation sessions.
Instructions
Stop the web GUI server
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/mcp/index.ts:275-304 (handler)The handler function for the 'stop_gui' 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, 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), }, ], } })
- src/mcp/index.ts:275-304 (registration)Registers the 'stop_gui' MCP tool with empty schema and the inline handler function.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), }, ], } })
- src/server.ts:65-67 (helper)Supporting function called by the stop_gui handler to terminate the web server child process gracefully.export async function stopWebServer(server: WebServer): Promise<void> { server.process.kill('SIGTERM') }