Repository navigation
Description
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
- Install the Sentry plugin for Claude Code from the official marketplace (v1.3.2).
- Run
/mcpand attempt to authenticate with the Sentry server. - 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/mcpand 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-official1.3.2 (upgraded from 1.3.1, which worked) - MCP URL (broken):
https://mcp.sentry.dev/mcp?utm_source=plugin
Related
- OAuth invalid_target error — PRM resource mismatch between path-specific endpoint and authorization server #836 (OAuth invalid_target — PRM resource mismatch, path variant)
- [BUG] MCP OAuth appends trailing slash to
resourceparameter, breaking Entra ID auth (AADSTS9010010) anthropics/claude-code#52871 (Claude Code appends trailing slash toresource— same strict-match failure class)
Activity
linear-code commentedon Aug 14, 2026
MCP-1021
Ben-Home commentedon Aug 31, 2026
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
resourceparameter 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: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
resourcein 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.Plugin side:
?utm_source=pluginhas 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.
fix(oauth): Match resource indicators that differ only by query or tr…