| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
There was a problem hiding this comment.
I've refactored this file.
Sorry, something went wrong.
There was a problem hiding this comment.
Thanks!
Sorry, something went wrong.
Replaces the regex-based resource template matcher with a linear-time RFC 6570 implementation, adds configurable path-safety validation, and ships a standalone UriTemplate utility usable from the low-level server. Rebased onto main@4caa41f6 (squashed from 47 commits at 8b5ca89). Absorbs mcp-types split (#2973), ResourceNotFoundError (#2920), ResourceError chaining (#2542), resources= ctor param (#2414), is_async_callable (#2389), and sync-handler offloading (#2380). ResourceSecurityError now re-raises as ResourceNotFoundError in ResourceManager.get_resource so security rejections map to -32602 (SEP-2164) and halt template iteration.
Replaces the regex-based resource template matcher with a linear-time RFC 6570 implementation, adds configurable path-safety validation, and ships a standalone UriTemplate utility usable from the low-level server. Rebased onto main@4caa41f6 (squashed from 47 commits at 8b5ca89). Absorbs mcp-types split (#2973), ResourceNotFoundError (#2920), ResourceError chaining (#2542), resources= ctor param (#2414), is_async_callable (#2389), and sync-handler offloading (#2380). ResourceSecurityError now re-raises as ResourceNotFoundError in ResourceManager.get_resource so security rejections map to -32602 (SEP-2164) and halt template iteration.
Replaces the regex-based resource template matcher with a linear-time RFC 6570 implementation, adds configurable path-safety validation, and ships a standalone UriTemplate utility usable from the low-level server. Rebased onto main@4caa41f6 (squashed from 47 commits at 8b5ca89). Absorbs mcp-types split (#2973), ResourceNotFoundError (#2920), ResourceError chaining (#2542), resources= ctor param (#2414), is_async_callable (#2389), and sync-handler offloading (#2380). ResourceSecurityError now re-raises as ResourceNotFoundError in ResourceManager.get_resource so security rejections map to -32602 (SEP-2164) and halt template iteration.
Replaces the regex-based resource template matcher with a linear-time RFC 6570 implementation, adds configurable path-safety validation, and ships a standalone UriTemplate utility usable from the low-level server. Rebased onto main@4caa41f6 (squashed from 47 commits at 8b5ca89). Absorbs mcp-types split (#2973), ResourceNotFoundError (#2920), ResourceError chaining (#2542), resources= ctor param (#2414), is_async_callable (#2389), and sync-handler offloading (#2380). ResourceSecurityError now re-raises as ResourceNotFoundError in ResourceManager.get_resource so security rejections map to -32602 (SEP-2164) and halt template iteration.
| Back | FazBrowse Home | New Git URL |
Summary
Add constructor-time resource seeding to ResourceManager and wire MCPServer through it so servers can preload concrete resources at initialization, matching the existing tool manager pattern.
Motivation and Context
This makes resource registration consistent with tool registration and removes the manual loop from MCPServer.__init__. It also makes it easier to create pre-populated servers without adding extra setup code after construction.
How Has This Been Tested?
Breaking Changes
None. ResourceManager(resources=...) and MCPServer(resources=...) are additive.
Types of changes
Checklist
Additional context
Resource seeding now happens inside ResourceManager.__init__, so MCPServer no longer needs a manual registration loop. Duplicate resources continue to flow through add_resource(...), preserving first-write-wins behavior and existing duplicate warnings.