Skip to main content
Servers can ask the client for user input mid-tool-call via elicitation/create. Two modes:
  • Form — structured fields with a JSON schema
  • URL — redirect the user to an external page (required for credentials/OAuth)

Setup

The second constructor argument is available only in the Node.js entry. In a browser build, set onElicitation at the top level of the configuration or on an individual server configuration instead.

Helpers

These helpers are exported only by the Node.js entry of @mcp-use/client. The browser entry and @mcp-use/client/react do not export them.

React

The helpers above are not available in a browser build, so handle the request directly. This handler waits for the user to finish a URL request and accepts form requests with their schema defaults:
With the provider, use pendingElicitationRequests and approveElicitation / rejectElicitation. Without an onElicitation handler, tool calls that require input will fail.

Reference

Server-side: Elicitation