alonf/mcppythondemo/python-mcp-sampling-bridge
Claude Code and agent skill by alonf/mcppythondemo
Trust tier 3
- community
Source check pending
Checking that the SKILL.md file is still in the repository.
Install
npx vskill@latest install alonf/mcppythondemo/python-mcp-sampling-bridgeSKILL.md
Python MCP Sampling Bridge
Use When
- A Python MCP server needs
sampling/createMessageparity with another implementation - The client should own the LLM runtime while the server orchestrates sampling
Pattern
- On the server, call
ctx.session.create_message(...). - On the client, pass an async
sampling_callbackintoClientSession(...); this automatically advertises sampling capability. - Keep the callback thin: translate MCP messages to your model input, call the model, return
CreateMessageResult. - Treat sampled output as untrusted input. Validate it on the server, retry with validation errors when needed, and only then execute deterministic work.
- For Linux diagnostics teaching flows, a constrained
PATHorPATH | grep FIELDformat is easier to validate than free-form shell commands.
Repo Example
src/mcp_linux_diag_server/tools/linux_diagnostics.pysrc/mcp_linux_diag_server/client.pytests/test_linux_diagnostics.py
Security
- Security scanPassed, 90 of 100Pattern checks on the skill's files.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryChecking.squad/skills/python-mcp-sampling-bridge/SKILL.md
Popularity
- 7-day trend score
- 5
Not refreshed yet.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/alonf/mcppythondemo/python-mcp-sampling-bridge)