chore: Make SyncSpec and AsyncSpec extensible#674
chore: Make SyncSpec and AsyncSpec extensible#674He-Pin wants to merge 1 commit intomodelcontextprotocol:mainfrom
Conversation
Signed-off-by: He-Pin <hepin1989@gmail.com>
|
We tend to prefer composition over inheritance. Please document what you are trying to achieve before proposing a change. We are not planning to add Lombok to this codebase. |
|
Thanks. In our current implementation, we need to return our own McpAsyncClient implementation (which we've partially customized to support our scenario), but we also want users to maintain their previous usage habits. Since we currently cannot extend McpClient's AsyncSpec (which has a private constructor), we have to copy the AsyncSpec code and make some modifications. Although the license allows us to do this, it's extremely inconvenient for maintainability. Therefore, we hope to have this extension so that users with similar needs can better maintain their custom platform capabilities. |
|
This would be a bad direction for the project. There are better ways to allow custom clients than exposing the internals via inheritance. |
Motivation and Context
We need to extend
McpSpecto add more functions.NOTE: I think we should try to make use of lombok's
@superBuilderhere, which can make our life easier, instead of a copy.How Has This Been Tested?
Breaking Changes
Types of changes
Checklist
Additional context