modelcontextprotocol / modelcontextprotocol/kotlin-sdk
Implement SEP-835: Default Scopes Definition in Authorization
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 1.5k
- Forks
- 248
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 23
Description
This is a tracking issue for implementation of SEP-835.
Summary
This SEP proposes enhancements to the MCP OAuth 2.1-based authorization specification to improve scope management and client experience. The changes include: structured scope selection strategies following the principle of least privilege (prioritizing WWW-Authenticate scope parameter with fallback to scopes_supported), comprehensive scope error handling with upgrade flows, differentiated behavior for client credentials vs. interactive clients, and improved consistency in error responses by including resource_metadata in 403 insufficient_scope responses. This addresses gaps in scope selection guidance, runtime scope upgrades, and error handling that currently lead to over-privileged token requests and implementation inconsistencies.
The Kotlin SDK currently does not provide built-in OAuth or authorization functionality. This implementation will require adding comprehensive scope management support including: priority-based scope selection logic (WWW-Authenticate first, then scopes_supported fallback), enhanced error handling for 403 insufficient_scope responses with resource_metadata, scope upgrade flow implementation with different behavior for interactive vs. client credentials clients, retry limits and caching mechanisms to prevent infinite loops, and security guidance for scope minimization and progressive access patterns. This may be implemented as part of an optional OAuth extension module for the SDK.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading SEP-835 and reviewing the Kotlin SDK's current authorization capabilities; the issue states that built-in OAuth functionality is not yet provided. Define the optional OAuth extension module boundaries and implementation plan for scope selection, error handling, upgrades, retries, and caching. Done means the SDK supports the specified scope-management behavior with security guidance and differentiated client flows.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- kotlin
- Domain
- authentication, security
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100