You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
thrownewInvalidOperationException("Authorization filter was not invoked for tools/list operation, but authorization metadata was found on the tools. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
68
-
}
69
+
varresult=awaitnext(context,cancellationToken);
70
+
71
+
if(HasAuthorizationMetadata(result.Tools.Select(tool =>toolCollectionis not null&&toolCollection.TryGetPrimitive(tool.Name,outvarserverTool)?serverTool:null))
thrownewInvalidOperationException("Authorization filter was not invoked for tools/list operation, but authorization metadata was found on the tools. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
thrownewInvalidOperationException("Authorization filter was not invoked for resources/list operation, but authorization metadata was found on the resources. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
128
-
}
137
+
varresult=awaitnext(context,cancellationToken);
138
+
139
+
if(HasAuthorizationMetadata(result.Resources.Select(resource =>resourceCollectionis not null&&resourceCollection.TryGetPrimitive(resource.Uri,outvarserverResource)?serverResource:null))
thrownewInvalidOperationException("Authorization filter was not invoked for resources/list operation, but authorization metadata was found on the resources. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
result.ResourceTemplates, resourceTemplate =>resourceCollectionis not null&&resourceCollection.TryGetPrimitive(resourceTemplate.UriTemplate,outvarserverResource)?serverResource:null,
thrownewInvalidOperationException("Authorization filter was not invoked for resources/templates/list operation, but authorization metadata was found on the resource templates. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
158
-
}
175
+
varresult=awaitnext(context,cancellationToken);
176
+
177
+
if(HasAuthorizationMetadata(result.ResourceTemplates.Select(resourceTemplate =>resourceCollectionis not null&&resourceCollection.TryGetPrimitive(resourceTemplate.UriTemplate,outvarserverResource)?serverResource:null))
thrownewInvalidOperationException("Authorization filter was not invoked for resources/templates/list operation, but authorization metadata was found on the resource templates. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
thrownewInvalidOperationException("Authorization filter was not invoked for prompts/list operation, but authorization metadata was found on the prompts. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
218
-
}
243
+
varresult=awaitnext(context,cancellationToken);
244
+
245
+
if(HasAuthorizationMetadata(result.Prompts.Select(prompt =>promptCollectionis not null&&promptCollection.TryGetPrimitive(prompt.Name,outvarserverPrompt)?serverPrompt:null))
thrownewInvalidOperationException("Authorization filter was not invoked for prompts/list operation, but authorization metadata was found on the prompts. Ensure that AddAuthorizationFilters() is called on the IMcpServerBuilder to configure authorization filters.");
0 commit comments