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
Copy file name to clipboardExpand all lines: docs/concepts/filters.md
+13-18Lines changed: 13 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,10 +7,6 @@ uid: filters
7
7
8
8
# MCP Server Handler Filters
9
9
10
-
This document describes the filter functionality in the MCP Server, which allows you to add middleware-style filters to handler pipelines.
11
-
12
-
## Overview
13
-
14
10
For each handler type in the MCP Server, there are corresponding `AddXXXFilter` methods in `McpServerBuilderExtensions.cs` that allow you to add filters to the handler pipeline. The filters are stored in `McpServerOptions.Filters` and applied during server configuration.
15
11
16
12
## Available Filter Methods
@@ -173,12 +169,12 @@ You can apply authorization at the class level, which affects all tools in the c
173
169
```csharp
174
170
[McpServerToolType]
175
171
[Authorize] // All tools require authentication
176
-
publicclassAdminTools
172
+
publicclassRestrictedTools
177
173
{
178
-
[McpServerTool, Description("Admin-only tool")]
179
-
publicstaticstringAdminOperation()
174
+
[McpServerTool, Description("Restricted tool accessible to authenticated users")]
175
+
publicstaticstringRestrictedOperation()
180
176
{
181
-
return"Admin operation completed";
177
+
return"Restricted operation completed";
182
178
}
183
179
184
180
[McpServerTool, Description("Public tool accessible to anonymous users")]
@@ -211,23 +207,22 @@ To use authorization features, you must configure authentication and authorizati
0 commit comments