health
Monitor health status, version details, and configuration of the Claude Code MCP server for real-time insights and system maintenance.
Instructions
Returns health status, version information, and current configuration of the Claude Code MCP server.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||
Implementation Reference
- src/server.ts:409-454 (handler)Handler for the 'health' tool call. Verifies Claude CLI availability, gathers package version, environment config, system resources, and returns formatted JSON health status.// Handle health check tool if (toolName === 'health') { // Check if Claude CLI is accessible let claudeCliStatus = 'unknown'; try { const { stdout } = await spawnAsync('/bin/bash', [this.claudeCliPath, '--version'], { timeout: 5000 }); claudeCliStatus = 'available'; } catch (error) { claudeCliStatus = 'unavailable'; } // Collect and return system information const healthInfo = { status: 'ok', version: this.packageVersion, claudeCli: { path: this.claudeCliPath, status: claudeCliStatus }, config: { debugMode, heartbeatIntervalMs, executionTimeoutMs, useRooModes, maxRetries, retryDelayMs }, system: { platform: os.platform(), release: os.release(), arch: os.arch(), cpus: os.cpus().length, memory: { total: Math.round(os.totalmem() / (1024 * 1024)) + 'MB', free: Math.round(os.freemem() / (1024 * 1024)) + 'MB' }, uptime: Math.round(os.uptime() / 60) + ' minutes' }, timestamp: new Date().toISOString() }; // Health check request completed, remove from tracking this.activeRequests.delete(requestId); debugLog(`[Debug] Health check request ${requestId} completed`); return { content: [{ type: 'text', text: JSON.stringify(healthInfo, null, 2) }] };
- src/server.ts:290-298 (registration)Registration of the 'health' tool in the ListToolsRequestSchema response, defining its name, description, and empty input schema (no parameters required).{ name: 'health', description: 'Returns health status, version information, and current configuration of the Claude Code MCP server.', inputSchema: { type: 'object', properties: {}, required: [], }, },
- src/server.ts:293-297 (schema)Input schema for the 'health' tool: an empty object (no input parameters). Note: schema is defined inline within the tool registration.inputSchema: { type: 'object', properties: {}, required: [], },