feat: presets + installer + CLI subcommands#1
Merged
marceloceccon merged 3 commits intomainfrom Apr 30, 2026
Merged
Conversation
Adds five task-tuned preset MCP tools, a host-detecting installer
subcommand for Claude Code / Cursor / Windsurf, and an MCP-registry
manifest. Backward compatible — the existing `consensus` tool's input,
output, progress contract and config schema are unchanged, and a bare
`ai-consensus-mcp --config X` invocation still routes to `serve` exactly
as in 0.10.
Highlights:
• src/presets/* — Preset/PresetPanelEntry/PresetDefaults types,
registry+merge, panel resolution with fallbacks, JSON-schema +
zod input parser, judge-first markdown formatter, and the five
built-in definitions (code_review, architecture_debate,
research_synthesis, decision_making, debug_postmortem).
• src/server.ts — registers `consensus` + 5 preset tools; dispatches
by name; runnability check surfaces missing personas in the tool
description and tool-call error.
• src/cli/* — main dispatcher with `serve` (default, backward compat)
and `install` subcommands. SERVER_NAME/SERVER_VERSION moved into
src/version.ts as a single source of truth.
• src/installer/* — atomic merge into mcpServers without clobbering
siblings. Detection by config-path + parent-dir + extra-dir
heuristics. fakeHome support for tests.
• Foundations — ESLint + Prettier (flat config), vitest 4.1.5
(clears 6 moderate audit findings), coverage thresholds, smoke
test, npm run check aggregator.
• README "Install in 30 seconds" + per-preset table.
docs/install.md long-form reference. server.json registry manifest.
Tests: 24 → 120 (+96 new). Coverage 65.1% global / 90+% on src/presets.
Smoke: 6 tools advertised end-to-end.
Tool-calling integration ships in a follow-up release that bumps
ai-consensus-core to ^0.11.0 once entropyvortex/ai-consensus-core#3
merges and publishes. See CHANGELOG.md for the full breakdown and the
deferred follow-up list.
The previous commits to these files bypassed the prettier write step; CI was rejecting them on prettier --check. No content changes — just line-wrap and trailing-newline normalisation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Consumer-side half of the v0.11 work. Adds five task-tuned preset MCP tools, a host-detecting
installsubcommand for the top three IDE/host environments (Claude Code, Cursor, Windsurf), and an MCP-registry manifest. Backward compatible end-to-end: existing 0.10 host configs and the genericconsensustool are byte-identical to before, and a bareai-consensus-mcp --config Xstill works exactly as it did.The matching tool-calling integration is deferred until
ai-consensus-core@0.11.0merges and publishes — see Phase 3 inprogress.md. This PR covers Phases 0/1/4; Phase 2 lives upstream; Phase 3 unblocks once the core ships.What ships in this PR
Five preset MCP tools
Each preset is registered as its own tool so MCP hosts surface them in autocomplete:
consensus_code_reviewconsensus_architecture_debateconsensus_research_synthesisconsensus_decision_makingconsensus_debug_postmortemImplementation:
src/presets/{types,registry,resolve-panel,build-input-schema,format}.tsplussrc/presets/definitions/*.ts. Panel resolution is non-destructive — preset task suffixes are appended to fresh persona objects, never mutating the globalPERSONAStable. Fallback chains and a used-persona guard prevent double-binding. Snapshot tests lock the resolved system prompts (6 inline snapshots).Preset tools deliberately do not expose
participantIds— the panel is the preset's responsibility. If your config can't satisfy a preset's required personas, the tool description prefixes⚠ Currently NOT RUNNABLEand the tool-call error names the missing personas.Installer subcommand
Detects Claude Code / Cursor / Windsurf and registers an entry in each one's
mcpServersmap. Atomic write (write-to-tmp, rename), never clobbers siblings (Claude Code's.claude.jsonholds far more thanmcpServers), idempotent (re-runs reportalreadyPresent), refuses to overwrite a different existing entry without--force. Tested withmkdtemp-rooted fake\$HOMEdirectories so CI runs without touching the real home.Flags:
--hosts,--name,--command,--force,--list-hosts,--help. The bareai-consensus-mcp --config Xinvocation still routes toserve(full backward compat with 0.10).Foundations
npm run lint,npm run format:check,npm run checkvitest.config.tswith asrc/presets/**gate at 90/75/95/90scripts/smoke-stdio.mjs— handshake smoke test (no API keys needed)npm install→npm run check→npm run build→npm run test:smokeRegistry manifest
server.jsonat repo root, schema-keyed tohttps://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json. Once published, submit toregistry.modelcontextprotocol.ioso universal installers likenpx add-mcp ai-consensus-mcppick it up.Docs
docs/install.md— long-form install reference (per-host details, Cursor deeplink format, manual fallback)CHANGELOG.mdinitialisedTest plan
npm run check(typecheck + lint + format:check + test:coverage): 120/120 tests pass; coverage 65.1% global, 96.6% on src/presets/, 85%+ on src/installer/npm run build&&npm run test:smoke— 6 tools advertised end-to-endnode dist/index.js install --list-hostsreports detection correctlynode dist/index.js install --helpshows the install helpnode dist/index.js --versionreturns 0.10.0node dist/index.js --config <path>(no subcommand) still routes to serveWhy this is shaped this way
consensus. Presets need to be discoverable in host autocomplete; a singleconsensustool with apresetparameter would be invisible. Genericconsensusstays for power users.panel,defaults,judgeSystemPrompt, etc. Snapshot tests lock the resolved prompts so a careless edit can't silently change behaviour.{providers, providerByParticipant}per-call instead of closing over the full LoadedConfig.mcpServers. Atomic write + per-key merge protects user state.serveis the implicit default;--config X(no subcommand, leading flag) still routes toserveso existing host configs work without edits.Deferred (planned for next minors)
ai-consensus-core@0.11.0publishing (see feat: add tool-calling primitives (0.11.0) ai-consensus-core#3). Will addtools.upstreamServersconfig, MCP composition, executor + redaction, updated presets that bind tools.docs/install.htmlfor GitHub Pages with a Cursor one-click button.--verifyflag to run a smoke test post-install.--init-configflag to bootstrap a starter config.mergePresetsinfrastructure in place; no consumer asking yet).Version policy
package.json.versionis left at 0.10.0 in this PR — happy to bump on the same branch, or leave it for the release commit so 0.11.0 lines up with the upstream tool-calling release. Open question for you to call.