Expose OAuth discovery and registration results for application-owned flows
Les mainteneurs répondent en général sous 2 jours
@connor4312 y travaille déjà.
Depuis le 16/10/2026.
Évaluation
Cette issue n'a pas encore été évaluée.
Description
Could rmcp expose complete discovery and registration results for applications that use its protocol helpers but own the surrounding OAuth lifecycle?
The use case is a client that has its own versioned credential persistence, refresh coordination, consent UI, and HTTP policy. It would like to reuse rmcp's discovery and registration rather than duplicate them, then use the resulting data with lower-level OAuth operations. This is distinct from supplying a custom CredentialStore to the SDK-managed authorization flow.
I checked main at 5d9935d. Two public-API gaps make that composition difficult:
AuthorizationMetadataResolutionexposes AS metadata and discovery provenance, but not the discovered protected-resource identifier or the selected advertised authorization-server identifier. Resource scopes also remain private, andselect_scopes()applies policy rather than returning the separate discovery inputs.AuthorizationManager::register_client()parses the publicClientRegistrationResponse, then returns anOAuthClientConfigand configures the manager. The returned config retains the client ID/secret, but uses the requested redirect URI and drops the server-returned redirect list, client name, and extension fields such astoken_endpoint_auth_method.
This means a caller cannot obtain all the resource/issuer/registration facts through those public operations without independently repeating discovery or intercepting and parsing HTTP responses.
An additive approach might be:
- Extend the existing discovery result with the resource identifier and selected advertised AS identifier, with explicit absence semantics for direct-AS discovery and legacy fallback. If separate challenge/resource scopes are exposed, coordinate that representation with the scope-selection work below. Return facts from the same discovery operation, rather than assembling a result from later mutable manager state.
- Expose a registration operation returning the existing
ClientRegistrationResponse. Define it as registration-only, leaving the currentregister_client()convenience method to delegate to it and perform its existing configuration step. This should share one request/parsing implementation and preserve the current method's signature.
The registration result would mean the parsed server response, not a claim that every redirect or authentication method is acceptable to the application. Its validation guarantees and handling of secret-bearing fields should be explicit. Existing convenience flows and default policy could remain unchanged.
Related work I found:
- #1041 already exposes discovery provenance; this would extend that result rather than add a competing API.
- #962 uses the discovered resource internally, while #1113 proposes an override. Public discovery output is a different requirement.
- #1352 addresses initial scope selection. I would coordinate any scope-source exposure with it, rather than implement another selection policy or tracker.
- #1355 / #1358 address DCR authentication-method selection, and #1255 addresses credential restoration. Returning the actual registration response would complement those changes, not replace them.
Potential regression tests would cover a discovered resource different from the configured endpoint; explicit absence on non-PRM paths; ordinary versus challenge-seeded discovery; repeated discovery without stale result fields; preservation of returned registration redirects/name/extensions; one discovery/registration request path; and compatibility of the existing convenience methods.
This proposal does not change issuer-selection/fallback behavior, private-destination policy, automatic retries, or credential persistence. Those can be discussed separately; it should not duplicate the active scope or transport-policy work.
Would additive result APIs along these lines fit the SDK? I can contribute focused discovery-result and registration-result PRs once the intended API boundary is agreed. If an existing issue or planned API already covers these exact outputs, a pointer would help avoid duplicate work.
- Langage dominant
- Rust
- Étoiles
- 4k
- Forks
- 662
- Merge moyen
- 3 j 20 h
- PR mergées (30 j)
- 30
Préparer son environnement
Lance le conteneur de développement du projet dans votre navigateur, avec votre propre compte GitHub.
- Aucun Dockerfile ni fichier Docker Compose
- Aucun modèle de pull request
- Lire le guide de contribution
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de modelcontextprotocol/rust-sdk
-
Streamable HTTP client: a 401 or 403 with a JSON-RPC error body and no WWW-Authenticate loses its HTTP statusPeut-être pris @aton-of-data l’a pris il y a 5 jours. Ouvertebug P2 ready for work T-security T-transport
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
modelcontextprotocol/rust-sdk#1339 ·
Les mainteneurs répondent en général sous 2 jours
-
auth: refresh_token() requests offline_access that was never granted, so refreshes fail with invalid_scopePeut-être pris @jstar0 l’a pris il y a 8 jours. Ouvertebug P1 ready for work T-security T-transport
Difficulté 2/5 1-3 heures Accessibilité débutants 65/100
modelcontextprotocol/rust-sdk#1330 ·
Les mainteneurs répondent en général sous 2 jours
-
P3 question Stale T-documentation T-enhancement
Difficulté 1/5 Moins d'une heure Accessibilité débutants 86/100
modelcontextprotocol/rust-sdk#1155 · 1 commentaire ·
Les mainteneurs répondent en général sous 2 jours
-
Two rmcp tests fail on Windows: connection-refused text check and `npm` spawn in test_with_jsPeut-être pris @bolinfest l’a pris il y a 2 jours. Ouvertebug P2 ready for work T-test
modelcontextprotocol/rust-sdk#1364 · 1 commentaire · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
-
Client never answers a server `ping` sent during the `initialize` handshakePeut-être pris @bolinfest l’a pris il y a 2 jours. Ouvertebug P1 ready for work T-service
modelcontextprotocol/rust-sdk#1362 · 3 commentaires · 1 personne assignée ·
Les mainteneurs répondent en général sous 2 jours
Toutes les issues de modelcontextprotocol/rust-sdk
Issues similaires
-
Difficulté 1/5 Moins d'une heure Accessibilité débutants 88/100
pop-os/cosmic-comp#2956 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
libp2p/rust-libp2p#6694 ·
Les mainteneurs répondent en général sous 1 jour
-
Stack overflow in `check bans` with `include-dependencies = true` and a dev-dependency cycleOuverte
Difficulté 2/5 1-3 heures Accessibilité débutants 78/100
EmbarkStudios/cargo-deny#910 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
tursodatabase/turso#10054 ·
Les mainteneurs répondent en général sous 1 jour
-
build: Update rust versionPeut-être pris Une pull request liée à cette issue est ouverte ou déjà fusionnée. Ouvertedependencies
Difficulté 2/5 1-3 heures Accessibilité débutants 67/100
ibm-granite-community/granite-cli#229 ·
Les mainteneurs répondent en général sous 1 jour