Expose lightweight, privacy-respecting metrics and leverage MCP SDK 1.0's Message Filters for telemetry collection.
Tool: dotnet_server_metrics
Returns counts per tool, avg duration ms, cache hit rate.
Implementation
Metrics Accumulator (original scope)
- In-memory metrics collection
- JSON response with per-tool stats
- Reset metrics subcommand
- No PII stored
Message Filters Integration (new — requires MCP SDK 1.0)
MCP SDK 1.0 introduces Message Filters — middleware for intercepting and processing MCP requests/responses. This provides the ideal infrastructure for collecting tool execution telemetry without modifying individual tool implementations.
Planned filters:
- Telemetry filter: Automatically capture tool invocation counts, durations, success/failure rates — feeds the
dotnet_server_metrics tool
- Rate limiting filter: Protect against excessive tool invocations
- Validation filter: Pre-validate common parameters (paths, framework TFMs) before tool execution
- Logging filter: Structured logging of all MCP traffic for diagnostics
Implementation:
References:
Acceptance Criteria
- Metrics accumulator (in-memory)
- JSON response
- Reset metrics subcommand
- No PII stored
- At least one Message Filter wired in for telemetry collection
Dependencies
- Blocked on MCP SDK 1.0 upgrade (see parent tracking issue)
Expose lightweight, privacy-respecting metrics and leverage MCP SDK 1.0's Message Filters for telemetry collection.
Tool: dotnet_server_metrics
Returns counts per tool, avg duration ms, cache hit rate.
Implementation
Metrics Accumulator (original scope)
Message Filters Integration (new — requires MCP SDK 1.0)
MCP SDK 1.0 introduces Message Filters — middleware for intercepting and processing MCP requests/responses. This provides the ideal infrastructure for collecting tool execution telemetry without modifying individual tool implementations.
Planned filters:
dotnet_server_metricstoolImplementation:
TelemetryFilterimplementingIMessageFilterto capture metricsProgram.csReferences:
Acceptance Criteria
Dependencies