How to handle MCP elicitations using MCPClient?
Hey team,
I am not able to handle elicitation requests using MCPClient even after sending it from the tool on server.
I am initialising the MCPClient as follows:
I adding onRequest handler after getting tools from the server as follow:
(1/2)
6 Replies
Tool that I have defined on the server side:
What am I missing here?
(2/2)
And yes the error I get when I try to do this is:
from the MCP Server
from agents backend
Dependencies I am using:
"@mastra/core": "^0.24.1",
"@mastra/mcp": "^0.14.4",
"@modelcontextprotocol/sdk": "^1.22.0"
I can see my MCP sever is trying to elicit the user input but same is not being accepted by the MCPClient
π Created GitHub issue: https://github.com/mastra-ai/mastra/issues/10668
π If you're experiencing an error, please provide a minimal reproducible example whenever possible to help us resolve it quickly.
π Thank you for helping us improve Mastra!
Hey @Om ill take a look!
Hmm i tried reproducing, and while i dont get Request timed out i do get an elicitation failed error
Let me post my repro and the fixed version
@Abhi Aiyer thankyou so much for your efforts. Appreciated, but the issue was from my side. The way I was orchestrating MCP server was wrong so I fixed that and it worked perfectly.
Sorry for the trouble tho π¬
Thankyou!
Thatβs great to hear! No problem!