Skip to content

Commit c4ad110

Browse files
committed
README tweaks
1 parent 8c0e97a commit c4ad110

File tree

1 file changed

+2
-38
lines changed
  • samples/AspNetCoreMcpPerSessionTools

1 file changed

+2
-38
lines changed

samples/AspNetCoreMcpPerSessionTools/README.md

Lines changed: 2 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,7 @@ This sample demonstrates how to create an MCP (Model Context Protocol) server th
44

55
## Overview
66

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`)
14-
- **Calculator**: Mathematical calculation tools (`/calculator`)
15-
- **UserInfo**: Session and system information tools (`/userinfo`)
16-
- **Dynamic Tool Loading**: Tools are filtered per session based on the route used to connect
17-
- **Easy Testing**: Simple URL-based testing without complex authentication setup
18-
- **Comprehensive Logging**: Logs session configuration and tool access for monitoring
19-
20-
## Tool Categories
21-
22-
### Clock Tools (`/clock`)
23-
- **GetTime**: Gets the current server time
24-
- **GetDate**: Gets the current date in various formats
25-
- **ConvertTimeZone**: Converts time between timezones (simulated)
26-
27-
### Calculator Tools (`/calculator`)
28-
- **Calculate**: Performs basic arithmetic operations (+, -, *, /)
29-
- **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.
378

389
## Route-Based Configuration
3910

@@ -70,19 +41,12 @@ Connect your MCP client to: `https://localhost:5001/calculator`
7041

7142
### Testing UserInfo Tools
7243
Connect your MCP client to: `https://localhost:5001/userinfo`
73-
- Available tools: GetSessionInfo, GetSystemInfo, EchoWithContext, GetConnectionInfo
44+
- Available tools: GetUserInfo
7445

7546
### Testing All Tools
7647
Connect your MCP client to: `https://localhost:5001/all` or `https://localhost:5001/`
7748
- Available tools: All tools from all categories
7849

79-
### Browser Testing
80-
You can also test the route detection in a browser:
81-
- `https://localhost:5001/` - Shows available endpoints
82-
- `https://localhost:5001/test-category/clock` - Tests clock category detection
83-
- `https://localhost:5001/test-category/calculator` - Tests calculator category detection
84-
- `https://localhost:5001/test-category/userinfo` - Tests userinfo category detection
85-
8650
## How It Works
8751

8852
### 1. Tool Registration

0 commit comments

Comments
 (0)