Repository navigation
Closed
Labels
Description
Problem
Kimi threads in one Solenta project can see and act on other projects (files, memory, and thread tools). A run must stay inside its own project.
Why
Kimi has no per-invocation MCP config. Solenta merges coder-memory and coder-threads into the user-global ~/.kimi-code/mcp.json, and the CLI also keeps a global workspaces.json of every directory it has ever opened (including $HOME and /). Combined with:
threads_listreturning every project, and the spawn guard being a self-declaredprojectId(issue Cross-project spawns: a thread can start workers in another project's repo #109 leftover)- Memory MCP treating an omitted
projectas "all projects" - One workspace-wide bearer token with no caller identity
a Kimi agent can list foreign threads, search foreign memory, and drive tools registered for other workspaces.
Claude/Codex already get a Solenta-owned MCP file per launch. Kimi (and Grok) do not. Kimi 0.38 honors KIMI_CODE_HOME, which is the per-run overlay.
Plan
- Isolated
KIMI_CODE_HOMEper Solenta Kimi run — copyconfig.toml, symlink credentials/sessions, write a freshmcp.jsonwith only Solenta servers, writeworkspaces.jsoncontaining only this cwd. Do not inherit the user's other MCP servers or workspaces. Do not copyAGENTS.md. - Bind MCP URLs to the run —
coder-threads?projectId=andcoder-memory?project=so the server, not the model, owns the scope. threads_listis per-project — requiredprojectId, returns only that project. Bound sessions ignore a claimed foreign id.- Memory MCP honors the bind — search/bootstrap/store/recent scoped to the bound project; a claimed other project is rejected.
Grok still uses user-global grok mcp add -s user (same class of hole). Out of scope here.
Check
- Isolated home's
mcp.jsonhas only Solenta servers and scoped URLs;workspaces.jsonhas only the run cwd; sourceAGENTS.mdis absent. threads_listwithoutprojectIderrors; withp1omitsp2threads.- Bound
?projectId=p1rejectsthread_forkof ap2thread even when args claimp2. - Bound memory search does not return another project's entries; claiming a foreign project throws.
Activity
currentbits commentedon Aug 22, 2026
Implemented on this branch.
Kimi Solenta runs now get a per-thread
KIMI_CODE_HOMEoverlay: only Solenta MCP servers (URLs bound with?project=/?projectId=), aworkspaces.jsoncontaining only the run cwd, no inheritedAGENTS.mdor foreign MCP.threads_listis per-project; a bound session cannot name another project. Memory MCP honors?project=the same way.Still open after this:
cdelsewherekimioutside Solenta still gets unscoped servers merged into~/.kimi-code/mcp.json