docs: explain client-side sampling callbacks by He-wei-gui · Pull Request #2789 · modelcontextprotocol/python-sdk · GitHub
Skip to content

docs: explain client-side sampling callbacks - #2789

Closed
He-wei-gui wants to merge 1 commit into
modelcontextprotocol:mainfrom
He-wei-gui:docs/sampling-client-callbacks
Closed

He-wei-gui wants to merge 1 commit into
modelcontextprotocol:mainfrom
He-wei-gui:docs/sampling-client-callbacks

Conversation

@He-wei-gui

Copy link
Copy Markdown

Summary

  • add a Sampling docs page for the server-to-client sampling flow
  • explain that clients opt in with sampling_callback and own the model/provider call
  • document how model_preferences, include_context, and ClientRequestContext reach the callback
  • add the page to the MkDocs navigation

This intentionally keeps the change provider-neutral and docs-only. It complements the existing server-side sampling snippet and avoids adding a full example project or model-provider dependency.

Addresses #1205.

Testing

  • PYTHONIOENCODING=utf-8 uv run mkdocs build --strict

@pranjalbhatia710

Copy link
Copy Markdown

@maxisbey

Copy link
Copy Markdown
Contributor

@maxisbey maxisbey closed this Jul 29, 2026
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