Skip to content

Too strict resource name validation 0.17.0 #855

Closed as not planned
Closed as not planned

Description

@MartinKPal

Inspector Version

  • 0.17.0

Describe the bug
I'm getting error "Protected resource api://mycompany.com/subdivision/myservice does not match expected https://api.test.subdivison.mycompany.com/myservice/mcp (or origin)" My API is exposed via different endpoints (like Application Gateway, Azure API Management Service, from internal network Container App Environment Application Url...), which all have different domains. Official RFC https://datatracker.ietf.org/doc/html/rfc8707#name-resource-parameter is using a word MAY in sentence "The resource parameter URI value is an identifier representing the identity of the resource, which MAY be a locator that corresponds to a network-addressable location".
RFC also states "The parameter value identifies a resource to which the client is requesting access. The parameter can carry the location of a protected resource, typically as an https URL or a more abstract identifier."

To Reproduce
Steps to reproduce the behavior:

  1. npx @modelcontextprotocol/inspector
  2. open http://localhost:6274/?MCP_PROXY_AUTH_TOKEN=....
  3. Change Transport Type to Streamable HTTP
  4. Enter URL to https://api.test.subdivision.mycompany.com/myservice/mcp
  5. Click Open Auth Settings
  6. Click Guided OAuth Flow
  7. Click Continue
  8. Observe response from https://api.test.subdivision.mycompany.com/.well-known/oauth-protected-resource/myservice/mcp is returning
    {
    "resource": "api://mycompany.com/subdivision/myservice",
    "authorization_servers": [
    "https://identity-test.mycompany.com"
    ],
    "bearer_methods_supported": [
    "header"
    ],
    "scopes_supported": [
    "myservice"
    ]
    }
  9. ISSUE error is shown "Protected resource api://mycompany.com/subdivision/myservice does not match expected https://api.test.subdivision.mycompany.com/myservice/mcp (or origin)"

Expected behavior
Allow resource name to be any absolute URI.

Activity

  1. kamranayub commented on Dec 19, 2025

    @kamranayub

    I don't think this is correct.

    The corresponding spec is RFC 9728 for PRM, as resource is defined as:

    Resource Identifier:
    The protected resource's resource identifier, which is a URL that uses the https scheme and
    has no fragment component.

    I think resource_name is what you're referring to:

    resource_name
    Human-readable name of the protected resource intended for display to the end user. It is
    RECOMMENDED that protected resource metadata include this field. The value of this field
    MAY be internationalized, as described in Section 2.1.

    The api:// convention is what I've seen in scopes only (which is what I use with Entra ID).

  2. tomasr commented on Feb 19, 2026

    @tomasr

    The api:// convention is what I've seen in scopes only (which is what I use with Entra ID).

    This is not correct, for sure.

    Default Application ID's (i.e. resource values) in Entra ID use the api:// convention, and they work just fine if you're using the original OAuth authorization endpoint through the resource parameter.

    Since it's the Application ID, it will be part of the scope name if using the v2.0 authorization endpoint which takes only the scope parameter and does not accept the resource parameter (and I don't think the MCP inspector will currently be able to use these).

    Regardless, why validate the resource identifier at all? The MCP server is telling you the resource identifier that should be used, so why validate that it exactly matches the MCP Server URL?

  3. cliffhall commented on Aug 1, 2026

    @cliffhall
    Member

    Closing: v1 is deprecated.

    Thank you for reporting this, and apologies for the long wait for a response.

    v1 will receive security fixes only — this issue describes a functionality, compatibility, or usability problem rather than a vulnerability, so it is being closed against v1. This is not a judgment on whether the problem is real — it's a consequence of the v1 line being frozen. This is happening as part of #1872.

    If this still happens in v2, we'd genuinely like to know. v2 is a complete rewrite — three clients over a shared core — so many v1 behaviours no longer exist in the same form. Please open a fresh issue against v2 with steps to reproduce, and we'll look at it. Note that we accept external contributions as issues rather than pull requests; maintainers handle design and implementation through a prompt-driven workflow. See CONTRIBUTING.md.

    Thanks for taking the time to report it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authIssues and PRs related to authorizationclosed-v1-deprecatedClosed: v1 is deprecated and accepting security fixes onlyv1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions