Fix URI template derivation and lookup (#530)
* Use lowercase host in resource URI template derivation. * Address feedback * Add casing testing for non-templated resource lookups. * Fix uri primitive lookup * Use a hardcoded mcp hostname in derived resource template URIs and ensure built-in resources work with the VS Code client. * Address feedback * Fix equality comparison * Use dedicated type for resource collections.
This commit is contained in:
parent
283a052e3f
commit
0b26b7bf22
1 changed files with 174 additions and 75 deletions
|
|
@ -10,13 +10,14 @@ public class McpServerPrimitiveCollection<T> : ICollection<T>, IReadOnlyCollecti
|
|||
where T : IMcpServerPrimitive
|
||||
{
|
||||
/// <summary>Concurrent dictionary of primitives, indexed by their names.</summary>
|
||||
private readonly ConcurrentDictionary<string, T> _primitives = [];
|
||||
private readonly ConcurrentDictionary<string, T> _primitives;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="McpServerPrimitiveCollection{T}"/> class.
|
||||
/// </summary>
|
||||
public McpServerPrimitiveCollection()
|
||||
public McpServerPrimitiveCollection(IEqualityComparer<string>? keyComparer = null)
|
||||
{
|
||||
_primitives = new(keyComparer);
|
||||
}
|
||||
|
||||
/// <summary>Occurs when the collection is changed.</summary>
|
||||
|
|
|
|||
Loading…
Reference in a new issue