@hmanlab/mmx-claude 0.4.3 → 0.4.5

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.
Files changed (2) hide show
  1. package/README.md +37 -255
  2. package/package.json +3 -2
package/README.md CHANGED
@@ -1,282 +1,64 @@
1
- # `@hl-plugins/mmx-claude`
1
+ # @hmanlab/mmx-claude
2
2
 
3
3
  Claude Code adapter for the seven MiniMax multimodal tools. Pairs with
4
- [`@hl-plugins/mmx`](../plugin-mmx/README.md) (the OpenCode plugin) — same
4
+ [`@hmanlab/mmx`](../plugin-mmx/README.md) (the OpenCode plugin) — same
5
5
  `mmx-cli` binary, same auth, two install records.
6
6
 
7
- > Status: **Plan v1** — implementation below is tracked phase by phase. Update
8
- > the checkboxes as each item lands. Once all boxes in a phase are checked,
9
- > that phase is done and the next one can start.
10
-
11
- ## What this package is
12
-
13
- A new sibling of `@hl-plugins/mmx` that ships the same seven tools to
14
- **Claude Code** instead of OpenCode, by exposing them through a **Model
15
- Context Protocol (MCP) server** that Claude Code launches at startup.
16
-
17
- | Runtime | Package | Transport |
18
- |---|---|---|
19
- | OpenCode | `@hl-plugins/mmx` | `tool()` from `@opencode-ai/plugin`, runs as `.ts` |
20
- | Claude Code | `@hl-plugins/mmx-claude` *(this package)* | MCP server, bundled `.js` |
21
-
22
- The two packages share `mmx-cli` state and the MiniMax API key — only the
23
- delivery mechanism differs.
24
-
25
- ## Phase index
26
-
27
- - [Phase A — CLI contract + paths](#phase-a--cli-contract--paths)
28
- - [Phase B — New package + MCP server](#phase-b--new-package--mcp-server)
29
- - [Phase C — Install / uninstall / status + docs](#phase-c--install--uninstall--status--docs)
30
-
31
- Each phase is independently shippable and demoable. Stopping after any
32
- phase leaves the tree green; only the matching acceptance criteria need to
33
- hold at that point.
34
-
35
- ---
36
-
37
- ## Phase A — CLI contract + paths
38
-
39
- **Scope.** Extend the `hl-plugins` manifest type with the two new Claude
40
- fields, add the Claude-side path helpers, ship zero install behavior yet.
41
- Every later phase depends on these types and helpers.
42
-
43
- ### Acceptance criteria
44
-
45
- - [ ] `packages/cli/src/lib/registry.ts` exports `claudeMcp?: string` and
46
- `claudeSkill?: string` on `PluginManifest.hlPlugins`
47
- - [ ] `packages/cli/src/lib/paths.ts` exports:
48
- - [ ] `claudeConfigDir()` — returns the Claude Code config directory
49
- per platform (`~/.claude/` on macOS/Linux, `%APPDATA%\Claude\`
50
- on Windows)
51
- - [ ] `claudeConfigFile()` — returns the path to `~/.claude.json`
52
- - [ ] `hlPluginsDataDir()` — returns `~/.local/share/hl-plugins/`
53
- (XDG-style; platform-correct on Windows)
54
- - [ ] Existing `hl-plugins list` still works and shows the existing
55
- `mmx` plugin unchanged
56
- - [ ] `npm run typecheck` passes
57
- - [ ] New unit tests under `packages/cli/test/lib/paths.test.ts` cover
58
- `claudeConfigDir`, `claudeConfigFile`, `hlPluginsDataDir` for
59
- macOS / Linux / Windows path conventions
60
-
61
- ### Files touched
62
-
63
- ```
64
- M packages/cli/src/lib/registry.ts
65
- M packages/cli/src/lib/paths.ts
66
- A packages/cli/test/lib/paths.test.ts
67
- ```
68
-
69
- ### Demo
7
+ ## Install
70
8
 
71
9
  ```bash
72
- npm run typecheck
73
- node packages/cli/bin/hl-plugins.js list
74
- # expected: shows @hl-plugins/mmx, no mmx-claude yet
10
+ npx -y @hmanlab/hl-plugins install mmx-claude
75
11
  ```
76
12
 
77
- ---
78
-
79
- ## Phase B — New package + MCP server
80
-
81
- **Scope.** Create `packages/plugin-mmx-claude/` from scratch. The MCP server
82
- source registers the seven mmx tools backed by `src/lib.ts`'s `runMmx`. The
83
- package's `package.json` declares the full `hl-plugins` contract. A
84
- `bun build` script bundles the server into `dist/mmx-mcp-server.js`.
85
-
86
- ### Acceptance criteria
87
-
88
- #### Package scaffolding
89
-
90
- - [ ] `packages/plugin-mmx-claude/package.json` exists with `private: true`,
91
- name `@hl-plugins/mmx-claude`, and a full `hl-plugins` contract:
92
- - [ ] `opencodePlugin` / `opencodeSkill` omitted (not an OpenCode plugin)
93
- - [ ] `claudeMcp: "./dist/mmx-mcp-server.js"`
94
- - [ ] `claudeSkill: "./claude/skill/mmx/SKILL.md"`
95
- - [ ] `requires` includes `mmx-cli` and `bun`
96
- - [ ] `auth` block carried over from `@hl-plugins/mmx`
97
- - [ ] `packages/plugin-mmx-claude/tsconfig.json` extends the base config
98
- - [ ] `packages/plugin-mmx-claude/bunfig.toml` is present
99
- - [ ] Workspace `package.json` lists the new package under `workspaces`
100
-
101
- #### Source files
102
-
103
- - [ ] `src/lib.ts` exports `runMmx`, `resolveOutDir`, and the
104
- suspicious-path detector (~50 lines, `Bun.spawn`)
105
- - [ ] `claude/mcp/mmx-mcp-server.ts` registers the seven tools via the
106
- `@modelcontextprotocol/sdk` Server class:
107
- - [ ] `mmx_image`
108
- - [ ] `mmx_speech`
109
- - [ ] `mmx_video`
110
- - [ ] `mmx_music`
111
- - [ ] `mmx_search`
112
- - [ ] `mmx_vision`
113
- - [ ] `mmx_quota`
114
- - [ ] `claude/skill/mmx/SKILL.md` mirrors the OpenCode skill's content,
115
- edited for Claude Code context (no `@opencode-ai/plugin` references)
116
-
117
- #### Build
118
-
119
- - [ ] `bun run --filter @hl-plugins/mmx-claude build` produces
120
- `packages/plugin-mmx-claude/dist/mmx-mcp-server.js`
121
- - [ ] `dist/` is listed in `.gitignore`
122
- - [ ] `npm run typecheck` passes across the workspace
123
-
124
- #### Tests
125
-
126
- - [ ] `test/lib.test.ts` covers:
127
- - [ ] Suspicious-path rejection (HOME, ~/Desktop, /tmp, `.`, `..`)
128
- - [ ] `MMX_OUTPUT_DIR` env-var override wins over the default
129
- - [ ] Default `~/Desktop/mmx-output/` resolution
130
- - [ ] `test/mcp-smoke.test.ts` spawns the bundle over stdio, sends a
131
- JSON-RPC `tools/list` request, and asserts all seven tool names
132
- appear in the response
133
-
134
- ### Files touched
135
-
136
- ```
137
- A packages/plugin-mmx-claude/package.json
138
- A packages/plugin-mmx-claude/tsconfig.json
139
- A packages/plugin-mmx-claude/bunfig.toml
140
- A packages/plugin-mmx-claude/src/lib.ts
141
- A packages/plugin-mmx-claude/claude/mcp/mmx-mcp-server.ts
142
- A packages/plugin-mmx-claude/claude/skill/mmx/SKILL.md
143
- A packages/plugin-mmx-claude/test/lib.test.ts
144
- A packages/plugin-mmx-claude/test/mcp-smoke.test.ts
145
- M package.json # add @modelcontextprotocol/sdk devDep
146
- M packages/plugin-mmx-claude/.gitignore # OR root .gitignore (dist)
147
- ```
148
-
149
- ### Demo
13
+ Or install the CLI globally first:
150
14
 
151
15
  ```bash
152
- bun run --filter @hl-plugins/mmx-claude build
153
- node packages/plugin-mmx-claude/test/mcp-smoke.test.ts
154
- # expected: stdout lists mmx_image, mmx_speech, mmx_video, mmx_music,
155
- # mmx_search, mmx_vision, mmx_quota
16
+ npm install -g @hmanlab/hl-plugins
17
+ hl-plugins install mmx-claude
156
18
  ```
157
19
 
158
- ---
159
-
160
- ## Phase C — Install / uninstall / status + docs
20
+ ## What it does
161
21
 
162
- **Scope.** Wire the new contract fields into the install flow. Add
163
- `addMcpServer` / `removeMcpServer` helpers. Update status to report
164
- Claude-side state. Add the install hint for Claude Code systems. Update
165
- `README.md`, `docs/architecture.md`, and `docs/adding-a-plugin.md`.
166
-
167
- ### Acceptance criteria
168
-
169
- #### Helpers
22
+ Ships the same seven MiniMax tools to **Claude Code** via a **Model
23
+ Context Protocol (MCP) server** that Claude Code launches at startup.
170
24
 
171
- - [ ] `packages/cli/src/lib/config.ts` exports `addMcpServer(name, spec)`
172
- and `removeMcpServer(name)` — defensive `~/.claude.json` parsing
173
- with a clear error if the file is unrecognizable
174
- - [ ] `packages/cli/src/commands/install.ts` extended:
175
- - [ ] Copies the `claudeMcp` bundle to
176
- `~/.local/share/hl-plugins/<plugin>/<file>` and updates the
177
- bundle's on-disk path in the MCP spec before merging
178
- - [ ] Copies the `claudeSkill` markdown to
179
- `~/.claude/skills/<plugin>/SKILL.md`
180
- - [ ] Calls `addMcpServer` to merge the spec into `~/.claude.json`
181
- - [ ] All three steps are idempotent (same merge semantics as the
182
- OpenCode path)
183
- - [ ] `packages/cli/src/commands/uninstall.ts` extended:
184
- - [ ] Removes the bundle from `~/.local/share/hl-plugins/<plugin>/`
185
- - [ ] Removes the skill from `~/.claude/skills/<plugin>/`
186
- - [ ] Calls `removeMcpServer` to drop the entry from `~/.claude.json`
187
- - [ ] `packages/cli/src/commands/status.ts` extended to report all five
188
- Claude-side install points per plugin as present/missing
189
- - [ ] Install hint: when `hl-plugins install mmx` runs on a system with
190
- `~/.claude/` present but no `~/.opencode/`, prints a hint about
191
- `mmx-claude` and proceeds with the OpenCode install
25
+ | Runtime | Package | Transport |
26
+ |---|---|---|
27
+ | OpenCode | `@hmanlab/mmx` | `tool()` from `@opencode-ai/plugin`, runs as `.ts` |
28
+ | Claude Code | `@hmanlab/mmx-claude` *(this package)* | MCP server, bundled `.js` |
192
29
 
193
- #### Documentation
30
+ ## Tools provided
194
31
 
195
- - [ ] `README.md` — split the plugin table row into two
196
- (OpenCode + Claude Code), add a "Choosing the right package"
197
- one-liner
198
- - [ ] `docs/architecture.md` — document `claudeMcp` + `claudeSkill` in
199
- the contract section; extend the install-flow diagram with a
200
- Claude Code branch
201
- - [ ] `docs/adding-a-plugin.md` — note the four contract fields
202
- (`opencodePlugin`, `opencodeSkill`, `claudeMcp`, `claudeSkill`) and
203
- that a plugin can declare any subset; add a Claude Code example
32
+ - `mmx_image` — generate images
33
+ - `mmx_speech` text-to-speech
34
+ - `mmx_video` — generate videos
35
+ - `mmx_music` — generate music
36
+ - `mmx_search` web search
37
+ - `mmx_vision` — analyze images
38
+ - `mmx_quota` — check token plan usage
204
39
 
205
- #### End-to-end smoke
40
+ ## Requirements
206
41
 
207
- - [ ] `hl-plugins install mmx-claude` on a clean Claude Code system:
208
- - [ ] Auto-installs Bun if missing (via the `requires` entry)
209
- - [ ] Auto-installs `mmx-cli` if missing
210
- - [ ] Prompts for API key (or reads `MMX_API_KEY`)
211
- - [ ] Copies the MCP bundle to
212
- `~/.local/share/hl-plugins/mmx-claude/mmx-mcp-server.js`
213
- - [ ] Copies the skill MD to `~/.claude/skills/mmx-claude/SKILL.md`
214
- - [ ] Merges `mcpServers.mmx-claude` into `~/.claude.json`
215
- - [ ] Runs `mmx quota` as the post-install smoke test
216
- - [ ] `hl-plugins uninstall mmx-claude` reverses every step above
217
- - [ ] `hl-plugins status mmx-claude` reports all five install points
218
- - [ ] `hl-plugins install mmx` on a system with `~/.claude/` but no
219
- `~/.opencode/` prints the hint and proceeds
220
- - [ ] Re-running `hl-plugins install mmx-claude` is a no-op (idempotent)
221
- - [ ] `npm run typecheck` + `npm run build` both green
42
+ - [`mmx-cli`](https://github.com/MiniMax-AI/cli) installed automatically
43
+ - [`bun`](https://bun.sh) installed automatically if missing
44
+ - MiniMax API key — prompted during install (or set `MMX_API_KEY`)
222
45
 
223
- ### Files touched
46
+ ## How it works
224
47
 
225
- ```
226
- M packages/cli/src/lib/config.ts
227
- M packages/cli/src/commands/install.ts
228
- M packages/cli/src/commands/uninstall.ts
229
- M packages/cli/src/commands/status.ts
230
- M README.md
231
- M docs/architecture.md
232
- M docs/adding-a-plugin.md
233
- ```
48
+ 1. The install flow copies the pre-built MCP server bundle to
49
+ `~/.local/share/hl-plugins/mmx-claude/mmx-mcp-server.js`
50
+ 2. Copies the skill markdown to `~/.claude/skills/mmx-claude/SKILL.md`
51
+ 3. Merges `mcpServers.mmx-claude` into `~/.claude.json`
52
+ 4. Runs `mmx quota` as a post-install smoke test
234
53
 
235
- ### Demo
54
+ ## Uninstall
236
55
 
237
56
  ```bash
238
- node packages/cli/bin/hl-plugins.js install mmx-claude
239
- # expected: Bun auto-installs (if missing) -> mmx-cli auto-installs (if
240
- # missing) -> API key prompt -> bundle copied -> skill copied
241
- # -> ~/.claude.json merged -> mmx quota smoke test -> green
242
- # checkmarks per step
243
-
244
- node packages/cli/bin/hl-plugins.js status mmx-claude
245
- # expected: five green checks (bundle, skill, mcpServers entry,
246
- # auth present, mmx quota responds)
247
-
248
- node packages/cli/bin/hl-plugins.js uninstall mmx-claude
249
- # expected: every install step reversed, exit 0
57
+ hl-plugins uninstall mmx-claude
250
58
  ```
251
59
 
252
- ---
253
-
254
- ## Cross-phase checklist
255
-
256
- These items are not tied to one phase; they belong to the whole feature
257
- and should land before merge.
258
-
259
- - [ ] `packages/plugin-mmx` source is **untouched** — zero edits, the
260
- OpenCode plugin stays as-is
261
- - [ ] Both packages stay `private: true` until the install flow is
262
- battle-tested on real Claude Code installs
263
- - [ ] `~/Desktop/mmx-output/` is the default output directory in both
264
- packages; `MMX_OUTPUT_DIR` overrides it in both
265
- - [ ] Same suspicious-path rules apply in both packages (no writes to
266
- HOME, ~/Desktop, /tmp, or `.`)
267
- - [ ] No secrets committed; `MMX_API_KEY` is read from env, never echoed
268
- - [ ] All `.ts` strict-mode clean; `npm run typecheck` green across the
269
- workspace
270
- - [ ] No npm publish from the agent — the human maintainer runs
271
- `npm run publish:cli`
60
+ Reverses every install step. Does not remove `mmx-cli` or your API credentials.
272
61
 
273
- ## Out of scope (deferred)
62
+ ## License
274
63
 
275
- - Slash commands (`/mmx-image ...`) — could ship in a v2 alongside the
276
- MCP server for explicit user-driven invocation
277
- - Auto-update of the MCP bundle — `hl-plugins update` will need a
278
- Claude-side mirror; tracked separately
279
- - Cross-agent plugin state sync — the two agents share `mmx-cli` state,
280
- nothing else
281
- - Publishing either package to npm — both stay `private: true` until the
282
- install flow is battle-tested
64
+ MIT
package/package.json CHANGED
@@ -1,11 +1,12 @@
1
1
  {
2
2
  "name": "@hmanlab/mmx-claude",
3
- "version": "0.4.3",
3
+ "version": "0.4.5",
4
4
  "description": "Claude Code MCP adapter for the seven MiniMax multimodal tools. Companion to @hl-plugins/mmx (OpenCode).",
5
5
  "type": "module",
6
6
  "files": [
7
7
  "claude",
8
- "dist"
8
+ "dist",
9
+ "README.md"
9
10
  ],
10
11
  "scripts": {
11
12
  "build": "bun build ./claude/mcp/mmx-mcp-server.ts --target=bun --outfile=./dist/mmx-mcp-server.js",