feat: post-login MCP hints and butter mcp install (#7) - #9
Merged
Merged
Conversation
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
force-pushed
the
feat/7-mcp-install
branch
from
September 23, 2026 15:58
dd76467 to
46b94bb
Compare
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.
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 thebutterstackMCP entry into each detected client's config in that client's own schema. Idempotent: only thebutterstackentry 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 mcp addcommand.mcp.jsonyet is still picked up. No client found exits 1 and suggests the flags.%APPDATA%and are coded but untested.README documents the command. 9 new tests, all under a temp HOME.