block / block/buzz

CLI: expose --mcp-command and --env on `buzz agents draft-create`/`draft-update` (GUI Advanced parity)

Open
#3,115 4 comments 0 reactions 0 assignees View on GitHub
Dominant language
Rust
Stars
32.7k
Forks
4.3k
Avg merge
1d 13h
Merged PRs (30d)
253

Description

## Problem

`buzz agents draft-create` / `draft-update` can set `channel`, `display_name`,
`system_prompt`, `runtime`, `provider`, `model`, `respond_to` — but **not** the
harness's MCP command or extra env. Those are the two fields that let a managed
agent carry *external tools* (an app's own MCP server + the token it needs).

Today only Desktop's Create-agent → **Advanced** exposes them
(`desktop/src/features/agents/channelAgents.ts:237` → `runtime.mcpCommand`,
plus `env_vars` in `useGlobalAgentConfig.ts:18`). The harness already supports
an arbitrary MCP:

- `crates/buzz-acp/src/config.rs:261` — `#[arg(long, env = "BUZZ_ACP_MCP_COMMAND")] pub mcp_command: String`
- `crates/buzz-acp/src/lib.rs:4141` `build_mcp_servers()` — takes **any** command (derives name from path), not hardcoded to `buzz-cli`; injects `BUZZ_RELAY_URL` / `BUZZ_PRIVATE_KEY` into its env.
- `crates/buzz-acp/src/lib.rs:3721` — `extra_env` passthrough already exists.

So the capability is there; the CLI just can't reach it. Anyone scripting agent
provisioning (CI, an app's own `setup` command) is forced through the Desktop GUI.

## Ask

Add to `buzz agents draft-create` and `draft-update`:

```
--mcp-command # BUZZ_ACP_MCP_COMMAND for the harness
--env KEY=VALUE # repeatable; merged into the MCP subprocess env (extra_env)
```

Wire them into the same request the Desktop **Advanced** panel already sends
(`runtime.mcpCommand`, `env_vars`) — no new harness behavior, just CLI parity
with the GUI.

## Why

Lets an app provision a fully-configured managed agent from one scripted command
— e.g. a ` mcp` tool server + its `_TOKEN` — instead of walking a user
through the Advanced GUI. Same motivation as the install deep-link (block/buzz#2911):
make the agent path scriptable end-to-end.

Happy to send the PR if the shape looks right.

Contributor guide

Open the contributing guide

Research direction

Start by locating the CLI entry points for `buzz agents draft-create` and `draft-update`, then compare their request construction with `desktop/src/features/agents/channelAgents.ts:237` and `useGlobalAgentConfig.ts:18`. Use `crates/buzz-acp/src/config.rs:261` and `crates/buzz-acp/src/lib.rs:3721`/`4141` to confirm the existing field names and environment behavior; done means both commands accept repeatable `--env` and `--mcp-command` and send them through the same request fields as the Desktop Advanced panel.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.