Skip to content

TUI "Add Agent -> CLI Agent" writes a non-working MCP entry for Codex/Gemini/OpenCode/Copilot slots #4

Closed

Description

@hollowsunhc

GSD Version

0.33.1

Runtime

Claude Code

What happened?

Using the TUI to add codex-1 as a CLI Agent created a slot that appeared in config, but it did not become a connected MCP server. In Claude Code, /nf:mcp-status reported codex-1 as configured but not connected / with no MCP tools available.

What did you expect?

Adding codex-1 through the TUI should create a working MCP quorum slot that is immediately usable by /nf:mcp-status, /nf:quorum, etc.

Steps to reproduce

  1. Launch nforma or nforma tui
  2. Go to Agents -> Add Agent
  3. Choose CLI Agent
  4. Enter values such as:
    • Slot name: codex-1
    • CLI command: codex
    • Main tool: codex
  5. Launch Claude Code
  6. Run /nf:mcp-status

Relevant logs or error messages

`/nf:mcp-status` reported that only `codex-1` was configured in `~/.claude.json`, but that no MCP tools were currently available / the MCP server was not connected.

Relevant code context:
- `bin/nForma.cjs` currently writes CLI slots as a bare stdio command entry:
  - `data.mcpServers = { ...servers, [slotName]: { type: 'stdio', command, args: [] } };`
- `README.md` says quorum agents should run through `bin/unified-mcp-server.mjs`

Activity

  1. self-assigned this
    on Mar 13, 2026
  2. jobordu commented on Mar 15, 2026

    @jobordu

    Investigated — this is partially fixed but core bug remains in staging.

    What was fixed (commit bff7f30b): CLI commands are now resolved to absolute paths via resolveCli() and validated for executability before writing.

    What's still broken: The TUI writes a bare stdio entry:

    { "type": "stdio", "command": "/usr/local/bin/codex", "args": [] }

    But it should route through unified-mcp-server.mjs like bin/install.js does:

    {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/bin/unified-mcp-server.mjs"],
      "env": { "PROVIDER_SLOT": "codex-1" }
    }

    Without this, TUI-added CLI agents don't get unified tool definitions (ping, identity, health_check) and aren't functional MCP servers.

    Files to fix: bin/nForma.cjs lines ~1708 (CLI) and ~1750 (API) — both need to use unified-mcp-server.mjs as entrypoint with PROVIDER_SLOT env var.

  3. jobordu commented on Mar 15, 2026

    @jobordu

    Fixed in staging branch (commit f3efd1a3, pending release to main).

    Changes to bin/nForma.cjs:

    CLI agents — now route through unified-mcp-server.mjs instead of spawning the CLI binary directly:

    {
      "type": "stdio",
      "command": "node",
      "args": ["/path/to/bin/unified-mcp-server.mjs"],
      "env": { "PROVIDER_SLOT": "codex-1" }
    }

    The resolved CLI path is stored in providers.json metadata (cli field) so resolve-cli.cjs and unified-mcp-server.mjs can find it at dispatch time.

    API agents — fixed missing unified-mcp-server.mjs in args (was args: [], now args: [unifiedMcpPath]).

    Both formats now match what bin/install.js writes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions