https://retellai.com/?utm_source=discord&utm_medium=seo logo
I configured a MCP Server to use with a multi-prom...
# ❓・ai-evy-support
i
@AI Evy I configured a MCP Server to use with a multi-prompt voice agent. In the attendant flow the user give some infos and the AI call a MCP Tool to do the client login and receive a token in the response. When trying to use this same token in later tools calls, the token is totally different from that one retrieved in the login tool call, even if I map the login tool call response. What can I do to the flow use the correct token? Is this a bug on MCP on Retell?
a
Thanks for tagging me @isaacpires. I'll look through relevant sources and get back to you shortly.
### Answer Based on the information available, this appears to be related to a known MCP session management issue with Retell AI [(1) ]() . For token persistence, you need to properly extract and map the token from your MCP tool response as a dynamic variable [(2) ]() . When setting up your MCP tool, you can extract values from the response and save them as dynamic variables for use later in the conversation . For example, you can extract a token from the response and reference it later using
{{token_name}}
. However, there's a documented issue where MCP tool calls become unstable after the first successful call [(1) ]() . The first tool call in a live conversation succeeds, but all subsequent tool calls within the same conversation fail with a "Server not initialized" error because the Retell agent fails to persist and resend the
mcp-session-id
header on subsequent requests . This appears to be a bug in Retell's MCP client implementation where the agent drops the
mcp-session-id
header after the first successful tool call . The engineering team has been notified of this issue . For now, the only workaround is to force a re-handshake (initialize → initialized) before retrying the tool call when you hit the "Server not initialized" error . To properly set up response variable mapping for your token: 1. In your MCP tool configuration, set up response variables to extract the token value [(2) ]() [(3) ]() 2. Reference the token in subsequent tool calls using the dynamic variable syntax
{{your_token_variable}}
If you're still experiencing token inconsist
encies after proper variable mapping, this is likely related to the session management bug mentioned above.
​ To learn more, see the sources I considered: [[1] MCP Server tool calls not stable](https://discord.com/channels/1186424376300679209/1409520321450479656) [[2] MCP](https://docs.retellai.com/build/single-multi-prompt/mcp) [[3] MCP Node](https://docs.retellai.com/build/conversation-flow/mcp-node) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.