A workspace's MCP server set to permission: auto runs its tools unasked only once the workspace is trusted; the start question grants starting it and says so; the workspace's layer reads nothing from outside the repository until trusted; a linked opencode.json gives its servers¶
Decision 830 · accepted · 2026-10-10 · issue #522
Decision 825 is the pattern; this applies it to the other place a repository's file could let a tool run unasked.
- What was wrong. A
.troupe/mcp.jsonarrives with a clone and may say"permission": "auto"on a server. Its servers start only after the session's question (Decision 700), but once that was answeredallow(oronce) every tool of the server ran without asking: the question was about starting a command, and the answer granted its tools' calls as well. - The rule. A server the workspace's layer names, in
.troupe/mcp.jsonor in a file that file links (include), and that sayspermission: auto, has itsautoapply only when the workspace is trusted (trusted_workspaces, Decision 686). Until then its tools areask, whatever the start's answer; the start's question is about starting. The person's own<config>/mcp.json(and what it links, wherever that is) andconfig.yaml'smcp:(read from a project's file only when it is trusted, 686) keep what they say. A pod trusts no workspace (as 825 has it for agents), and reads none of these layers anyway (700). - Which entry is the workspace's. The layers merge by name (700) and a merged entry
carries the highest layer that names it. An entry the workspace's file changes over one
of the person's own (
{"shared": {"command": "elsewhere"}}) is the workspace's: what would run unasked is then what the workspace says, so the person'sautobeneath it is held too. A workspace that only turns the person's server off or on holds it as well; narrower than needed, and a person who wants theirautoback moves the entry or trusts the workspace.Troupe.MCP.Local.waits_for_trust?/1is the one test. - Gated where a session starts the server, at run time.
Troupe.Session.MCP'sstart/2is where a server'spermissionbecomes its tools' default permission, for a stdio server (Troupe.MCP.Stdio) and a URL server (Troupe.MCP.Server) alike, and the path areloadand a finished sign-in take too; it starts a held server withask. Not inTroupe.MCP.Local.resolve/2, whichmcp.list, the trust store's fingerprint andmcp.checkread and which should say what the file says; not when a file is written, for 825's reason: a hand-written.troupe/mcp.json, a copied import (which keeps the other file'sauto, the issue's second sentence) and whatever onboarding writes are covered alike. Trust is whatTroupe.Sessionpassed at start (the user file's list, as the session's config read it), so a workspace trusted mid-session applies to the next session, as 825's agents and 686's gated keys do. - The question says what it grants. "This workspace's .troupe/mcp.json names MCP
servers to start on this machine: … Start them?", the options
start none of them,start them for this session only,start them, and remember it for this workspace; "run" said more than the answer gives. Where a listed server is set toauto, the question says so before asking: "stub is set to permission: auto, which applies once this workspace is trusted (troupe config trust); until then its tools ask before each call." Only an untrusted workspace is asked at all (700), so that sentence is true whenever it is shown. The labels and their order ( denyfirst) are 700's. mcp.listsays why, additively. Each server gainsnotes,[{"key", "reason"}], the shapeagents.listgave a held agent (825): onepermissionnote, the same sentence, on a workspace server set toautowhile the workspace is not trusted (read from the user file when the list is asked for, asagents.listdoes);[]otherwise.permissionstays what the entry says, andtruststaystrustedorpendingfor the start, so no client reads either differently. The TUI's/mcppage and the desktop app do not shownotesyet.troupe config trustanduntrustname the servers beside the agents in their answers.- A workspace's layer reads nothing from outside the repository until it is trusted.
Found beside this by the #519 fixer (Decision 829): a
.troupe/mcp.jsoncouldincludethe person's own file (~/.claude.json,<config>/mcp.json) and so offer their servers, their environment with them, under the workspace's layer, asked about as the repository's at best. Now the workspace's layer is held to the repository (Troupe.Instructions.repository_root/1, the directory with.git, else the workspace), by where each file really is, links followed, as 829 holds askills.json's include: an include from outside, a link inside that points out, and a.troupe/mcp.jsonthat is itself a link out are not read until the workspace is trusted, and each is named in the warnings, "… includes ~/.claude.json, outside the repository: not read until this workspace is trusted (troupe config trust)", which mcp.listcarries and the session logs. Inside the repository an include is read as before; once trusted, anything is, since trusting a workspace is how a person says its files may name what runs (686). The person's own layer has no edge. In the warnings rather than a new field: they are wheremcp.listalready says a linked file is missing or malformed, and no server comes of it, so there is no entry to hang a note on.Troupe.MCP.Local.resolve/2takestrusted: true; anything else is not, so a caller that forgets is held. The session passes what it judged at start;mcp.list,mcp.check,mcp.sign_in,mcp.toolsandmcp.callpass the user's file's word, so a held server isnot_foundthere too. - D100: a linked
opencode.jsongives its servers.Troupe.MCP.Local's reader took a layer file's servers frommcpServers,serversandmcp_servers, so a file linked withincluderead as empty when it was opencode's, whose servers are undermcp, while a copy of it worked. It now takesmcptoo and hands it toTroupe.MCP.Import.from_map/2, which reads opencode's entries as an import does (acommandlist,environment,enabled: falseas off) and already tells that key from a bare map with one server namedmcp. - Not this decision. An import that copies an
autointo the person's own layer keeps it without a word, since the person chose that file; a warning naming it is a follow-up.mcp.callandmcp.tools(Decision 748) call a person's server outside any session and take no permission; a pod session offered those tools asks, as 748 has it.
Governs: apps/troupe_core/lib/troupe/config/trust.ex, apps/troupe_core/lib/troupe/mcp/local.ex, apps/troupe_core/lib/troupe/session/mcp.ex, apps/troupe_gateway/lib/troupe/gateway/local_sources.ex