Skip to content
This repository was archived by the owner on Mar 21, 2025. It is now read-only.

Conversation

stephentoub
Copy link
Collaborator

@stephentoub stephentoub commented Mar 16, 2025

Handlers are now specified before connecting the client/server. Otherwise, race conditions exist. Handlers move into being a part of the McpClientOptions/McpServerOptions, so that they're provided to the factories. Where relevant, the handlers are specified as part of the capability descriptors, so that they go hand in hand.

The factories are no longer stateful. Instead of allocating a factory and then calling a create method on it, you just call a static factory method.

Closes #76

@stephentoub stephentoub force-pushed the mcpclientserverfactory branch 2 times, most recently from b7b61d8 to 755178b Compare March 16, 2025 03:11
Handlers are now specified before connecting the client/server. Otherwise, race conditions exist. Handlers move into being a part of the McpClientOptions/McpServerOptions, so that they're provided to the factories. Where relevant, the handlers are specified as part of the capability descriptors, so that they go hand in hand.

The factories are no longer stateful. Instead of allocating a factory and then calling a create method on it, you just call a static factory method.
Copy link
Owner

@PederHP PederHP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Big improvement. Don't have any comments, which always irks me for a PR of this size, but it looks ready to merge to me.

@stephentoub
Copy link
Collaborator Author

Thanks

@stephentoub stephentoub merged commit 08b0a04 into PederHP:main Mar 16, 2025
1 check passed
@stephentoub stephentoub deleted the mcpclientserverfactory branch March 16, 2025 16:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Is McpClientFactory's caching useful?

2 participants