@lyellr88/buddy-mcp 1.3.2 → 1.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +289 -225
- package/assets/buddy_cli_builder.mp4 +0 -0
- package/assets/buddy_reroll_action.mp4 +0 -0
- package/assets/buddy_tools_action.mp4 +0 -0
- package/assets/hero.svg +172 -0
- package/dist/mcp/index.js +51 -3
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/persistence.d.ts.map +1 -1
- package/dist/mcp/persistence.js +26 -4
- package/dist/mcp/persistence.js.map +1 -1
- package/dist/mcp/tools/core.js +17 -6
- package/dist/mcp/tools/core.js.map +1 -1
- package/dist/mcp/tools/export.js +45 -12
- package/dist/mcp/tools/export.js.map +1 -1
- package/dist/mcp/tools/interact.js +7 -5
- package/dist/mcp/tools/interact.js.map +1 -1
- package/dist/mcp/tools/relay.d.ts.map +1 -1
- package/dist/mcp/tools/relay.js +19 -0
- package/dist/mcp/tools/relay.js.map +1 -1
- package/dist/mcp/watcher.js +25 -4
- package/dist/mcp/watcher.js.map +1 -1
- package/dist/personalities.d.ts +0 -2
- package/dist/personalities.d.ts.map +1 -1
- package/dist/personalities.js +0 -117
- package/dist/personalities.js.map +1 -1
- package/dist/tui/apply/index.js +6 -7
- package/dist/tui/apply/index.js.map +1 -1
- package/dist/tui/builder/index.js +1 -1
- package/dist/tui/commands/interactive.js +2 -4
- package/dist/tui/commands/interactive.js.map +1 -1
- package/dist/tui/commands/share.js +1 -1
- package/dist/tui/commands/share.js.map +1 -1
- package/dist/tui/display.js +1 -1
- package/dist/tui/gallery/index.js +1 -1
- package/dist/tui/presets/index.js +1 -1
- package/dist/tui/start/index.d.ts.map +1 -1
- package/dist/tui/start/index.js +11 -8
- package/dist/tui/start/index.js.map +1 -1
- package/package.json +84 -84
package/README.md
CHANGED
|
@@ -1,226 +1,290 @@
|
|
|
1
|
-
# buddy-mcp
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
|
132
|
-
|
|
133
|
-
| `
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
```
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
buddy-mcp
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
1
|
+
# buddy-mcp
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@lyellr88/buddy-mcp)
|
|
6
|
+
[](https://github.com/Lyellr88/buddy-mcp/actions/workflows/ci.yml)
|
|
7
|
+
[](LICENSE)
|
|
8
|
+
[](https://nodejs.org/)
|
|
9
|
+
|
|
10
|
+
A break from long code sessions. Stuck on a bug? Reroll a buddy, talk with them, or pet them to build affection and improve your odds at higher-tier buddies on the next roll. If enough people want it, I'll build out Battle-Buddies where you can pit your buddy against others and unlock exclusive species that sync back into your local pool.
|
|
11
|
+
|
|
12
|
+
> A gacha companion system for Claude Code. Roll for a rare buddy, patch it directly into the binary, collect 'em all. Buddy-mcp is an MCP server that replaces Claude Code's built-in companion with one you actually rolled for. Reroll, get lucky, close Claude, reopen. Your new buddy is waiting. Legendary drop rates apply.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Quick Demo
|
|
17
|
+
|
|
18
|
+
<table>
|
|
19
|
+
<tr>
|
|
20
|
+
<td width="33%">
|
|
21
|
+
|
|
22
|
+
<details>
|
|
23
|
+
<summary><strong>Interactive Builder</strong></summary>
|
|
24
|
+
Build your perfect buddy with full control.
|
|
25
|
+
|
|
26
|
+
<video width="100%" controls>
|
|
27
|
+
<source src="assets/buddy_cli_builder.mp4" type="video/mp4">
|
|
28
|
+
Your browser does not support the video tag.
|
|
29
|
+
</video>
|
|
30
|
+
</details>
|
|
31
|
+
|
|
32
|
+
</td>
|
|
33
|
+
<td width="33%">
|
|
34
|
+
|
|
35
|
+
<details>
|
|
36
|
+
<summary><strong>Reroll in Action</strong></summary>
|
|
37
|
+
Roll, close Claude, reopen—new buddy live.
|
|
38
|
+
|
|
39
|
+
<video width="100%" controls>
|
|
40
|
+
<source src="assets/buddy_reroll_action.mp4" type="video/mp4">
|
|
41
|
+
Your browser does not support the video tag.
|
|
42
|
+
</video>
|
|
43
|
+
</details>
|
|
44
|
+
|
|
45
|
+
</td>
|
|
46
|
+
<td width="33%">
|
|
47
|
+
|
|
48
|
+
<details>
|
|
49
|
+
<summary><strong>Interact with Tools</strong></summary>
|
|
50
|
+
Talk, pet, and explore your buddy's dex.
|
|
51
|
+
|
|
52
|
+
<video width="100%" controls>
|
|
53
|
+
<source src="assets/buddy_tools_action.mp4" type="video/mp4">
|
|
54
|
+
Your browser does not support the video tag.
|
|
55
|
+
</video>
|
|
56
|
+
</details>
|
|
57
|
+
|
|
58
|
+
</td>
|
|
59
|
+
</tr>
|
|
60
|
+
</table>
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
## How It Works
|
|
65
|
+
|
|
66
|
+
Claude Code's companion is generated from a salt string baked into the binary. buddy-mcp:
|
|
67
|
+
|
|
68
|
+
1. Rolls random desired traits (species, rarity, eye, hat)
|
|
69
|
+
2. Brute-forces a salt that hashes to those traits (multi-worker, runs fast)
|
|
70
|
+
3. Patches the binary in place, or queues the patch for when you close Claude
|
|
71
|
+
4. Saves your full buddy profile with stats, name, and personality
|
|
72
|
+
5. Tracks every species you've ever rolled in your BuddyDex
|
|
73
|
+
|
|
74
|
+
No companion server. No cloud. Just you, your binary, and the gacha gods.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Developer Insight
|
|
79
|
+
|
|
80
|
+
buddy-mcp isn’t just a UI mod. It’s a deterministic companion system layered on top of Claude Code’s binary, with:
|
|
81
|
+
|
|
82
|
+
- Rerollable personalities and stat-bound behaviors
|
|
83
|
+
- Persistent state and BuddyDex tracking
|
|
84
|
+
- Locked tool sets per roll (no session drift)
|
|
85
|
+
- A self-healing patch pipeline that detects, restores, and reapplies across updates
|
|
86
|
+
|
|
87
|
+
Lightweight by design with minimal token usage and data footprint. Most features operate inline through message augmentation rather than separate invocation flows.
|
|
88
|
+
|
|
89
|
+
Built to be fast, local-first, and resilient to change.
|
|
90
|
+
|
|
91
|
+
## Patch Flow
|
|
92
|
+
|
|
93
|
+
buddy-mcp patches the Claude binary directly. Here's what happens when you hit `reroll_buddy`:
|
|
94
|
+
|
|
95
|
+
```
|
|
96
|
+
reroll_buddy
|
|
97
|
+
│
|
|
98
|
+
├─ Roll random traits (species, rarity, eye, hat, shiny chance)
|
|
99
|
+
│
|
|
100
|
+
├─ Multi-worker salt search (up to 8 parallel Bun workers)
|
|
101
|
+
│ └─ Each worker brute-forces salts using wyhash until traits match
|
|
102
|
+
│
|
|
103
|
+
├─ Try to patch binary immediately
|
|
104
|
+
│ ├─ Success → "Close Claude and reopen"
|
|
105
|
+
│ └─ EPERM (Claude is running) → Save pending patch + start background watcher
|
|
106
|
+
│ └─ Watcher polls every 2s, applies patch the moment Claude closes
|
|
107
|
+
│
|
|
108
|
+
└─ Profile saved: species, rarity, stats, name, personality
|
|
109
|
+
|
|
110
|
+
On next session start (hook fires):
|
|
111
|
+
│
|
|
112
|
+
├─ Salt still valid → no-op (fast path)
|
|
113
|
+
│
|
|
114
|
+
├─ Pending patch found → apply it
|
|
115
|
+
│
|
|
116
|
+
└─ Salt mismatch (Claude auto-updated)
|
|
117
|
+
├─ Try .buddy-mcp-bak (only if it contains original salt)
|
|
118
|
+
├─ Try .anybuddy-bak (fallback for prior patcher users)
|
|
119
|
+
└─ Restore + re-patch automatically, no reinstall required
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
## TUI Builder (`buddy-mcp-build`)
|
|
124
|
+
|
|
125
|
+
Want more control? Use the interactive builder:
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
node dist/tui/cli.js
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
| Command | What it does |
|
|
132
|
+
|---------|-------------|
|
|
133
|
+
| `build your own` | Pick species, rarity, eye, hat and it brute-forces a matching salt and patches |
|
|
134
|
+
| `browse presets` | Pick from curated preset buddies |
|
|
135
|
+
| `saved buddies` | Switch between previously saved buddy profiles |
|
|
136
|
+
| `current` | Display current buddy info |
|
|
137
|
+
| `preview` | Preview ASCII art for any species |
|
|
138
|
+
| `share` | Copy your buddy's ASCII card to clipboard |
|
|
139
|
+
| `restore` | Restore binary from the best available backup |
|
|
140
|
+
| `rehatch` | Delete current buddy and start fresh |
|
|
141
|
+
|
|
142
|
+
> Bun optional but recommended. Install [bun.sh](https://bun.sh) for the full animated TUI. Falls back to sequential prompts without it.
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## Quick Start
|
|
147
|
+
|
|
148
|
+
> **Try me:** run `reroll_buddy` → close Claude Code → reopen → your new buddy is live.
|
|
149
|
+
|
|
150
|
+
### 1. Prerequisites
|
|
151
|
+
|
|
152
|
+
- [Claude Code CLI](https://claude.ai/download) installed
|
|
153
|
+
- [Node.js](https://nodejs.org/) v20+ - required for everything
|
|
154
|
+
- [Bun](https://bun.sh/) - required for salt brute-forcing (rerolling) + full animated TUI
|
|
155
|
+
|
|
156
|
+
### 2. Install via npm
|
|
157
|
+
|
|
158
|
+
```bash
|
|
159
|
+
npm install -g buddy-mcp
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
This installs both commands globally:
|
|
163
|
+
- `buddy-mcp` - the MCP server (Claude Code runs this)
|
|
164
|
+
- `buddy-mcp-build` - the interactive TUI builder (you run this)
|
|
165
|
+
|
|
166
|
+
### 3. Register with Claude
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
claude mcp add buddy-mcp buddy-mcp
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
Claude will auto-detect the installed binary and connect it.
|
|
173
|
+
|
|
174
|
+
### 4. Verify
|
|
175
|
+
|
|
176
|
+
Open Claude Code. Your buddy is live—use Claude Code's native `/buddy` command to see your card, or ask Claude: **"show me my buddy"**
|
|
177
|
+
|
|
178
|
+
You should see your companion's species, rarity, stats, and personality. You're in.
|
|
179
|
+
|
|
180
|
+
### 4b. Natural Language Activation
|
|
181
|
+
|
|
182
|
+
All buddy tools work through natural language. Claude's NLP detects intent automatically:
|
|
183
|
+
|
|
184
|
+
| Natural Language | Activates |
|
|
185
|
+
|------------------|-----------|
|
|
186
|
+
| "reroll buddy" / "let's roll again" | `reroll_buddy` |
|
|
187
|
+
| "talk to my buddy" / "what does buddy think" | `buddy_talk` |
|
|
188
|
+
| "pet buddy" / "pet them" | `pet_buddy` |
|
|
189
|
+
| "my buddy dex" / "show me my collection" | `view_buddy_dex` |
|
|
190
|
+
| "export buddy card" / "save my buddy" | `export_buddy_card` |
|
|
191
|
+
| "export sprite" / "save the sprite" | `export_buddy_sprite` |
|
|
192
|
+
|
|
193
|
+
No tool names required — just chat naturally.
|
|
194
|
+
|
|
195
|
+
### 5. Launch the TUI Builder (optional)
|
|
196
|
+
|
|
197
|
+
For the full interactive builder with live preview:
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
buddy-mcp-build
|
|
201
|
+
```
|
|
202
|
+
|
|
203
|
+
Auto-detects Bun for animated TUI. Falls back to basic prompts without it.
|
|
204
|
+
|
|
205
|
+
---
|
|
206
|
+
|
|
207
|
+
## The Gacha System
|
|
208
|
+
|
|
209
|
+
Every reroll is a random pull from the pool. Rarity affects stat floors. Legendaries hit different.
|
|
210
|
+
|
|
211
|
+
| Rarity | Drop Rate | Stat Floor |
|
|
212
|
+
|-----------|-----------|------------|
|
|
213
|
+
| Common | 60% | 5 |
|
|
214
|
+
| Uncommon | 25% | 15 |
|
|
215
|
+
| Rare | 10% | 25 |
|
|
216
|
+
| Epic | 4% | 35 |
|
|
217
|
+
| Legendary | 1% | 50 |
|
|
218
|
+
|
|
219
|
+
**18 species:** duck · goose · blob · cat · dragon · octopus · owl · penguin · turtle · snail · ghost · axolotl · capybara · cactus · robot · rabbit · mushroom · chonk
|
|
220
|
+
|
|
221
|
+
Each buddy has 5 stats: **Debugging, Patience, Chaos, Wisdom, Snark**. A peak stat is boosted high and a dump stat is kept humble. Personality shapes how `buddy_talk` and `pet_buddy` respond. A high-Chaos dragon hits different than a patient turtle.
|
|
222
|
+
|
|
223
|
+
---
|
|
224
|
+
|
|
225
|
+
| Tool | What it does |
|
|
226
|
+
|------|-------------|
|
|
227
|
+
| `reroll_buddy` | 🎲 Spin the wheel. Brute-forces a salt matching a random rare+ outcome and patches your binary. Close Claude and reopen to see it. |
|
|
228
|
+
| `pet_buddy` | 🤚 Poke your buddy. Each pet adds 1-15% toward earning an affection token. At 100%, earn 1 token that stacks and persists across sessions. Spend a token on next `reroll_buddy` to guarantee rare+ rarity + 60% hat chance + 20% shiny chance. |
|
|
229
|
+
| `buddy_talk` | 💬 Ask your buddy to say something. Uses stat-based response templates weighted by top 2 stats. Optional context parameter for focused stat selection. Output shown verbatim. |
|
|
230
|
+
| `view_buddy_dex` | 📖 Browse every species you've ever rolled. Gotta catch 'em all. |
|
|
231
|
+
| `export_buddy_card` | 🖼️ Export your full buddy card as an SVG image file. |
|
|
232
|
+
| `export_buddy_sprite` | 🎨 Export just the buddy ASCII sprite as an SVG image file. |
|
|
233
|
+
| `deactivate_buddy_interact` | 🔕 Turn off buddy observation mode. Your buddy stops watching. (Buddy observation is always on by default.) |
|
|
234
|
+
|
|
235
|
+
### Stat Personality Tools
|
|
236
|
+
|
|
237
|
+
**20 baked-in tools.** Only **2 are visible** at a time: 1 randomly picked from each of your buddy's **top 2 stats by raw value**. The other 18 stay hidden. The visible pair is **locked per roll**. It doesn't change until you reroll. Every buddy shows a different pair.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
```
|
|
243
|
+
|
|
244
|
+
|
|
245
|
+
---
|
|
246
|
+
|
|
247
|
+
## State Files
|
|
248
|
+
|
|
249
|
+
buddy-mcp stores everything in your home directory:
|
|
250
|
+
|
|
251
|
+
| File | Purpose |
|
|
252
|
+
|------|---------|
|
|
253
|
+
| `~/.buddy-mcp.json` | Your buddy profiles (species, rarity, stats, name, salt) |
|
|
254
|
+
| `~/.buddy_mcp_gacha.json` | Gacha extras: shiny count, BuddyDex, manifested tools |
|
|
255
|
+
| `~/.buddy_mcp_pending.json` | Queued patch waiting for Claude to close |
|
|
256
|
+
|
|
257
|
+
---
|
|
258
|
+
|
|
259
|
+
## Troubleshooting
|
|
260
|
+
|
|
261
|
+
### Buddy doesn't change after reroll
|
|
262
|
+
|
|
263
|
+
If you rerolled but your buddy didn't update on restart:
|
|
264
|
+
|
|
265
|
+
1. **Close all Claude Code instances completely** (check Task Manager on Windows)
|
|
266
|
+
- Even minimized or backgrounded windows count — they keep the binary locked
|
|
267
|
+
- Wait a few seconds for processes to fully exit
|
|
268
|
+
2. **Reopen Claude Code**
|
|
269
|
+
- The pending patch will apply automatically via the hook
|
|
270
|
+
- Or manually run `npm run apply` then reopen
|
|
271
|
+
|
|
272
|
+
The binary stays locked as long as any Claude instance is running, preventing the patch from being applied.
|
|
273
|
+
|
|
274
|
+
### Manual Apply (Fallback)
|
|
275
|
+
|
|
276
|
+
If the background watcher didn't fire for some reason, you can apply a pending patch manually:
|
|
277
|
+
|
|
278
|
+
```bash
|
|
279
|
+
npm run apply
|
|
280
|
+
```
|
|
281
|
+
|
|
282
|
+
Then restart Claude Code.
|
|
283
|
+
|
|
284
|
+
---
|
|
285
|
+
|
|
286
|
+
## Credits
|
|
287
|
+
|
|
288
|
+
Forked and extended from [any-buddy](https://github.com/cpaczek/any-buddy) by cpaczek.
|
|
289
|
+
|
|
226
290
|
Licensed under [WTFPL](http://www.wtfpl.net/).
|
|
Binary file
|
|
Binary file
|
|
Binary file
|