As identified in #147, the MCP server (src/mcp-server.ts) currently lacks automated unit tests to verify tool definitions and request handlers.
Goal
Implement unit tests for the MCP server to ensure:
- Tool registration is correct.
- Resource listing/retrieval handlers correctly interface with the K8s library.
- Error handling (e.g., K8s API failures) returns appropriate MCP error responses.
Scope
- Use Vitest and the MCP SDK's testing utilities or mock
StdioServerTransport to trigger and validate tool calls.
- Mock src/lib/k8s.ts functions to decouple from actual Kubernetes API logic.
Acceptance Criteria
As identified in #147, the MCP server (src/mcp-server.ts) currently lacks automated unit tests to verify tool definitions and request handlers.
Goal
Implement unit tests for the MCP server to ensure:
Scope
StdioServerTransportto trigger and validate tool calls.Acceptance Criteria
src/__tests__/mcp-server.test.ts.list_toolshandler.list_pods,get_pod_logs).