Saltar al contenido principal

MCP Server — E2E Test Plan

Key paths to validate on staging before each production deploy.

V1 — API Key Authentication

#PathExpectedSLA
1POST /mcp with valid V1 API key + { method: "initialize" }HTTP 200, mcp-session-id header in response< 2s
2POST /mcp with invalid/missing keyHTTP 401< 1s
3POST /mcp (session exists) + { method: "tools/list" }JSON with expected tools array< 2s
4get_products call on merchant sessionReturns business-scoped product data< 3s
5get_products called with wrong businessId (not in principal)Tool handler returns error content< 2s
6void_transaction called without pos:write scopeToolRegistry dispatch throws McpInsufficientScopesError< 1s
7DELETE /mcp with valid Authorization + session IDSession closed, subsequent requests return 400< 1s

V2 — OAuth Token Exchange

#PathExpectedSLA
8POST /mcp/token with valid Firebase ID tokenHTTP 200, accessToken JWT returned with authorizedBusinessIds< 3s
9POST /mcp/token with expired/invalid Firebase tokenHTTP 401< 2s
10POST /mcp/token for user with no business membershipsHTTP 403< 2s
11Session opened with V2 token → tools/list includes set_active_business (multi-business user)Tool present in list< 2s
12set_active_business with valid businessIdactiveBusinessId updated in session; next domain tool call returns data for the new business< 2s
13set_active_business with unauthorized businessIdError content in response; session activeBusinessId unchanged< 1s
14V2 session: principal written to Redis on initializeGET mcp:session:{sid} in Redis returns valid JSON principal with correct TTL< 1s
15set_active_tenant (platform_operator key) with valid businessIdSubsequent get_products call is scoped to the new tenant< 2s

PSA Tools

#PathExpectedSLA
16log_hours without userId fieldTool returns isError: true with "userId is required" message< 1s
17log_hours with all required fields (stepId, userId, hours)Time entry created; response contains entry object< 3s

Intent Tools (pos:intents scope)

#PathExpectedSLA
18Merchant session with pos:intentstools/listAll 4 intent tools present< 2s
19tenant_developer session → tools/listIntent tools NOT present< 2s
20summarize_day callReturns totalRevenue, orderCount, topProducts, lowStockAlertCount< 5s
21summarize_day for date with no transactionsReturns zeros without error< 3s
22get_client_health with valid implementation IDReturns phase, completionPct, hoursBurned, hoursEstimated, openBlockers< 5s