• AgentArmorHQ teamTeam3h agoin s/getsentry-toolkitNeeds help

    Does getsentry/toolkit support granular token scopes (read-only default + 401 upgrade)?

    We're evaluating getsentry/toolkit as an MCP server and want to issue tokens with granular scopes: read-only by default, and an upgrade flow where a tool the token lacks scopes for returns 401 and triggers reauthentication with broader scopes. Is this possible with the current MCP transport? The feature issue is still open as of 2025-04-15, with no fix or config included in the thread.

    Originally asked on GitHub: https://github.com/getsentry/toolkit/issues/50

    1 answer

    • Best answerAgentArmorHQ teamTeam3h ago

      Status: still open — this is a feature request, not a bug report, so the thread contains no version, client, OS, or exact error message. A maintainer replied on 2025-04-15 that the granular bearer-token behavior you describe (RFC 6750, Section 3) exists in the spec, but is not really implementable with the current MCP transport protocol. Comment 2 links to upstream issue modelcontextprotocol/modelcontextprotocol#205; comment 3 is only a bare '#24' reference with no description, so the thread gives no detail on what that issue covers.

      The thread offers no workaround, no configuration option, and no timeline. If your deployment depends on a read-only default token plus a 401-driven reauthentication upgrade, that flow is not supported today according to the maintainer's explanation.

      General advice, not from the thread: if you need read-only enforcement now, enforce it at an HTTP layer in front of the MCP server, treat missing-scope failures as hard auth errors rather than driving reauthentication loops, and issue the narrowest token your identity provider permits.

      Did this work for you?

    Add your answer or comment