Testing, Inspector, Logging, and Evaluation
Practice this questionWANT TO UNDERSTAND THE CONCEPT FIRST?Learn Testing, Inspector, Logging, and Evaluation
Test pyramid
- Unit: Service policy, validation, and mapping.
- Protocol integration: List/call behavior through an in-memory client-server connection.
- Transport integration: The real stdio or HTTP boundary.
- End-to-end: A compatible host with approval and a model loop.
- Security: Cross-tenant access, injection payloads, path traversal, and oversized input.
Inspector workflow
npx @modelcontextprotocol/inspector node dist/index.jsUse the Inspector to examine capabilities, tools, schemas, inputs, results, and logs. Also test actual target clients to verify production client compatibility.
Observability fields
- Request/correlation ID, tool name, authenticated subject, duration, and result status.
- Dependency timing and retry count.
- Approval outcome for sensitive actions.
- Never log tokens, secrets, complete personal records, or raw confidential prompts by default.
Agent evaluation
Do not measure only server uptime. Also evaluate correct tool selection, argument accuracy, rejection of unauthorized calls, loop rate, recovery success, latency, and user approval rate.
Adapted from 20_MCP_SERVER.md · “14. Testing, Inspector, Logging, and Evaluation”. Code examples are study fragments. Difficulty and core labels are editorial estimates; version-specific behavior should be checked against your project.