Skip to main content
Glama
grahama1970

Claude Code MCP Enhanced

by grahama1970

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
NameRequiredDescriptionDefault

No arguments

Implementation Reference

  • 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: [],
      },
    },
  • 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: [],
    },
Install Server

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/grahama1970/claude-code-mcp-enhanced'

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