Skip to content

feat: Add URI template support for MCP resources #208

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 29, 2025
Merged

Conversation

tzolov
Copy link
Contributor

@tzolov tzolov commented Apr 26, 2025

Implement URI template functionality for MCP resources, allowing dynamic resource URIs with variables in the format {variableName}.

  • Enable resource URIs with variable placeholders (e.g., "/api/users/{userId}")

  • Automatic extraction of variable values from request URIs

  • Validation of template arguments in completions

  • Matching of request URIs against templates

  • Add new URI template management interfaces and implementations

  • Enhanced resource template listing to include templated resources

  • Updated resource request handling to support template matching

  • Test coverage for URI template functionality

Implement URI template functionality for MCP resources, allowing dynamic
resource URIs with variables in the format {variableName}.

- Enable resource URIs with variable placeholders (e.g., "/api/users/{userId}")
- Automatic extraction of variable values from request URIs
- Validation of template arguments in completions
- Matching of request URIs against templates

- Add new URI template management interfaces and implementations
- Enhanced resource template listing to include templated resources
- Updated resource request handling to support template matching
- Test coverage for URI template functionality

- Adding a configurable uriTemplateManagerFactory field to both AsyncSpecification and SyncSpecification classes
- Adding builder methods to allow setting a custom URI template manager factory
- Modifying constructors to pass the URI template manager factory to the server implementation
- Updating the server implementation to use the provided factory
- Add bulk registration methods for async completions

Signed-off-by: Christian Tzolov <[email protected]>
@tzolov tzolov force-pushed the uri-template-handling branch from 5617302 to 08560c6 Compare April 29, 2025 04:05
@tzolov tzolov added this to the 0.10.0 milestone Apr 29, 2025
@tzolov tzolov added the enhancement New feature or request label Apr 29, 2025
@tzolov tzolov merged commit e610d85 into main Apr 29, 2025
1 check passed
@tzolov tzolov deleted the uri-template-handling branch April 29, 2025 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant