php-sdk/docs
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Johannes Wachter e4a8a224ff
[Client] Add client-side elicitation support (#371)
* [Client] Add client-side elicitation support

The SDK could send elicitation/create requests from a server tool via
ClientGateway::elicit(), but the client could not receive them: there was
no request handler, and ElicitRequest was not registered in MessageFactory,
so incoming elicitation/create messages failed to parse.

This adds the client half, mirroring the existing Sampling pattern:

- Register ElicitRequest in MessageFactory so elicitation/create parses.
- ElicitationRequestHandler wraps a user callback and returns an
  ElicitResult (accept/decline/cancel) or an Error.
- ElicitationCallbackInterface defines the callback contract.
- ElicitationException forwards a specific message to the server; any
  other throwable returns a generic error.

Includes unit tests, a runnable client example against the elicitation
demo server, and client docs/README updates.

* [Client] Simplify elicitation example labelFor() per review

Type the parameter as AbstractSchemaDefinition and read ->title directly
instead of matching on each concrete definition type. title is a required
non-null string on the base class, so the match and the $name fallback were
redundant.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-14 23:55:06 +02:00
..
authorization.md docs(adr): scope OAuth to resource server, not authorization server (#382) 2026-07-06 00:37:19 +02:00
client.md [Client] Add client-side elicitation support (#371) 2026-07-14 23:55:06 +02:00
events.md feat(server): add server lifecycle events (#175) 2026-02-23 22:40:43 +01:00
examples.md [Schema][Server] Add MCP Apps extension (io.modelcontextprotocol/ui) support (#281) 2026-06-01 09:35:54 +01:00
extensions.md [Schema][Server] Add MCP Apps extension (io.modelcontextprotocol/ui) support (#281) 2026-06-01 09:35:54 +01:00
index.md Document v0.6.0 changes in CHANGELOG and docs (#311) 2026-06-02 17:47:04 +02:00
mcp-elements.md Document v0.6.0 changes in CHANGELOG and docs (#311) 2026-06-02 17:47:04 +02:00
server-builder.md Document v0.6.0 changes in CHANGELOG and docs (#311) 2026-06-02 17:47:04 +02:00
server-client-communication.md [Schema][Server] Add top-level title to Tool (#288) 2026-04-26 15:37:40 +02:00
transports.md [Server] Harden JSON-RPC input parsing against malformed input and resource exhaustion (#383) 2026-07-06 00:10:13 +02:00