Forum Discussion
wwilcz
Apr 27, 2026Copper Contributor
New AI Foundry not sending refresh tokens to MCP (401 after access token expiration)
Hello, When connecting an MCP server hosted as an Azure Function using OAuth Passthrough in New AI Foundry Playground, the connection is established successfully, the Microsoft login popup appea...
Jamony
Jun 27, 2026MCT
If the MCP connection works until the access token expires, it sounds like the OAuth passthrough is not giving your server a refresh path, or the server is expecting refresh tokens when the client flow only sends short-lived access tokens. I would make the MCP server handle 401 by forcing a new authorization flow, then confirm the scopes, redirect URI, and token cache behavior match the Foundry MCP auth flow.