Commit 53a6720
committed
fix: keep all resources registered for resources/read requests
The ForMCPRequest optimization was incorrectly filtering resources by
doing an exact string match between the URI template pattern and the
concrete URI. This would never match because templates like
'repo://{owner}/{repo}/contents{/path*}' don't match concrete URIs
like 'repo://owner/repo/contents/file.py'.
Instead of implementing template matching in the inventory, we simply
keep all resources registered for resources/read requests and let the
SDK handle URI template matching internally (which it already does
correctly via uritemplate.Regexp().MatchString()).
This fixes resources/read returning 'Resource not found' for valid URIs.1 parent 676956f commit 53a6720
2 files changed
+7
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| |||
134 | 134 | | |
135 | 135 | | |
136 | 136 | | |
| 137 | + | |
137 | 138 | | |
138 | | - | |
139 | | - | |
140 | | - | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
775 | 775 | | |
776 | 776 | | |
777 | 777 | | |
778 | | - | |
| 778 | + | |
| 779 | + | |
779 | 780 | | |
| 781 | + | |
780 | 782 | | |
781 | | - | |
782 | | - | |
783 | | - | |
784 | | - | |
785 | | - | |
| 783 | + | |
| 784 | + | |
786 | 785 | | |
787 | 786 | | |
788 | | - | |
789 | 787 | | |
790 | 788 | | |
791 | 789 | | |
| |||
0 commit comments