feat: add foundation for resources and prompts registration #45
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Change Description
This PR establishes a consistent foundation for registering tools, resources (both static and dynamic), and prompts within the MCP server. This refactoring sets up the necessary hooks and structure for future implementation of resources and prompts alongside the existing tools.
Type of Change
Key Changes
Registration Structure
internal/tools/tointernal/capabilities/for better organizationcapabilities/resources.gowithRegisterResources(),RegisterStaticResources(), andRegisterDynamicResources()hookscapabilities/prompts.gowithRegisterPrompts()hookcapabilities/tools.gofor consistencyType Definitions
PromptDefinitionfor future prompt implementationsStaticResourceDefinitionandDynamicResourceDefinitionfor future resource implementationsDynamicResourceValidationPolicyto support validation for dynamic resourcesCollection Interface Updates
CollectionandLegacySdkCollectioninterfaces to includeRegisterDynamicResources()andListDynamicResources()methodsInfrastructure
Initial Implementations
capabilities/prompts/andcapabilities/staticresources/directoriesRelated Issues
N/A - Foundation work for future features
Testing
Test Evidence
Commands Run
make testTest Results Summary
All tests pass successfully:
TestAllDynamicResourcesRegisteredto validate resource registrationKey test packages:
cmd: All command tests pass (logout, run, session)internal/capabilities: Registration and validation tests passinternal/capabilities/applications: All application tool tests passinternal/capabilities/environments: All environment tool tests passinternal/capabilities/populations: All population tool tests passinternal/capabilities/validation: All middleware validation tests passinternal/capabilities/filter: All filtering logic tests passinternal/capabilities/types: Type definition tests passinternal/errs: Error handling tests passinternal/sdk/legacy: SDK factory tests passinternal/server: Server initialization and filtering tests passinternal/tokenstore: Token storage tests passNew test added:
TestAllDynamicResourcesRegisteredvalidates that all dynamic resources from individual collections are properly registered with the serverFull Test Output
Breaking Changes
None - This is an additive change that maintains backward compatibility
Additional Context
This refactoring prepares the codebase for:
The structure follows the existing patterns established for tools registration and maintains consistency across the codebase.