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.
Can you explain it without the notes?
Testing, Inspector, Logging, and Evaluation
Use your own words. Explain an example and one limitation before checking the explanation.
Check your explanation
Test pyramid
Turn this concept into a clear answer.
Practice this conceptYOUR NEXT STEP
Keep connecting the ideas.
Next lesson: Advanced Capabilities and Multiple-Server ArchitectureAdapted from 20_MCP_SERVER.md · “14. Testing, Inspector, Logging, and Evaluation”. Examples are study fragments; framework behavior can depend on your version.