You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(#7): post-login MCP hints and butter mcp install
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.
The ButterStack MCP server (`npx -y butterstack-mcp`) uses the credential `butter auth login` stores, so log in first. Then write the MCP entry into your AI client's config:
With no client flag, every installed client is configured. A client flag limits the install to that client and creates its config file if it does not exist yet. Each client gets the entry in its own schema, which matters because they differ: a Claude-style entry in an OpenCode config stops OpenCode from starting.
|`--claude`| Claude Desktop | macOS `~/Library/Application Support/Claude/claude_desktop_config.json`, Windows `%APPDATA%\Claude\claude_desktop_config.json`, Linux `~/.config/Claude/claude_desktop_config.json`|`mcpServers.butterstack` with `command: "npx"`, `args: ["-y", "butterstack-mcp"]`|
97
+
|`--cursor`| Cursor |`~/.cursor/mcp.json`| same as Claude Desktop |
98
+
99
+
Re-running is safe. Only the `butterstack` entry is ever written; every other key and server is left as it was, and an entry that is already correct is not rewritten. A config file that contains comments is never rewritten, because that would delete the comments; the command prints the entry to paste and the file to paste it into instead. `--dry-run` shows what would change without writing anything.
100
+
101
+
Claude Code registers MCP servers itself:
102
+
103
+
```
104
+
claude mcp add butterstack -- npx -y butterstack-mcp
105
+
```
106
+
107
+
See the [MCP guide](https://butterstack.com/docs/guides/mcp) for other clients.
Copy file name to clipboardExpand all lines: bin/butter
+304-2Lines changed: 304 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -356,6 +356,7 @@ async function authLogin(args) {
356
356
if(exchange.expires_at){
357
357
console.log(`${colors.muted}Token expires ${newDate(exchange.expires_at).toLocaleDateString()} -- run ${colors.bold}butter auth login${colors.reset}${colors.muted} again after that to renew.${colors.reset}`);
358
358
}
359
+
if(!args.json)printMcpHint();
359
360
console.log("");
360
361
process.exit(0);
361
362
}catch(err){
@@ -862,6 +863,293 @@ async function assetsDeny(args) {
console.log(`\nRestart ${written.join(", ")} to load the ButterStack MCP server.`);
1116
+
}
1117
+
if(!loadCredentials()){
1118
+
console.log(
1119
+
`${colors.muted}The MCP server uses your CLI login. Run ${colors.bold}butter auth login${colors.reset}${colors.muted} if you have not yet.${colors.reset}`
0 commit comments