Skip to content

Entra Authentication for MCP doesn't work #12308

@adameska

Description

@adameska

Description

The request to my entra app to login and authorize is including resource when it shouldn't And i can't control what is in the resource and it's not matching verbatim what my app registration has as an Application ID URI (my MCP has resource: "http://localhost:3000" and my entra has http://localhost:3000 as the ID but opencode is passing resource of "http://localhost:3000/" which is causing getting a token to fail. My MCP is returning an authorization server of
"https://login.microsoftonline.com/tenat-guid/v2.0" which doesn't support dynamic client registration (so i set a client id and scopes, it didn't look like i could set resource even if i wanted to?)

We shouldn't need to set resource at all... the scope "http://localhost:3000/basic" should be all that's needed for entra auth to work.

Plugins

none

OpenCode version

1.1.51

Steps to reproduce

  1. Add a MCP resource that uses entra auth
  2. Try and authenticate with automatic oauth token generation instead of setting it yourself

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions