Skip to content

MCP server: sequant init --yes should not auto-add to all detected clients #392

Closed

Description

@admarble

Context

In #372, sequant init --yes auto-adds Sequant MCP config to ALL detected clients (Claude Desktop, Cursor, VS Code) without asking. Users may not want Sequant added to every MCP client on their system.

Goal

--yes should either skip MCP config entirely (opt-in) or add with a visible summary rather than silently writing to all configs.

Acceptance Criteria

  • sequant init --yes does NOT silently add MCP config to all clients
  • Interactive mode still prompts per-client or as a group
  • sequant init --yes --mcp explicitly opts in to auto-add

Activity

  1. added
    bug
    multi-agent
    on Mar 23, 2026
  2. added a commit that references this issue on Mar 24, 2026
  3. admarble commented on Mar 24, 2026

    @admarble
    ContributorAuthor

    Exec Phase — Progress Update

    AC Coverage

    AC Description Status Evidence
    AC-1 sequant init --yes does NOT silently add MCP config ✅ Implemented init.ts:549-557
    AC-2 Interactive mode still prompts per-client or as a group ✅ Implemented init.ts:558-568 (unchanged)
    AC-3 sequant init --yes --mcp explicitly opts in ✅ Implemented bin/cli.ts:109-112, init.ts:551

    Key Files Changed

    • bin/cli.ts — Added --mcp option to init command
    • src/commands/init.ts — Modified MCP auto-add logic: --yes skips MCP config; --yes --mcp opts in
    • src/commands/init.test.ts — 4 new tests for MCP config behavior
    • CHANGELOG.md — Documented fix under [Unreleased]

    Quality Gates

    Check Status
    npm run build ✅ Passed
    npm run lint ✅ Passed
    npm test ✅ 1837 passed

    PR

    🔗 #410

    Quality Plan Alignment: N/A — No quality plan in issue

  4. admarble commented on Mar 24, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #392

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original sequant init --yes does NOT silently add MCP config to all clients MET init.ts:550-560 — addMcp defaults to false when skipPrompts is true; only set to true when options.mcp is explicitly passed. Test confirms addSequantToMcpConfig is not called with --yes alone.
    AC-2 Original Interactive mode still prompts per-client or as a group MET init.ts:562-571 — interactive path unchanged, inquirer.prompt still asks "Add Sequant MCP server to detected clients?". Test verifies the prompt is triggered.
    AC-3 Original sequant init --yes --mcp explicitly opts in to auto-add MET bin/cli.ts:109-112 registers --mcp flag; init.ts:553 checks options.mcp. Test verifies addSequantToMcpConfig called once per detected client.

    Coverage: 3/3 AC items fully met


    CI Status

    Check Conclusion Impact
    build (20.x) SUCCESS ✅ MET
    build (22.x) SUCCESS ✅ MET
    validate-skills SUCCESS ✅ MET
    typecheck SUCCESS ✅ MET
    validate-plugin SUCCESS ✅ MET

    CI Summary: 5 passed, 0 pending, 0 failed


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 4 OK
    Lines added +94 -
    Lines deleted -3 -

    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/commands/init.ts Standard ✅ Yes src/commands/init.test.ts
    bin/cli.ts Standard ✅ Yes Covered by init.test.ts (options propagation)
    CHANGELOG.md Optional N/A -

    Coverage: 2/2 changed source files have corresponding tests
    Critical paths without tests: None


    Code Review

    Strengths:

    • Clean, minimal change — only 4 files touched with a focused diff
    • Logic is straightforward: addMcp = false by default in non-interactive, flipped by --mcp
    • Good test coverage: 4 new tests covering all three AC scenarios plus non-interactive-without---mcp
    • Helpful user feedback: "Skipping MCP config (use --mcp to auto-add in non-interactive mode)"
    • CHANGELOG entry properly formatted under [Unreleased] > Fixed

    Issues:

    • None found

    Suggestions:

    • None — implementation is clean and focused

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Tests assert on observable behavior (mock call counts, console output)
    Coverage Depth ✅ OK All 3 AC paths + non-interactive edge case covered
    Mock Hygiene ✅ OK Only external dependencies mocked (detectMcpClients, addSequantToMcpConfig, inquirer)
    Test Reliability ✅ OK Deterministic, no timing dependencies

    Anti-Pattern Detection

    No anti-patterns detected. No dependency changes.


    Execution Evidence

    Test Type Command Exit Code Result
    Help output npx tsx bin/cli.ts init --help 0 ✅ --mcp flag visible in help
    Build npm run build 0 ✅ Clean compilation
    Tests npm test 0 ✅ 1837/1837 passed

    Evidence status: Complete


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix: commit)
    [Unreleased] entry ✅ Present (#392)
    Entry format ✅ Valid — action verb, issue number, sub-bullets

    Result: CHANGELOG requirements met


    Self-Evaluation

    • Verified working: Yes — confirmed --mcp appears in init --help, traced code path from CLI registration through options.mcp to addMcp logic, verified tests assert all three AC scenarios.
    • Test efficacy: High — tests directly verify addSequantToMcpConfig call/no-call behavior for each mode.
    • Likely failure mode: If skipPrompts logic changes upstream (e.g., new flags that set it), the MCP guard would need updating. Low risk — the condition is simple and well-tested.
    • Verdict confidence: High — small, focused change with complete test coverage and passing CI.

    Verdict: READY_FOR_MERGE

    All 3 acceptance criteria are met. The implementation is clean, minimal, and well-tested. CI passes across all checks. No issues found.

    Documentation

    • CHANGELOG entry added
    • N/A — No README/docs changes needed (CLI --help is self-documenting)

    Next Steps

    1. Run /docs 392 to generate feature documentation (if desired)
    2. Merge PR fix(#392): sequant init --yes should not auto-add MCP to all clients #410
  5. added
    ready-for-review
    on Mar 24, 2026
  6. added 2 commits that reference this issue on Mar 24, 2026
  7. admarble commented on Mar 24, 2026

    @admarble
    ContributorAuthor

    Documentation Updated

    File: docs/features/mcp-server.md (existing doc updated)

    Changes:

    • Added "Non-interactive mode" subsection under "Automatic setup"
    • Documents --yes skipping MCP config and --yes --mcp opt-in
    • Shows the skip message users will see
    • Updated provenance line

    Status:

    ✅ Documentation ready for review and merge.

  8. added 2 commits that reference this issue on Mar 24, 2026
  9. admarble commented on Mar 24, 2026

    @admarble
    ContributorAuthor

    QA Review for Issue #392

    AC Coverage

    AC Source Description Status Notes
    AC-1 Original sequant init --yes does NOT silently add MCP config to all clients MET init.ts:549-560 — addMcp defaults to false when skipPrompts is true; only set to true when options.mcp is explicitly passed. Test verifies addSequantToMcpConfig is not called with --yes alone.
    AC-2 Original Interactive mode still prompts per-client or as a group MET init.ts:562-571 — interactive path unchanged, inquirer.prompt still asks "Add Sequant MCP server to detected clients?". Test verifies the prompt is triggered in interactive mode.
    AC-3 Original sequant init --yes --mcp explicitly opts in to auto-add MET bin/cli.ts:109-112 registers --mcp flag; init.ts:551 checks options.mcp. Test verifies addSequantToMcpConfig called once per detected client with correct args.

    Coverage: 3/3 AC items fully met


    Stale Branch Check

    Check Value
    Commits behind main 2
    Threshold 5
    Status ⚠️ Warning

    Feature branch is 2 commits behind main. Consider rebasing before merge.


    CI Status

    Check State Bucket Impact
    build (20.x) SUCCESS pass ✅ MET
    build (22.x) SUCCESS pass ✅ MET
    typecheck SUCCESS pass ✅ MET
    validate-plugin SUCCESS pass ✅ MET
    validate-skills SUCCESS pass ✅ MET

    CI Summary: 5 passed, 0 pending, 0 failed


    Quality Metrics

    Metric Value Status
    Type issues (any) 0 OK
    Deleted tests 0 OK
    Files changed 5 OK
    Lines added +117 -
    Lines deleted -5 -

    Quality Plan Verification

    N/A — No quality plan found in issue comments.


    Cache Status

    N/A — No caching configured for this run.


    Build Verification

    N/A — CI build passed on all Node versions.


    Test Coverage Analysis

    Changed File Tier Has Tests? Test File
    src/commands/init.ts Standard ✅ Yes src/commands/init.test.ts
    bin/cli.ts Standard ✅ Yes Covered by init.test.ts (options propagation verified)
    docs/features/mcp-server.md Optional N/A Documentation
    CHANGELOG.md Optional N/A Metadata

    Coverage: 2/2 changed source files have corresponding tests
    Critical paths without tests: None


    Code Review

    Strengths:

    • Clean, minimal change — only 5 files touched with a tightly focused diff (+117/-5)
    • Logic is straightforward: addMcp = false by default when skipPrompts is true, flipped only by --mcp
    • Good test coverage: 4 new tests covering all three AC scenarios plus non-interactive-without---mcp
    • Helpful user feedback message: "Skipping MCP config (use --mcp to auto-add in non-interactive mode)"
    • CHANGELOG entry properly formatted under [Unreleased] > Fixed with sub-bullets
    • Docs updated in docs/features/mcp-server.md with non-interactive mode section

    Issues:

    • None found

    Suggestions:

    • None — implementation is clean and focused

    Test Quality Review

    Category Status Notes
    Behavior vs Implementation ✅ OK Tests assert on observable behavior (mock call counts, console output, prompt detection)
    Coverage Depth ✅ OK All 3 AC paths + non-interactive without --mcp edge case covered
    Mock Hygiene ✅ OK Only external dependencies mocked (detectMcpClients, addSequantToMcpConfig, inquirer)
    Test Reliability ✅ OK Deterministic, no timing dependencies

    Anti-Pattern Detection

    Dependency Audit

    N/A — No dependency changes

    Code Patterns

    No anti-patterns detected. No N+1 queries, empty catch blocks, hardcoded secrets, SQL injection, eval usage, or bind-all-interfaces patterns.

    Critical Issues: 0
    Warnings: 0


    Call-Site Review

    N/A — No new exported functions.


    Execution Evidence

    N/A — No executable scripts changed.


    Skill Command Verification

    N/A — No skill files changed.


    CLI Registration Verification

    N/A — No RunOptions or batch executor interface changes. The InitOptions interface was modified with mcp?: boolean, and the corresponding --mcp CLI registration was verified in bin/cli.ts:109-112.


    Smoke Test

    Not Required — No workflow-affecting changes (skills, scripts, CLI commands). The --mcp flag is a new option on an existing command, verified through unit tests.


    CHANGELOG Verification

    Check Status
    CHANGELOG.md exists ✅ Found
    User-facing changes ✅ Yes (fix: commit)
    [Unreleased] entry ✅ Present (#392)
    Entry format ✅ Valid — action verb "Fix", issue number (#392), sub-bullets

    Result: CHANGELOG requirements met


    Self-Evaluation

    • Verified working: Yes — traced code path from CLI registration (--mcp) through options.mcp to addMcp logic in init.ts. Verified the old code (let addMcp = skipPrompts) was the root cause and the new code correctly defaults to false. Tests assert all three AC scenarios.
    • Test efficacy: High — tests directly verify addSequantToMcpConfig call/no-call behavior for each mode. The interactive test verifies the MCP prompt is triggered.
    • Likely failure mode: If skipPrompts logic changes upstream (e.g., new flags that set it), the MCP guard would need updating. Low risk — the condition is simple and well-tested.
    • Verdict confidence: High — small, focused change with complete test coverage and passing CI.

    Verdict: READY_FOR_MERGE

    All 3 acceptance criteria are met. The implementation is clean, minimal (+117/-5 across 5 files), and well-tested with 4 new test cases. CI passes across all 5 checks. No issues found in code review, security scan, or anti-pattern detection.

    Documentation

    Next Steps

    1. Consider rebasing on main (2 commits behind, not blocking)
    2. Merge PR fix(#392): sequant init --yes should not auto-add MCP to all clients #410
  10. added 3 commits that reference this issue on Mar 24, 2026
  11. admarble commented on Mar 24, 2026

    @admarble
    ContributorAuthor

    Documentation Updated

    File: docs/features/mcp-server.md (existing doc updated in PR #410)

    Changes Included:

    • Added "Non-interactive mode" subsection under "Automatic setup"
    • Documents --yes skipping MCP config and --yes --mcp opt-in
    • Shows the skip message users will see
    • CHANGELOG entry added under [Unreleased] > Fixed

    Status:

    ✅ Documentation was included in the implementation PR — no additional documentation needed.


    Ready to merge! (Already merged as PR #410)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugmulti-agentready-for-review

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions