Skip to content

feat(cli): MCP setup diagnostics + adf tidy routing improvements#208

Merged
stackbilt-admin merged 2 commits into
mainfrom
feat/mcp-setup-and-tidy-routing
Jun 11, 2026
Merged

feat(cli): MCP setup diagnostics + adf tidy routing improvements#208
stackbilt-admin merged 2 commits into
mainfrom
feat/mcp-setup-and-tidy-routing

Conversation

@stackbilt-admin

Copy link
Copy Markdown
Member

Summary

  • charter hook print --mcp-config [--client claude|codex|cursor] — emits the mcpServers JSON snippet for wiring charter serve into Claude Code, Codex, or Cursor. Defaults to --client claude. Supports --ai-dir pass-through for non-default .ai dir locations.
  • charter doctor --mcp — focused check: scans .claude/settings.json, .claude/settings.local.json, .mcp.json, and .cursor/mcp.json for a mcpServers.charter entry. Reports PASS or a WARN with the hook print hint.
  • adf tidy --dry-run routing plan — text output now shows per-item routing (target module + section) so users can review before applying.
  • Retained section headingsSession Start, Session Protocol, Session Setup are no longer treated as bloat (joins Environment and Module Index).
  • Code-block preservationadf tidy now keeps full code-block content with fencing instead of collapsing to a one-liner.

Test plan

  • charter hook print --mcp-config → outputs mcpServers.charter JSON with command: charter, args: [serve]
  • charter hook print --mcp-config --client cursor → same JSON, hint says .mcp.json
  • charter hook print --mcp-config --ai-dir custom/aiargs: [serve, --ai-dir, custom/ai]
  • charter doctor --mcp → PASS if mcpServers.charter found, WARN + hint if not
  • charter adf tidy --dry-run → routing plan visible in text output
  • All 643 tests pass

Closes #191, #198

🤖 Generated with Claude Code

Kurt Overmier and others added 2 commits June 11, 2026 17:39
…#198)

- `charter hook print --mcp-config [--client claude|codex|cursor]` emits the
  mcpServers JSON snippet for wiring charter serve into any supported AI client
- `charter doctor --mcp` detects MCP client config files and verifies charter
  is wired under mcpServers; surfaces actionable hint when not found
- `charter adf tidy --dry-run` now shows per-item routing plan (target module
  + section) in text output so users can review before applying
- `adf tidy` retains Session Start / Session Protocol / Session Setup headings
  alongside Environment and Module Index (not treated as bloat)
- `adf tidy` preserves full code-block content with fencing instead of
  collapsing to a single-line description

Closes #191, #198

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Remove dead branch in buildMcpConfigSnippet (both arms were identical);
  inline the snippet construction directly in printMcpConfig
- Fix --client flag parsing: guard indexOf result before indexing so
  a missing --client flag never reads args[0] as the client value
- Fix dry-run routing plan truncation: split on newline before slicing
  so multi-line items (fenced code blocks) don't embed raw newlines
- Add unit tests for all hook print --mcp-config paths (5 cases)
- Add integration tests for charter doctor --mcp (5 cases: no files,
  missing entry, wired, invalid JSON, partial wiring)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@stackbilt-admin stackbilt-admin merged commit 3b9fad3 into main Jun 11, 2026
4 checks passed
@stackbilt-admin stackbilt-admin deleted the feat/mcp-setup-and-tidy-routing branch June 11, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve MCP client setup and charter serve diagnostics

1 participant