An MCP server that uses Redis and in-memory caching to optimize and extend context windows for large chat histories
This server exposes 5 tools via HTTP REST endpoints, but lacks proper MCP tool registration with schemas. Tool definitions are inferred from code comments and endpoint signatures rather than explicitly registered with JSON Schema. Descriptions exist but are generic and lack LLM-optimization guidance. Parameter schemas are partially present in code but not formally declared in MCP tool definitions. No input validation guidance, error recovery hints, or output schema documentation. The 'messages' tool conflates multiple concerns (completion + context optimization + conversation management). Security issues: no permission gates on admin endpoints (metrics/reset), no audit logging of destructive operations.
Health check endpoint. Returns server status, version, Redis connection status, and uptime.
Process completion with context optimization. Accepts model, messages, max_tokens, temperature, top_p, top_k, stop_sequences, conversation_id, stream, and context_optimization parameters. Returns completion response with MCP metadata including context_optimized flag, original and optimized message counts, and conversation_id.
Get current server metrics including request counts, processing times, token counts, and performance statistics.
Reset all server metrics to zero. Admin-only endpoint.
Get token count for text using specified model. Accepts text and model query parameters. Returns token count.
Tool definitions not formally registered with MCP. Tools inferred from Express routes and code comments rather than explicit MCP tool registration with JSON Schema. This violates the tool registration pattern and prevents proper schema validation.
'messages' tool combines completion, context optimization, and conversation management into one tool. Should split into separate tools: 'create_completion', 'optimize_context', 'get_conversation'. Violates single-responsibility principle.
No permission gates on destructive operations. 'metrics/reset' endpoint has a comment 'In a production environment, add authentication here' but no actual implementation. Admin endpoints are unprotected.
Inferred effective spec: <=2025-11-25.
| Scored | Grade | Overall | Spec posture | Rubric |
|---|---|---|---|---|
| 2026-09-23 | F | 34 | <=2025-11-25 | v2 |
Output schemas not documented. Tools return JSON but LLMs cannot infer response structure. E.g., 'messages' returns '_mcp_metadata' object but this is not formally declared in tool output schema.
Error handling lacks recovery guidance. ErrorHandler returns generic error objects without actionable next steps. E.g., 'Missing required parameter: text' does not suggest calling token-count with text parameter.