Hi there,
I'm currently developing a Vapi assistant that is embedded on a doctor’s profile page from my app, allowing users to initiate a call via the Vapi SDK.
In my setup, the assistant uses an MCP server through the Tools configuration. I need a way to identify the specific doctor when the AI assistant calls the MCP tools. While I know I can assign HTTP headers in the MCP configuration, those headers are static — but I need them to be dynamic based on the doctor whose page the user is calling from.
Is there a way to dynamically set or pass a custom configuration (such as a header or other metadata) at the moment the call is initiated, so that when the assistant calls the MCP tools, it includes the doctor-specific information? This would allow my MCP server to return data tailored to the correct doctor.
I’m trying this approach:
const vapiInstance = new Vapi(import.meta.env.VITE_APP_VAPI_API_KEY);
const assistantOverrides = {
metadata: {
doctorId: "abc123",
},
};
vapiInstance.start(AppConfig.vapi.assistantId, assistantOverrides);
And I would expect when the MCP is called to have access to this metadata.
If there’s a better approach you recommend for this situation, I’m open to suggestions as well.