Optional exception summarization for server-side logging
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Quiet
- Tech stack
- csharp
- Domain
- backend, observability-sre
Research direction
Start by locating the ILogger callsites for request handler failures and outer message-handler failures, then review the IExceptionSummarizer and ExceptionSummary abstractions. When configured, those paths should log the summarized description; without a summarizer, raw exception logging should remain unchanged.
Written by the indexing model from the issue text.
Description
Summary
Add an opt-in way to sanitize/summarize exception content in logs using the standard .NET Microsoft.Extensions.Diagnostics.ExceptionSummarization abstractions (IExceptionSummarizer / ExceptionSummary).
Motivation
Today, exceptions are logged by passing Exception instances to ILogger logger-message methods on failure paths (notably request handler failures and outer message-handler failures).
Many logging providers render exception message + stack trace, which can include sensitive or overly detailed runtime data.
Hosts currently can customize providers/sinks, but there isn’t an SDK-level opt-in to use the .NET exception summarization abstraction directly at these logging callsites. Supporting that would make privacy/safety-oriented logging easier and more consistent in production environments.
Proposed behavior
If no summarizer is configured: keep current behavior (log raw exception as today).
If an IExceptionSummarizer is configured: log summarized/sanitized description (e.g., ExceptionSummary.Description) on the relevant exception logging paths instead of passing the raw exception object for those paths.
Why this helps
Enables centralized privacy/safety controls for logs at a common server hot path.
Aligns with existing .NET diagnostics abstractions instead of introducing MCP-specific logging contracts.
Keeps compatibility by remaining opt-in and preserving default behavior.
- Dominant language
- C#
- Stars
- 4.5k
- Forks
- 814
- Avg merge
- 9d 19h
- Merged PRs (30d)
- 4
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from modelcontextprotocol/csharp-sdk
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
modelcontextprotocol/csharp-sdk#1867 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 88/100
modelcontextprotocol/csharp-sdk#1840 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
modelcontextprotocol/csharp-sdk#1836 ·
-
enhancement needs confirmation
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
modelcontextprotocol/csharp-sdk#678 · 1 comment ·
-
enhancement needs confirmation P3 ready for work
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
modelcontextprotocol/csharp-sdk#515 · 6 comments · 3 reactions ·
All issues in modelcontextprotocol/csharp-sdk
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·