Skip to content

Claude Code plugin 1.3.2: ?utm_source=plugin in MCP URL breaks OAuth (invalid_target) #1247

Open

Description

@models118

Problem

The official Claude Code plugin (getsentry/plugin-claude) version 1.3.2 changed the MCP server URL in .claude-plugin/plugin.json from:

"url": "https://mcp.sentry.dev/mcp"

to:

"url": "https://mcp.sentry.dev/mcp?utm_source=plugin"

After the plugin auto-updates to 1.3.2, OAuth authentication fails for every Claude Code user with:

invalid_target: The resource parameter does not match this authorization server

Filing here because getsentry/plugin-claude has issues disabled.

Root Cause

Claude Code derives the RFC 8707 resource parameter from the configured MCP server URL — including the query string. So it sends:

resource=https://mcp.sentry.dev/mcp?utm_source=plugin

However, the Protected Resource Metadata at /.well-known/oauth-protected-resource/mcp declares:

{
  "resource": "https://mcp.sentry.dev/mcp",
  "authorization_servers": ["https://mcp.sentry.dev"]
}

The authorization server compares the values verbatim, finds a mismatch, and rejects the request with invalid_target.

This is the same failure class as #836 (path-specific PRM mismatch), just triggered by the query string instead of the path.

Steps to Reproduce

  1. Install the Sentry plugin for Claude Code from the official marketplace (v1.3.2).
  2. Run /mcp and attempt to authenticate with the Sentry server.
  3. Browser opens and immediately shows: "Authentication Error — invalid_target: The resource parameter does not match this authorization server".

Authentication with the clean URL (https://mcp.sentry.dev/mcp, as shipped in plugin 1.3.1) works fine — existing tokens obtained against the clean URL remain valid.

Expected Behavior

One of:

  • Revert the plugin manifest URL to https://mcp.sentry.dev/mcp and carry the attribution some other way (e.g. a request header), OR
  • Have the authorization server canonicalize/accept resource URIs that differ only in the query string.

Workaround

Edit the cached plugin manifest and strip the query string:

~/.claude/plugins/cache/claude-plugins-official/sentry/1.3.2/.claude-plugin/plugin.json → "url": "https://mcp.sentry.dev/mcp", then restart Claude Code. (Overwritten on the next plugin update.)

Environment

  • Claude Code on Windows 11
  • Plugin: sentry@claude-plugins-official 1.3.2 (upgraded from 1.3.1, which worked)
  • MCP URL (broken): https://mcp.sentry.dev/mcp?utm_source=plugin

Related

Activity

  1. linear-code commented on Aug 14, 2026

    @linear-code
  2. Ben-Home commented on Aug 31, 2026

    @Ben-Home

    Solid root-cause writeup, and thanks for catching that the plugin URL change is what flipped this. A few notes that may help the fix stick:

    The real problem is that query strings are being treated as part of the protected resource identity. Under RFC 8707 the resource parameter is just an identifier string, but the authorization server's comparison should be against the resource's canonical form: scheme + host + path. Tracking parameters (utm_source) are not part of the resource identity, so the AS rejecting on a query-string difference is doing a verbatim match where it should do a canonical match. Two layers of fix:

    1. Sentry side (most robust): when looking up the Protected Resource Metadata for a request, canonicalize the incoming resource (strip query, normalize trailing slash) before comparing to the declared resource in the PRM. This is the same class of bug as OAuth invalid_target error — PRM resource mismatch between path-specific endpoint and authorization server #836 (path-specific PRM mismatch), and a canonicalization step at PRM lookup time covers both. Verbatim comparison of a URL that legitimately carries query params will keep breaking on every URL change.

    2. Plugin side: ?utm_source=plugin has no business in a machine-to-machine endpoint URL. Even with the AS fixed, keeping analytics in the URL means every downstream consumer (Claude Code, other clients, your own logs) derives a different resource string. Strip it from plugin.json, or move the campaign tracking to a header.

    For users blocked today: pin the plugin to 1.3.1, or edit the installed plugin.json to remove the query string and restart Claude Code. We hit this exact class of verbatim-resource-mismatch building OAuth gateways at corpusiq.io; canonicalize the resource identifier at PRM lookup and the failure mode disappears for every client, not just this one.

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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions