test: MCP trust framework coverage (43 tests)

elsium-ai/elsium-ai·May 18, 2026·✅ Merged

MCP trust framework had only ~33% test coverage — too low for security-critical code handling trust validation and authentication.

The MCP (Model Context Protocol) trust framework is security-critical code that handles server allowlisting, tool authorization, manifest verification, and audit logging. Despite its importance, it had only ~33% test coverage with just 9 tests, leaving most code paths untested.

This PR expanded coverage from 9 to 43 tests across 6 test files, covering server allowlist (name, transport, URL pattern, stdio command hash, multi-entry, empty allowlist), connect/disconnect delegation and audit logging, listTools filtering (deniedTools, allowedTools, all-denied, empty list), callTool authorization (allowed, denied, oversized output, audit events), generateManifest structure and caching, verifyManifest match/mismatch paths, and all passthrough methods (toElsiumTools, listResources, readResource, listPrompts, getPrompt). The fix closes issue #62 and ensures the trust framework has robust regression coverage.

GitHub
LinkedIn
LeetCode