-
Notifications
You must be signed in to change notification settings - Fork 546
Closed as not planned
Labels
enhancementNew feature or requestNew feature or request
Description
The McpServerConfig type is a record, which tends to implement structural equality by default for scalar values. However, it has an array and a dictionary, which requires special handling to achieve structural equality.
csharp-sdk/src/ModelContextProtocol/Configuration/McpServerConfig.cs
Lines 30 to 38 in 25bcb44
| /// <summary> | |
| /// Arguments (if any) to pass to the executable. | |
| /// </summary> | |
| public string[]? Arguments { get; init; } | |
| /// <summary> | |
| /// Additional transport-specific configuration. | |
| /// </summary> | |
| public Dictionary<string, string>? TransportOptions { get; init; } |
For my use case, when we're looking at identifying duplicate server configurations across files or across reloads of a changed mcp.json file, it's useful to be able to recognize when two server config objects are identical.
I can implement this myself with a custom IEqualityComparer, but as the config may change over time to get new properties, having it build into the type itself would be great.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request