Summary
Enable Kyber's MCP server to use MCP Sampling to delegate LLM reasoning to the connected client (Claude, ChatGPT, Cursor), rather than always calling Kyber's own configured LLM API.
What is MCP Sampling?
The MCP Sampling primitive allows a server to ask the client to perform an LLM completion on its behalf. The client sends the request to its own LLM and returns the result — so the server gets AI reasoning without making an independent LLM API call.
Why it matters for Kyber
| Scenario |
Today |
With Sampling |
| Summarize last night's motion events |
Kyber calls its own LLM |
Client LLM does it — no extra token cost to Kyber |
| Anomaly detection on sensor history |
Requires Kyber-side AI config |
Server pushes raw data, client reasons about it |
| Classify intent from ambiguous user input |
Always through kyber_ask pipeline |
Server asks client to pre-classify, then routes |
| Explain a complex automation |
Kyber LLM prompt |
Delegated to the already-connected Claude/GPT |
Proposed implementation
- Add /sampling/createMessage\ handler to Kyber's MCP server
- Expose a \kyber_analyze\ capability that accepts raw HA context + a question and returns the client LLM's reasoning
- Use sampling for lightweight summarization tasks to reduce Kyber's own LLM call volume
- Add sampling request/response to the MCP call log debug UI
Acceptance criteria
Notes
- Neither HA's MCP nor Kyber currently supports this — implementing it would be a differentiator
- MCP SDK (\mcp\ package) already has sampling types; implementation is on the server handler side
- Sampling is human-in-the-loop by default in most clients (Claude asks permission) — document this behaviour
Summary
Enable Kyber's MCP server to use MCP Sampling to delegate LLM reasoning to the connected client (Claude, ChatGPT, Cursor), rather than always calling Kyber's own configured LLM API.
What is MCP Sampling?
The MCP Sampling primitive allows a server to ask the client to perform an LLM completion on its behalf. The client sends the request to its own LLM and returns the result — so the server gets AI reasoning without making an independent LLM API call.
Why it matters for Kyber
Proposed implementation
Acceptance criteria
Notes