Repository navigation
feat(elicitation): MCP 2025-06-18 elicitation support - #139
Conversation
Implement server-initiated `elicitation/create` requests and client-side
handling per the 2025-06-18 spec. Mirrors the existing sampling architecture:
clients advertise the `elicitation` capability and register a 2-arity callback
returning `{:accept, content} | :decline | :cancel | {:error, reason}`; servers
call `Anubis.Server.send_elicitation_request/3` and receive responses via the
new `handle_elicitation/3` callback.
Adds `Anubis.MCP.ElicitationSchema` for validating both the restricted JSON
Schema subset (flat object, primitive types, formats: email/uri/date/date-time,
enum + enumNames) and content payloads against a validated schema. Validation
runs synchronously in `send_elicitation_request/3` and again on the client
before returning accept content, and on the server before invoking
`handle_elicitation/3` — bad payloads never reach user code.
Closes #30
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis change implements end-to-end Model Context Protocol (MCP) elicitation support across the Anubis framework. It introduces client-side elicitation callback registration and request handling via a new 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
Closes #30. The 2025-06-18 MCP spec adds elicitation — server-initiated
requests for structured user input via the client. Anubis already declared
:elicitationas a feature ofProtocol.V2025_06_18but had no wire-levelimplementation.
Solution
Mirror the existing sampling/roots architecture end-to-end:
elicitation/createmethod + Peri params schema inAnubis.MCP.Message; gate it to v2025-06-18 in the version module.Anubis.MCP.ElicitationSchema): defschema-based check of therestricted JSON Schema subset (flat object, primitive types, formats
email/uri/date/date-time, enum+enumNames).
validate_content/2convertsthe runtime schema to a Peri schema and validates payloads.
:elicitationcapability;register_elicitation_callback/2registers a 2-arity callback returning
{:accept, map} | :decline | :cancel | {:error, reason}. NewAnubis.Client.ElicitationmirrorsSampling.Anubis.Server.send_elicitation_request/3(validates schemasynchronously before any wire I/O) + new
handle_elicitation/3callback.Session tracks the request alongside sampling/roots and validates response
content before dispatching to user code.
Tests: 25 schema, 9 client, 5 session — all 693 + 33 doctests pass; credo
strict clean.
Rationale
Elicitation is structurally a third server→client request type alongside
sampling and roots, so reusing the same patterns (capability gating, callback
registration in client State,
server_requeststracking on the session,async dispatch via
handle_*callback) keeps the surface area small andconsistent with project conventions. Validation lives in a dedicated module
so both sides can guard the same way: server before sending, client before
returning accept content, server again before calling user code — the spec
asks both parties to validate, and bad data never reaches user callbacks.