Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

bug(desktop): workspace trust prompt not shown for project MCP on Windows

未关闭
#3,949 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
48/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
typescript
领域
desktop, security

调研方向

Start by tracing Desktop session startup for an untrusted workspace and the project-level .kimi-code/mcp.json loading path, then compare it with GET and POST /api/v1/workspaces/{workspace_id}/trust. Reproduce on Windows 11 using the provided MCP configuration; done means the Desktop flow visibly prompts for trust and persists the user's trust or decline decision before enabling project MCP configuration.

由索引模型根据 Issue 内容生成。

描述

What version of Kimi Code is running?

Desktop app 1.0.2 (Windows x64, packaged), embedded server host_version 2.0.1.

Which open platform/subscription were you using?

Kimi subscription. The exact paid tier was not shown in the Desktop UI used for this reproduction.

Which model were you using?

K2.8 Preview.

What platform is your computer?

Windows 11 x64.

What issue are you seeing?

A project-level MCP server is correctly discovered from:

<workspace>\.kimi-code\mcp.json

but when the workspace is untrusted, Kimi Code Desktop does not show the documented Workspace Trust prompt at session start.

Observed state:

  • Desktop session starts normally.
  • No Workspace Trust dialog is shown.
  • Project MCP server is not registered in the session while the workspace remains untrusted.
  • The local Server API reports:
    {"code":0,"msg":"success","data":{"trusted":false}}
    
  • After explicitly marking the workspace trusted through the documented local Server API, a new Desktop session registers the project MCP server and exposes its mcp__<server>__authenticate tool, confirming that trust was the gating condition.

No OAuth authorization or external MCP calls are required to reproduce the missing trust prompt.

What steps can reproduce the bug?

  1. On Windows 11, create a new dedicated folder, for example:

    C:\work\mcp-trust-repro
    
  2. Create:

    C:\work\mcp-trust-repro\.kimi-code\mcp.json
    
  3. Put a project-level remote HTTP MCP entry in it, for example:

    {
      "mcpServers": {
        "example-api": {
          "url": "https://example.com/mcp"
        }
      }
    }
    
  4. Open that folder as a workspace in Kimi Code Desktop 1.0.2.

  5. Start a new session.

  6. Observe:

    • no Workspace Trust prompt is shown;
    • the project MCP server is not registered in the agent session.
  7. Read the workspace trust state through the documented local Server API:

    GET /api/v1/workspaces/{workspace_id}/trust
    

    Result:

    {"code":0,"msg":"success","data":{"trusted":false}}
    
  8. Workaround: explicitly grant trust through the documented local Server API:

    POST /api/v1/workspaces/{workspace_id}/trust
    Content-Type: application/json
    
    {}
    
  9. Verify:

    GET /api/v1/workspaces/{workspace_id}/trust
    

    now returns trusted:true.

  10. Start a new Desktop session. The project MCP server is now registered and, for an OAuth MCP server, its mcp__<server>__authenticate tool is announced.

This reproduces the difference between the expected trust UI flow and the actual Desktop behavior.

What is the expected behavior?

When Kimi Code Desktop starts a session in an untrusted workspace containing project-level MCP servers, it should surface the documented Workspace Trust prompt before project MCP configuration is enabled.

The prompt should identify the project MCP launch target / remote URL, allow the user to explicitly trust or decline the folder, and persist that decision.

If Desktop intentionally uses a different trust UX than CLI/TUI, there should be a visible documented Desktop control for the same state.

Additional information

I searched existing issues before filing. The closest result I found was #2976, which covers trust not being inherited by subdirectories/worktrees. That is different from this reproduction: here the exact workspace itself remains trusted:false, no trust prompt is displayed, and project MCP loading is blocked until trust is granted manually.

The workaround above is reversible with:

POST /api/v1/workspaces/{workspace_id}/untrust
Content-Type: application/json

{}

One implementation detail that may help narrow the problem: the server-side trust API behaves as expected once called directly; the apparent failure is in surfacing/reaching the trust decision from Desktop UI/session startup, not in trust persistence itself.

No credentials, tokens, account identifiers, local usernames, or production endpoints are included in this report.

主要语言
TypeScript
星标
7.7k
派生
1.3k
平均合并
12 小时 35 分钟
30 天内合并 PR
311

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

MoonshotAI/kimi-code 的其他 Issue

查看 MoonshotAI/kimi-code 的全部 Issue

相似的 Issue

更多 TypeScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。