MCP Oauth Flow
# support
p
I am trying to use an MCP Tool with both Oauth and Bearer token Credentials. When I configure Oauth I can see the token endpoint is called on the server to obtain an access token. However, neither the bearer token or access token are presented to the MCP server when the Tool is invoked from an Assistant. I can see the VAPI MCP client / POST: 2025/11/26 14:24:22 Request Body: {"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{"tools":{},"prompts":{},"resources":{}},"clientInfo":{"name":"vapi-mcp-client","version":"1.0.0"}},"jsonrpc":"2.0","id":0} This results in a 401 with the "Www-Authenticate:[Bearer realm="mcp" resource_metadata=https://mudflap-pete.ngrok.io/.well-known/oauth-protected-resource]" response header which should tell the client to proceed with token The assistant is https://dashboard.vapi.ai/assistants/426f0625-c597-47af-9fe6-e139b5df43b4
v
To ensure your MCP server receives the bearer or OAuth access token, explicitly set the
Authorization
header in your MCP tool configuration like this:
Copy code
json
"server": {
  "url": "https://your-mcp-server-url",
  "headers": {
    "Authorization": "Bearer YOUR_ACCESS_TOKEN"
  }
}
Replace
YOUR_ACCESS_TOKEN
with the token you obtain from your OAuth flow. This should ensure the token is sent with each tool invocation. For more details, see the [MCP Tool documentation](https://docs.vapi.ai/tools/mcp). Source: - [MCP Tool documentation](https://docs.vapi.ai/tools/mcp)
p
@Vapi why don't Oauth credentials work with MCP Tools?
c
Hey Pete, Can you please provide a call id that faced this particular issue?
And provide a latest call id.
l
@Pete_SF were you able to figure this out? Am facing the same issue at the moment
m
@Pete_SF facing same issue. It works with Authorization header but not with a credential server.