[v1.x] startAuthorization sends a second prompt parameter when the authorization endpoint already has one (Brex/Okta and Entra reject the request)
Los mantenedores suelen responder en 1 día
@naufalfx805-source ya está trabajando en esto.
Desde el 4/12/2026.
- #3275 de @naufalfx805-source — abierto
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 38/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- authentication
Línea de trabajo
Read src/client/auth.ts around line 1281 and review PR #1958 for the proposed change. Check how startAuthorization handles prompt when the endpoint already includes one and the scope requests offline_access; done means the authorization URL contains only one prompt parameter. The issue asks for a review and a backport to v1.x, so coordinate with the maintainers before taking it on.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Summary
startAuthorization adds prompt=consent with searchParams.append whenever the scope contains offline_access. When the authorization server's advertised authorization_endpoint already carries a prompt query parameter, the request goes out with two prompt parameters, and the authorization server rejects it before the sign-in page loads.
RFC 6749 §3.1 allows the endpoint URI to include a query component (which must be kept) and says request parameters "MUST NOT be included more than once".
Still present on both lines today:
v1.x:src/client/auth.ts:1281main:packages/client/src/client/auth.ts:2188
(Last published release checked: @modelcontextprotocol/[email protected], dist/esm/client/auth.js:815.)
Two servers that fail today
| Server | Advertised authorization_endpoint |
Error |
|---|---|---|
| Brex's hosted MCP server (Okta) | https://accounts-api.brex.com/oauth2/default/v1/authorize?prompt=consent |
invalid_request: Duplicate parameter provided in request. Duplicated parameters: [prompt] |
| Microsoft 365 hosted MCP server (Entra ID) | https://login.microsoftonline.com/.../authorize?prompt=select_account |
AADSTS9000411: The parameter 'prompt' is duplicated |
Both requests ask for offline_access, so the SDK appends prompt=consent on top of the advertised value.
Fix
#1958 (open since 2026-04-24, CI green, not yet reviewed) changes append to set inside the offline_access branch. It targets main. Could it be reviewed, and backported to v1.x, which is still latest on npm? We apply exactly that change as a local patch on 1.32.1 today, and Brex then connects.
Note on Entra: set replaces select_account with consent, so the account picker no longer shows. Sending both values space-separated (select_account consent) is not an option, since Entra rejects that with AADSTS90023.
Reproduction
Any authorization server whose metadata advertises an authorization_endpoint with ?prompt=<anything>, a client that requests offline_access, then auth(): the authorization URL passed to redirectToAuthorization contains prompt=<anything>&...&prompt=consent.
- Lenguaje dominante
- TypeScript
- Estrellas
- 13.8k
- Forks
- 2.5k
- Merge medio
- 6 d 23 h
- PR fusionados (30 d)
- 2
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de modelcontextprotocol/typescript-sdk
-
v2
Dificultad 1/5 Menos de una hora Aptitud para principiantes 72/100
modelcontextprotocol/typescript-sdk#3270 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
`callTool` with `allowInputRequired: true` throws on an `input_required` result when the tool declares an `outputSchema`Posiblemente ocupada @mgoldsborough la tomó hace 6 días. Abiertov2
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
modelcontextprotocol/typescript-sdk#3249 ·
Los mantenedores suelen responder en 1 día
-
v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
modelcontextprotocol/typescript-sdk#3243 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
TypeScript client accepts an unknown `resultType` in the first `server/discover` replyPosiblemente ocupada @Tidehyc la tomó hace 8 días. Abiertov2
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
modelcontextprotocol/typescript-sdk#3235 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
UriTemplate.match() throws a TypeError on an empty expression it acceptsPosiblemente ocupada @yunusemrejs la tomó hace 12 días. Abiertov1 v2
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
modelcontextprotocol/typescript-sdk#3221 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de modelcontextprotocol/typescript-sdk
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Vessel9817/onion-site-template#512 ·
Los mantenedores suelen responder en 1 día
-
nightly-tests
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
BlackBeltTechnology/pi-agent-dashboard#1256 ·
Los mantenedores suelen responder en 1 día
-
approved
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
fritzprix/libr-agent#3266 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 88/100
better-auth/better-auth#13101 · 1 comentario · 1 reacción ·
Los mantenedores suelen responder en 1 día