This ticket documents the significant enhancement of the HealthService in the Knowledge Base MCP server, bringing it to a level of sophistication comparable to the Memory Core's HealthService. This includes adding caching, detailed status levels, API key checks, and recovery detection. The OpenAPI schema for the healthcheck tool has also been updated to reflect these changes.
Motivation:
The previous HealthService in the Knowledge Base server was basic, lacking features crucial for robust monitoring, diagnostics, and user guidance. By aligning its capabilities with the Memory Core's HealthService, we provide:
- Improved User Experience: Clearer health status, detailed error messages, and recovery detection.
- Enhanced Performance: Intelligent caching reduces redundant calls to ChromaDB.
- Better Diagnostics: Comprehensive health payload for easier debugging and understanding of server status.
- Consistency: Standardized health reporting across different MCP servers.
Changes Implemented:
ai/mcp/server/knowledge-base/services/HealthService.mjs Refactoring:
- Copied and adapted the robust
HealthService implementation from memory-core.
- Added caching mechanisms (
#cachedHealth, #lastCheckTime, #cacheDuration, #previousStatus).
- Implemented detailed helper methods:
#checkChromaConnection(), #checkCollections() (adapted for a single knowledge base collection), #checkApiKeyConfigured().
- Introduced a comprehensive
#performHealthCheck() method to orchestrate checks and build a detailed status payload.
- Refactored the public
healthcheck() method to include caching and recovery detection logic.
- Added an
ensureHealthy() method for fail-fast behavior in tool invocations.
- Adapted all logic and messages to reflect the "Knowledge Base" context and single collection.
- Removed
startupSummarizationStatus and recordStartupSummarization as they are not applicable.
ai/mcp/server/knowledge-base/openapi.yaml Update:
- The
HealthCheckResponse schema has been updated to reflect the new, detailed output structure of the healthcheck tool. This includes properties for timestamp, database.connection.collections.knowledgeBase, features.embedding, and details.
This enhancement significantly improves the reliability and diagnostic capabilities of the Knowledge Base MCP server.
This ticket documents the significant enhancement of the
HealthServicein the Knowledge Base MCP server, bringing it to a level of sophistication comparable to the Memory Core'sHealthService. This includes adding caching, detailed status levels, API key checks, and recovery detection. The OpenAPI schema for thehealthchecktool has also been updated to reflect these changes.Motivation: The previous
HealthServicein the Knowledge Base server was basic, lacking features crucial for robust monitoring, diagnostics, and user guidance. By aligning its capabilities with the Memory Core'sHealthService, we provide:Changes Implemented:
ai/mcp/server/knowledge-base/services/HealthService.mjsRefactoring:HealthServiceimplementation frommemory-core.#cachedHealth,#lastCheckTime,#cacheDuration,#previousStatus).#checkChromaConnection(),#checkCollections()(adapted for a single knowledge base collection),#checkApiKeyConfigured().#performHealthCheck()method to orchestrate checks and build a detailed status payload.healthcheck()method to include caching and recovery detection logic.ensureHealthy()method for fail-fast behavior in tool invocations.startupSummarizationStatusandrecordStartupSummarizationas they are not applicable.ai/mcp/server/knowledge-base/openapi.yamlUpdate:HealthCheckResponseschema has been updated to reflect the new, detailed output structure of thehealthchecktool. This includes properties fortimestamp,database.connection.collections.knowledgeBase,features.embedding, anddetails.This enhancement significantly improves the reliability and diagnostic capabilities of the Knowledge Base MCP server.