This guide defines how to identify and classify breaking changes in the C# MCP SDK. It is derived from the dotnet/runtime breaking change guidelines.
Changes that alter the public API surface in ways that break existing code at compile time:
- Renaming or removing a public type, member, or parameter
- Changing the return type of a method or property
- Changing parameter types, order, or count on a public method
- Sealing a type that was previously unsealed (when it has accessible constructors)
- Making a virtual member abstract
- Adding
abstractto a member when the type has accessible constructors and is not sealed - Removing an interface from a type's implementation
- Changing the value of a public constant or enum member
- Changing the underlying type of an enum
- Adding
readonlyto a field - Removing
paramsfrom a parameter - Adding/removing
in,out, orrefparameter modifiers - Renaming a parameter (breaks named arguments and late-binding)
- Adding the
[Obsolete]attribute or changing its diagnostic ID - Adding the
[Experimental]attribute or changing its diagnostic ID - Removing accessibility (making a public/protected member less visible)
Changes that don't break compilation but alter observable behavior:
- Throwing a new/different exception type in an existing scenario (unless it's a more derived type)
- No longer throwing an exception that was previously thrown
- Changing return values for existing inputs
- Decreasing the range of accepted values for a parameter
- Changing default values for properties, fields, or parameters
- Changing the order of events being fired
- Removing the raising of an event
- Changing timing/order of operations
- Changing parsing behavior and throwing new errors
- Changing serialization format or adding new fields to serialized types
Obvious breaking changes to the public API shape. Always flag these.
Behavioral changes that customers would have reasonably depended on. Flag and discuss with user.
Behavioral changes that customers could have depended on but probably wouldn't (e.g., corner case corrections). Flag with lower confidence.
Changes to internal surface or behavior (e.g., internal APIs, private reflection). Generally not flagged unless they could affect ecosystem tools.
When a breaking change includes an AppContext switch or other opt-in/opt-out mechanism, always note it in the migration guidance. Search for AppContext.TryGetSwitch, DOTNET_ environment variables, and similar compat patterns in the diff. Include the switch name and the value that alters the behavior:
* Compat switch: `ModelContextProtocol.AspNetCore.AllowNewSessionForNonInitializeRequests` = `true` restores previous behavior
For every PR in the range, examine:
- PR description — Authors often describe breaking changes here
- Linked issues — May contain discussion about breaking impact
- Review comments — Reviewers may have flagged breaking concerns
- Code diff — Look at changes to:
- Public type/member signatures
- Exception throwing patterns
- Default values and constants
- Return value changes
- Parameter validation changes
- Attribute changes (
[Obsolete],[Experimental], etc.) AppContext.TryGetSwitchor environment variable compat switches
- Labels — Check if
breaking-changeis already applied