bug(desktop): MCP OAuth authorization URL is not surfaced before callback timeout
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 3/5
- Tiempo estimado
- 1-2 días
- Aptitud para principiantes
- 65/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- desktop
Línea de trabajo
Start by tracing the Desktop UI's handling of live tool updates from the MCP authentication flow, which can be invoked through /mcp-config; the report says the tool emits an authorization-URL update before waiting for the callback. Done means Desktop surfaces the URL or opens it in the browser while the callback listener is still active, so authorization can finish before timeout.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
What version of Kimi Code is running?
Desktop app 1.0.2 (Windows x64, packaged), embedded server host_version 2.0.1.
Which model were you using?
K2.8 Preview.
What platform is your computer?
Windows 11 x64.
What issue are you seeing?
For a project-level remote HTTP MCP server that requires OAuth, Kimi Code Desktop exposes the generated mcp__<server>__authenticate tool, but invoking the login flow does not surface the fresh authorization URL to the user while the callback listener is still active.
Observed behavior:
mcp__cloudflare-api__authenticatestarts and the UI remains atWaiting for output....- No browser window is opened.
- No authorization URL is shown while the flow is live.
- After the OAuth callback wait times out, the tool finally returns an error that includes the authorization URL.
- Opening that URL at that point reaches the provider's authorization page, but the redirect back to
127.0.0.1:<port>/callbackfails because the local callback listener has already timed out and closed.
This was reproduced twice with different callback ports.
The remote MCP server itself and the OAuth provider are working. The same OAuth flow completes successfully through the documented local MCP management API when the authorization URL is retrieved immediately and opened while the callback listener is live.
What steps can reproduce the bug?
-
On Windows 11, configure a project-level remote HTTP MCP server in:
<workspace>\.kimi-code\mcp.json -
Trust the workspace so the project MCP server is loaded.
-
Start a fresh Kimi Code Desktop session.
-
Confirm that the server requires OAuth and that the generated authentication tool is visible, for example:
mcp__example-api__authenticate -
Invoke the MCP login flow (for example through
/mcp-config). -
Observe that Desktop remains on:
Waiting for output...without opening a browser and without showing the fresh authorization URL.
-
Wait for the callback timeout.
-
Observe that only after timeout does the tool output include an authorization URL.
-
Open that returned URL and authorize promptly.
-
Observe that the final redirect to the local callback endpoint fails because the listener has already closed.
What is the expected behavior?
As soon as the MCP OAuth flow creates the authorization URL and local callback listener, Desktop should surface the authorization URL immediately (or open it in the user's browser), while the listener is active.
The user must be able to complete authorization before the callback timeout.
The tool implementation already emits an authorization-url update before waiting for the callback, so Desktop should render that live update rather than exposing the URL only after the tool finishes with a timeout.
Verified workaround
The underlying server-side OAuth flow works through the documented MCP management API:
-
Begin the flow:
POST /api/v2/mcp/auth:begin?cwd=<workspace> Content-Type: application/json { "source": "global", "name": "example-api" } -
Read the returned
authorizationUrlimmediately and open it in the browser while the callback listener is active. -
Complete the provider authorization.
-
Wait for completion:
POST /api/v2/mcp/auth:complete Content-Type: application/json { "flowId": "<flow-id>", "timeoutMs": 900000 } -
The completion returns
code: 0, and an offline auth-status check reports:oauth-authorized
This confirms that OAuth, PKCE, local callback handling, and credential persistence all work when the authorization URL is surfaced in time. The failure appears specific to the Desktop UI/live tool-update path.
Additional information
I searched existing issues before filing and did not find a duplicate for this Desktop-specific symptom.
This is separate from #3949, which concerns the missing Workspace Trust prompt for project MCP configuration.
No OAuth URLs, callback state values, credentials, tokens, account identifiers, local usernames, production domains, or request IDs are included in this report.
- Lenguaje dominante
- TypeScript
- Estrellas
- 7.5k
- Forks
- 1.2k
- Merge medio
- 12 h 48 min
- PR fusionados (30 d)
- 315
Preparar el entorno
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 MoonshotAI/kimi-code
-
手机竖屏显示状态下输入框的扩展按钮没有显示Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
MoonshotAI/kimi-code#4040 ·
Los mantenedores suelen responder en 1 día
-
顶栏字体不随字体大小缩放bugAbiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
MoonshotAI/kimi-code#4039 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
MoonshotAI/kimi-code#4010 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
MoonshotAI/kimi-code#4008 ·
Los mantenedores suelen responder en 1 día
-
docs(zh): configuration/providers.md is missing the "OAuth and credential injection" sectionAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
MoonshotAI/kimi-code#3947 ·
Los mantenedores suelen responder en 1 día
Todos los issues de MoonshotAI/kimi-code
Issues similares
-
Add: Digi World (Romania) SDAbiertocheck:passed streams:add
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
Fission-AI/OpenSpec#1986 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
nestjs/docs.nestjs.com#3554 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
publicodes/publicodes#868 ·
-
namespace operations
Dificultad 1/5 Menos de una hora Aptitud para principiantes 78/100
EclipseFdn/open-vsx.org#13488 ·
Los mantenedores suelen responder en 2 días