Skip to content

MCP-COV: MCP Test Coverage #50

@josealekhine

Description

@josealekhine

Current coverage: mcp/server 78.8%, mcp/proto 0%, mcp/session 0%,
mcp/server/entity 0%. Goal: all packages above 80%.

mcp/session (0% → 80%+)

  • MCP-COV.1: Test session.NewState and state mutation methods #added:2026-03-15
    • NewState returns initialized state with zero counters
    • RecordToolCall increments ToolCalls
    • RecordAdd increments per-type counter in AddsPerformed
    • QueuePendingUpdate appends to PendingFlush
    • PendingCount returns correct length
    • Verify multiple calls accumulate correctly

mcp/proto (0% → 80%+)

  • MCP-COV.2: Test JSON marshaling/unmarshaling round-trips for proto types #added:2026-03-15
    • Request, Response, Notification, RPCError
    • InitializeParams / InitializeResult
    • CallToolParams / CallToolResult
    • GetPromptParams / GetPromptResult
    • ReadResourceParams / ReadResourceResult
    • SubscribeParams / UnsubscribeParams
    • Verify field names match JSON tags, omitempty behaves correctly
  • MCP-COV.3: Test ToolDefs completeness and schema validity #added:2026-03-15
    • Every tool in ToolDefs has non-empty Name, Description, InputSchema
    • InputSchema.Type is "object" for all tools
    • Required fields listed in schema are present in Properties
    • No duplicate tool names

mcp/server/entity (0% → 80%+)

  • MCP-COV.4: Test PromptDefs completeness #added:2026-03-15
    • Every prompt has non-empty Name and Description
    • Required arguments have non-empty Name and Description
    • No duplicate prompt names
    • Argument names match expected field constants

mcp/server gaps (78.8% → 85%+)

  • MCP-COV.5: Test promptAddLearning (0% coverage) #added:2026-03-15
    • Mirror the existing promptAddDecision test with learning-specific
      arguments (content, context, lesson, application)
  • MCP-COV.6: Test toolRemind (26.7% coverage) #added:2026-03-15
    • Test with no reminders → returns no-reminders message
    • Test with active reminders → returns formatted list
    • Test with future-dated reminder → shows "not due" annotation
  • MCP-COV.7: Test toolDrift (57.1% coverage) #added:2026-03-15
    • Test with clean context → status OK, no violations
    • Test with missing required files → violations reported
    • Test with context load failure → error response
  • MCP-COV.8: Test toolComplete error paths (66.7% coverage) #added:2026-03-15
    • Empty query → error
    • Boundary violation → error
    • Non-matching query → error from CompleteTask
  • MCP-COV.9: Test emitNotification and handleNotification (both 0%) #added:2026-03-15
    • emitNotification writes valid JSON-RPC notification to stdout
    • handleNotification for notifications/initialized returns nil
    • Unknown notification method returns nil (no-op)
  • MCP-COV.10: Test writeError (0% coverage) #added:2026-03-15
    • Triggers on malformed JSON input (non-JSON-RPC)
    • Writes a valid JSON-RPC error response to stdout
  • MCP-COV.11: Test error paths for subscribe/unsubscribe (71.4%) #added:2026-03-15
    • Invalid JSON params → ErrCodeInvalidArg
    • Empty URI → ErrCodeInvalidArg

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions