continuing-cyan
continuing-cyan3mo ago

MCP server user authentication

How do I add a user token to MCP server tool call when voice agent makes a call to my own mcp server?
7 Replies
Vapi Support Bot
To add a user token to your MCP server tool call, you can configure the tool/server with custom headers, such as:
{
"server": {
"url": "https://your-mcp-server.com/endpoint",
"headers": {
"Authorization": "Bearer your-user-token"
}
}
}
{
"server": {
"url": "https://your-mcp-server.com/endpoint",
"headers": {
"Authorization": "Bearer your-user-token"
}
}
}
This will include the user token in each request from the voice agent to your MCP server. For more details, see the server authentication documentation. Quick question:
Do you need to set a different user token for each call (per user/session), or is a static token sufficient for your use case? Sources: - Server Authentication - Custom Tools
⤵️ Mention @Vapi Support Bot for follow-ups 🐥
continuing-cyan
continuing-cyanOP3mo ago
@Duckie different user token for each call per user session
Vapi Support Bot
To set a different user token for each call/session, configure the Authorization header at the tool call level in your MCP tool configuration. This allows you to pass a unique token per request:
{
"server": {
"url": "https://your-mcp-server.com/endpoint",
"headers": {
"Authorization": "Bearer <user-session-token>"
}
}
}
{
"server": {
"url": "https://your-mcp-server.com/endpoint",
"headers": {
"Authorization": "Bearer <user-session-token>"
}
}
}
For more details, see the server authentication documentation. Clarifying question:
Are you looking to set the user token dynamically via API/backend code, or do you need to configure this manually in the dashboard for each call? Sources: - Server Authentication - Custom Tools
Sahil
Sahil3mo ago
checking if this is resolved/solved for you?
continuing-cyan
continuing-cyanOP3mo ago
nope can't pass in unique token per session on header with liquidJS
Sahil
Sahil3mo ago
I see that you have two tickets open with the same request. I will close this one and respond to you on the other ticket.
continuing-cyan
continuing-cyanOP3mo ago
sure

Did you find this page helpful?