Skip to content

feat: post-login MCP hints and butter mcp install (#7) - #9

Merged
ryanlitalien merged 1 commit into
mainfrom
feat/7-mcp-install
Sep 23, 2026
Merged

ryanlitalien merged 1 commit into
mainfrom
feat/7-mcp-install

Conversation

@ryanlitalien

Copy link
Copy Markdown
Member

Closes #7. Both steps.

Post-login hints. After a successful butter auth login, print a short block with the Claude Code and OpenCode commands, butter mcp install, and the docs link. Suppressed under --json.

butter mcp install [--opencode] [--claude] [--cursor] [--dry-run]. Writes the butterstack MCP entry into each detected client's config in that client's own schema. Idempotent: only the butterstack entry is ever touched, an already-correct entry is left alone, and a second run leaves the file byte-for-byte unchanged. Config files that contain comments are never rewritten (that would drop the comments); the command prints the entry and the path to paste it into instead. Unparseable or wrong-typed configs are reported and skipped without being modified.

Still zero dependencies: a small JSONC reader (comments and trailing commas outside strings, BOM) lives in bin/butter.

Decisions on the issue's open questions:

  • Claude Code is not auto-registered; it gets the printed claude mcp add command.
  • Client detection with no flag keys off the config directory existing, so a fresh Cursor install with no mcp.json yet is still picked up. No client found exits 1 and suggests the flags.
  • Windows paths for Claude Desktop use %APPDATA% and are coded but untested.

README documents the command. 9 new tests, all under a temp HOME.

After a successful `butter auth login`, print how to connect an AI
client to the ButterStack MCP server (Claude Code, OpenCode, the new
auto-configurator, and the docs link). The block is skipped under
--json.

Add `butter mcp install [--opencode] [--claude] [--cursor] [--dry-run]`,
which writes the `butterstack` entry into each client's config in that
client's own schema. With no flag it configures every client whose
config directory exists; a flag limits the install to that client and
creates its file if missing. Only the `butterstack` key is written, an
already-correct entry is left alone, and a stale one is replaced with
the old value printed.

OpenCode configs are JSONC, so a small string-aware parser strips
comments and trailing commas before JSON.parse. A file that contains
comments is never rewritten: the command prints the entry to paste and
the file path instead. `butter mcp` alone prints the MCP help.
@ryanlitalien
ryanlitalien merged commit fe8c129 into main Sep 23, 2026
1 check passed
@ryanlitalien
ryanlitalien deleted the feat/7-mcp-install branch September 23, 2026 15:58
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.

Add post-login MCP hints and a 'butter mcp install' auto-configurator (OpenCode, Claude, Cursor)

1 participant