Repository navigation
Commit 4552822
Make the interceptor's delivery capability explicit
An outgoing-request interceptor replaces the session's server-to-client
channel, so it can deliver sampling, roots, and elicitation requests even
when the underlying transport cannot. That is what lets background task
execution park a request in an IMcpTaskStore and have the client answer it
on a later, unrelated request, which does not depend on session affinity.
OutgoingRequestInterceptingMcpServer relied on inheriting the base
SupportsServerToClientRequests default to get this, while forwarding every
other member to the wrapped server. Make the override explicit so the
behavior is stated rather than implied, and add stateless coverage for
AsSamplingChatClient() and the generic ElicitAsync<T>(), which are the two
APIs that check the capability guard eagerly instead of routing through the
interceptor short-circuit.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>1 parent 606765f commit 4552822
2 files changed
Lines changed: 59 additions & 0 deletions
File tree
- src/ModelContextProtocol.Core/Server
- tests/ModelContextProtocol.AspNetCore.Tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
20 | 25 | | |
21 | 26 | | |
22 | 27 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| 13 | + | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
| |||
173 | 175 | | |
174 | 176 | | |
175 | 177 | | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
176 | 196 | | |
177 | 197 | | |
178 | 198 | | |
| |||
654 | 674 | | |
655 | 675 | | |
656 | 676 | | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
657 | 702 | | |
658 | 703 | | |
659 | 704 | | |
| |||
667 | 712 | | |
668 | 713 | | |
669 | 714 | | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
0 commit comments