Skip to content
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

Add client handling for sampling, list roots, ping #218

Merged
merged 17 commits into from
Feb 20, 2025

Conversation

jerome3o-anthropic
Copy link
Contributor

@jerome3o-anthropic jerome3o-anthropic commented Feb 19, 2025

Adds sampling and list roots callbacks to the ClientSession, allowing the client to handle requests from the server.

This extends the work done by @SecretiveShell in #132, and they should get attribution (I mostly just copy pasted their patterns)

Motivation and Context

  • Allows sampling functionality
  • Allows roots functionality

How Has This Been Tested?

There are some tests

Breaking Changes

N/A

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update

Checklist

  • I have read the MCP Documentation
  • My code follows the repository's style guidelines
  • New and existing tests pass locally
  • I have added appropriate error handling
  • I have added or updated documentation as needed

Additional context

@SecretiveShell
Copy link
Contributor

Should I close #132 if you are moving the functionality here?

@jerome3o-anthropic
Copy link
Contributor Author

jerome3o-anthropic commented Feb 19, 2025

Should I close #132 if you are moving the functionality here?

Happy to merge this into your PR, or to merge this and close yours - up to you @SecretiveShell

@jerome3o-anthropic jerome3o-anthropic marked this pull request as ready for review February 19, 2025 22:38
Copy link
Member

@dsp-ant dsp-ant left a comment

Choose a reason for hiding this comment

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

This is great, thanks for doing that.

@dsp-ant dsp-ant merged commit ff22f48 into main Feb 20, 2025
5 checks passed
@dsp-ant dsp-ant deleted the jerome/feature/add-client-sampling branch February 20, 2025 10:49
dsp-ant added a commit that referenced this pull request Feb 20, 2025
Adds sampling and list roots callbacks to the ClientSession, allowing the client to handle requests from the server.

Co-authored-by: TerminalMan <84923604+SecretiveShell@users.noreply.github.com>
Co-authored-by: David Soria Parra <davidsp@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants