Parent
E2E test infrastructure initiative.
Problem
The MCP server (apps/mcp-server/) is the core product but has zero E2E tests. Unit tests cover 84 files at 80% coverage, but no test verifies the actual MCP protocol handshake, tool invocation, or transport layer (stdio/SSE) end-to-end.
A broken stdio transport or malformed JSON-RPC response would only be caught in production.
Scope
New directory: apps/mcp-server/tests/e2e/
stdio transport tests (~8 tests)
- MCP handshake:
initialize → initialized response with capabilities
- Tool listing:
tools/list returns all registered tools
- Tool invocation:
search_rules with query → valid result
- Tool invocation:
get_agent_details with agent name → valid result
- Tool invocation:
activate with prompt → rules + specialists
- Resource listing:
resources/list returns rules:// resources
- Resource read:
resources/read with valid URI → content
- Error handling: invalid JSON-RPC request → proper error response
SSE transport tests (~5 tests)
- SSE endpoint accepts connection and sends events
- Tool call via HTTP POST → SSE event with result
- Bearer token auth: valid token → 200, missing token → 401
- Multiple concurrent SSE connections
- Graceful disconnection
Error edge cases (~3 tests)
- Non-existent tool name → JSON-RPC error
- Malformed tool arguments → meaningful error
- Large payload handling (oversized query)
Technical approach
- Framework: Vitest (matches existing setup)
- stdio:
child_process.spawn the compiled server, write JSON-RPC to stdin, read stdout
- SSE: Start NestJS
TestingModule with HTTP listener, connect via fetch + EventSource
- Config: Separate
vitest.config.e2e.ts with extended timeout (30s)
- CI: Add
e2e-mcp job to .github/workflows/dev.yml (runs after build)
Test commands
yarn workspace codingbuddy test:e2e # Run MCP E2E tests
yarn workspace codingbuddy test:e2e:stdio # stdio transport only
yarn workspace codingbuddy test:e2e:sse # SSE transport only
Acceptance criteria
Out of scope
- Performance/load testing
- Prompt content validation (covered by unit tests)
- Plugin ↔ MCP integration (Phase 3)
Parent
E2E test infrastructure initiative.
Problem
The MCP server (
apps/mcp-server/) is the core product but has zero E2E tests. Unit tests cover 84 files at 80% coverage, but no test verifies the actual MCP protocol handshake, tool invocation, or transport layer (stdio/SSE) end-to-end.A broken stdio transport or malformed JSON-RPC response would only be caught in production.
Scope
New directory:
apps/mcp-server/tests/e2e/stdio transport tests (~8 tests)
initialize→initializedresponse with capabilitiestools/listreturns all registered toolssearch_ruleswith query → valid resultget_agent_detailswith agent name → valid resultactivatewith prompt → rules + specialistsresources/listreturnsrules://resourcesresources/readwith valid URI → contentSSE transport tests (~5 tests)
Error edge cases (~3 tests)
Technical approach
child_process.spawnthe compiled server, write JSON-RPC to stdin, read stdoutTestingModulewith HTTP listener, connect viafetch+EventSourcevitest.config.e2e.tswith extended timeout (30s)e2e-mcpjob to.github/workflows/dev.yml(runs afterbuild)Test commands
Acceptance criteria
apps/mcp-server/tests/e2e/directory with ≥15 testsvitest.config.e2e.tswith 30s timeouttest:e2escript inpackage.jsonOut of scope