Repository navigation
Description
We run bb 0.44.0 with Codex and Claude Code roles in one project. A project-level Codex .codex/config.toml or Claude .mcp.json exposes an MCP server to every matching project thread. We need one role (Designer) to have Doop MCP tools while other roles use the same Git worktree and project without that server. Role instructions cannot enforce tool visibility. Claude project .mcp.json also has no per-thread tool allowlist, so a project server can expose its entire tool set to roles that do not need it.
Today threads.spawn accepts provider, model, permission and environment settings but has no provider MCP option. The Agent Roles plugin's role_spawn forwards a required prompt immediately to threads.spawn; it cannot create a role-bound thread, prepare its worktree config, then send the first message. A scheduled spawn has no provisioned environment before its first turn. Codex -c/--profile options exist, but bb's spawn API does not expose them.
Could threads.spawn accept an optional, immutable per-thread MCP configuration, for example:
threads.spawn({
projectId, environment, providerId: "codex", prompt,
providerMcp: {
servers: {
doop: {
url: "https://doop.example/mcp",
enabledTools: ["get_frame", "edit_frame_html"]
}
}
}
})The setting should be applied before the provider initializes the first session and be inspectable on the resulting thread (with secrets redacted). It should work with both Codex and Claude Code where each provider supports MCP, specify precedence over project/user MCP configuration, and offer an explicit way to disable a project server for a thread. The MCP connection and OAuth material should remain with the provider; plugins should pass non-secret server policy, not credentials. A spawn with no override should retain current behavior.
This would let Agent Roles map a role's server policy into threads.spawn without modifying the worktree or racing the first turn. A regression test could spawn two threads in the same project/worktree, one with a server and one without, and assert tool discovery on the first turn for each.
Activity