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: samples/AspNetCoreMcpPerSessionTools/README.md
+2-38Lines changed: 2 additions & 38 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,36 +4,7 @@ This sample demonstrates how to create an MCP (Model Context Protocol) server th
4
4
5
5
## Overview
6
6
7
-
The sample demonstrates route-based tool filtering using the MCP SDK's `ConfigureSessionOptions` callback. Instead of using authentication headers, this approach uses URL routes to determine which tools are available to each MCP session, making it easy to test different tool configurations.
8
-
9
-
## Features
10
-
11
-
-**Route-Based Tool Filtering**: Different routes expose different tool sets
12
-
-**Three Tool Categories**:
13
-
-**Clock**: Time and date related tools (`/clock`)
-**CalculatePercentage**: Calculates percentage of a number
30
-
-**SquareRoot**: Calculates square root of a number
31
-
32
-
### UserInfo Tools (`/userinfo`)
33
-
-**GetSessionInfo**: Gets information about the current MCP session
34
-
-**GetSystemInfo**: Gets system information about the server
35
-
-**EchoWithContext**: Echoes messages with session context
36
-
-**GetConnectionInfo**: Gets basic connection information
7
+
The sample demonstrates route-based tool filtering using the SDK's `ConfigureSessionOptions` callback. You could use any mechanism, routing is just one way to achieve this. The point of the sample is to show how an MCP server can dynamically adjust the available tools for each session based on arbitrary criteria, in this case, the URL route.
37
8
38
9
## Route-Based Configuration
39
10
@@ -70,19 +41,12 @@ Connect your MCP client to: `https://localhost:5001/calculator`
70
41
71
42
### Testing UserInfo Tools
72
43
Connect your MCP client to: `https://localhost:5001/userinfo`
73
-
- Available tools: GetSessionInfo, GetSystemInfo, EchoWithContext, GetConnectionInfo
44
+
- Available tools: GetUserInfo
74
45
75
46
### Testing All Tools
76
47
Connect your MCP client to: `https://localhost:5001/all` or `https://localhost:5001/`
77
48
- Available tools: All tools from all categories
78
49
79
-
### Browser Testing
80
-
You can also test the route detection in a browser:
81
-
-`https://localhost:5001/` - Shows available endpoints
0 commit comments