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
|
|
@ -63,7 +63,7 @@ internal sealed class McpServerOptionsSetup(
|
|||
// a collection, add to it, otherwise create a new one. We want to maintain the identity
|
||||
// of an existing collection in case someone has provided their own derived type, wants
|
||||
// change notifications, etc.
|
||||
McpServerPrimitiveCollection<McpServerResource> resourceCollection = options.Capabilities?.Resources?.ResourceCollection ?? [];
|
||||
McpServerResourceCollection resourceCollection = options.Capabilities?.Resources?.ResourceCollection ?? [];
|
||||
foreach (var resource in serverResources)
|
||||
{
|
||||
resourceCollection.TryAdd(resource);
|
||||
|
|
|
|||
Loading…
Reference in a new issue