argsbarg 7.1.3 → 7.1.4
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/CHANGELOG.md +8 -1
- package/examples/mcp-plugin/.claude-plugin/plugin.json +2 -2
- package/examples/mcp-plugin/.cursor-plugin/plugin.json +2 -2
- package/examples/mcp-plugin/AGENTS.md +3 -5
- package/examples/mcp-plugin/README.md +8 -8
- package/examples/mcp-plugin/dist/mcp-plugin.mjs +385 -0
- package/examples/mcp-plugin/justfile +9 -5
- package/examples/mcp-plugin/package.json +2 -6
- package/examples/mcp-plugin/scripts/release.ts +10 -22
- package/examples/mcp-plugin/src/index.ts +0 -1
- package/package.json +1 -1
- package/examples/mcp-plugin/bunfig.toml +0 -7
- package/examples/mcp-plugin/docs/node-distro.md +0 -97
|
@@ -7,8 +7,12 @@ export PATH := justfile_directory() + "/node_modules/.bin:" + env_var("PATH")
|
|
|
7
7
|
_:
|
|
8
8
|
@just --list
|
|
9
9
|
|
|
10
|
-
# Run schemagen, typecheck, and
|
|
11
|
-
check: schemagen format typecheck
|
|
10
|
+
# Run schemagen, format, typecheck, and rebuild the committed Node bundle
|
|
11
|
+
check: schemagen format typecheck build
|
|
12
|
+
|
|
13
|
+
# Bundle the Node MCP server that plugins run (commit dist/mcp-plugin.mjs)
|
|
14
|
+
build: schemagen
|
|
15
|
+
bun build ./src/index.ts --target=node --minify-whitespace --minify-syntax --outfile=./dist/mcp-plugin.mjs
|
|
12
16
|
|
|
13
17
|
# demo the HTTP API
|
|
14
18
|
demo-http:
|
|
@@ -53,12 +57,12 @@ lint:
|
|
|
53
57
|
bun run biome check ./src ./scripts
|
|
54
58
|
|
|
55
59
|
# Install the Claude Code plugin from this checkout (restart Claude Code afterwards)
|
|
56
|
-
plugin-claude-install:
|
|
60
|
+
plugin-claude-install: build
|
|
57
61
|
claude plugin marketplace add "$(pwd)"
|
|
58
62
|
claude plugin install mcp-plugin@mcp-plugin
|
|
59
63
|
|
|
60
64
|
# Link plugin into ~/.cursor/plugins/local/mcp-plugin for local testing
|
|
61
|
-
plugin-cursor-upsert:
|
|
65
|
+
plugin-cursor-upsert: build
|
|
62
66
|
mkdir -p ~/.cursor/plugins/local
|
|
63
67
|
ln -sfn '{{justfile_directory()}}' ~/.cursor/plugins/local/mcp-plugin
|
|
64
68
|
@echo "Linked MCP plugin to ~/.cursor/plugins/local/mcp-plugin"
|
|
@@ -81,7 +85,7 @@ setup:
|
|
|
81
85
|
test: check
|
|
82
86
|
bun test .
|
|
83
87
|
|
|
84
|
-
# Bump version and publish a
|
|
88
|
+
# Bump version, rebuild the bundle, and publish a release
|
|
85
89
|
release *ARGS:
|
|
86
90
|
bun scripts/release.ts {{ARGS}}
|
|
87
91
|
|
|
@@ -6,12 +6,8 @@
|
|
|
6
6
|
"module": "src/index.ts",
|
|
7
7
|
"description": "Argsbarg MCP plugin template for Cursor and Claude Code marketplaces.",
|
|
8
8
|
"engines": {
|
|
9
|
-
"bun": ">=1.3"
|
|
10
|
-
|
|
11
|
-
"scripts": {
|
|
12
|
-
"biome": "biome",
|
|
13
|
-
"prestart": "bun install --frozen-lockfile 1>&2 && bun run argsbarg schemagen 1>&2",
|
|
14
|
-
"start": "bun src/index.ts mcp"
|
|
9
|
+
"bun": ">=1.3",
|
|
10
|
+
"node": ">=20"
|
|
15
11
|
},
|
|
16
12
|
"dependencies": {
|
|
17
13
|
"argsbarg": "file:../.."
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
/*
|
|
3
|
-
Bump version and publish a
|
|
3
|
+
Bump version, rebuild the committed Node bundle, and publish a plugin release tag.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
6
|
import * as fs from "node:fs";
|
|
@@ -39,10 +39,7 @@ async function main(): Promise<void> {
|
|
|
39
39
|
|
|
40
40
|
/** Prints usage and exits. */
|
|
41
41
|
function usage(): never {
|
|
42
|
-
process.stderr.write(
|
|
43
|
-
"Usage:\n" +
|
|
44
|
-
" bun scripts/release.ts <major|minor|patch> [--yes] [--dry-run]\n",
|
|
45
|
-
);
|
|
42
|
+
process.stderr.write("Usage:\n" + " bun scripts/release.ts <major|minor|patch> [--yes] [--dry-run]\n");
|
|
46
43
|
process.exit(1);
|
|
47
44
|
}
|
|
48
45
|
|
|
@@ -80,7 +77,7 @@ async function runRelease(
|
|
|
80
77
|
const newVersion = applyBump(currentVersion, bump);
|
|
81
78
|
if (options.dryRun) {
|
|
82
79
|
console.log(
|
|
83
|
-
`[dry-run] Would run checks, bump ${currentVersion} to ${newVersion}, update the changelog, regenerate docs, commit, tag v${newVersion}, push, and create a GitHub release.`,
|
|
80
|
+
`[dry-run] Would run checks, bump ${currentVersion} to ${newVersion}, update the changelog, regenerate docs, rebuild the bundle, commit, tag v${newVersion}, push, and create a GitHub release.`,
|
|
84
81
|
);
|
|
85
82
|
return;
|
|
86
83
|
}
|
|
@@ -96,6 +93,9 @@ async function runRelease(
|
|
|
96
93
|
const docgenResult = await $`just docgen`.nothrow();
|
|
97
94
|
if (docgenResult.exitCode !== 0) process.exit(docgenResult.exitCode);
|
|
98
95
|
|
|
96
|
+
const buildResult = await $`just build`.nothrow();
|
|
97
|
+
if (buildResult.exitCode !== 0) process.exit(buildResult.exitCode);
|
|
98
|
+
|
|
99
99
|
await commitAndTag(newVersion);
|
|
100
100
|
await createGithubRelease(`v${newVersion}`);
|
|
101
101
|
|
|
@@ -153,31 +153,19 @@ function updateVersion(
|
|
|
153
153
|
): void {
|
|
154
154
|
const pkgPath = "package.json";
|
|
155
155
|
const pkgContent = fs.readFileSync(pkgPath, "utf-8");
|
|
156
|
-
fs.writeFileSync(
|
|
157
|
-
pkgPath,
|
|
158
|
-
pkgContent.replace(/"version":\s*"[^"]+"/, `"version": "${newVersion}"`),
|
|
159
|
-
);
|
|
156
|
+
fs.writeFileSync(pkgPath, pkgContent.replace(/"version":\s*"[^"]+"/, `"version": "${newVersion}"`));
|
|
160
157
|
|
|
161
158
|
const progContent = fs.readFileSync(programPath, "utf-8");
|
|
162
|
-
fs.writeFileSync(
|
|
163
|
-
programPath,
|
|
164
|
-
progContent.replace(/version:\s*"[^"]+"/, `version: "${newVersion}"`),
|
|
165
|
-
);
|
|
159
|
+
fs.writeFileSync(programPath, progContent.replace(/version:\s*"[^"]+"/, `version: "${newVersion}"`));
|
|
166
160
|
|
|
167
161
|
if (fs.existsSync(cursorManifestPath)) {
|
|
168
162
|
const cursorContent = fs.readFileSync(cursorManifestPath, "utf-8");
|
|
169
|
-
fs.writeFileSync(
|
|
170
|
-
cursorManifestPath,
|
|
171
|
-
cursorContent.replace(/"version":\s*"[^"]+"/, `"version": "${newVersion}"`),
|
|
172
|
-
);
|
|
163
|
+
fs.writeFileSync(cursorManifestPath, cursorContent.replace(/"version":\s*"[^"]+"/, `"version": "${newVersion}"`));
|
|
173
164
|
}
|
|
174
165
|
|
|
175
166
|
if (fs.existsSync(claudeManifestPath)) {
|
|
176
167
|
const claudeContent = fs.readFileSync(claudeManifestPath, "utf-8");
|
|
177
|
-
fs.writeFileSync(
|
|
178
|
-
claudeManifestPath,
|
|
179
|
-
claudeContent.replace(/"version":\s*"[^"]+"/, `"version": "${newVersion}"`),
|
|
180
|
-
);
|
|
168
|
+
fs.writeFileSync(claudeManifestPath, claudeContent.replace(/"version":\s*"[^"]+"/, `"version": "${newVersion}"`));
|
|
181
169
|
}
|
|
182
170
|
}
|
|
183
171
|
|
package/package.json
CHANGED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
# Node Distribution
|
|
2
|
-
|
|
3
|
-
The default plugin ships TypeScript and starts with Bun. To ship a standalone
|
|
4
|
-
Node MCP server instead, follow the bundle-based distribution described below.
|
|
5
|
-
Bun remains the development/build tool; plugin users need Node but do not need
|
|
6
|
-
Bun, dependency installation, or schema generation at startup.
|
|
7
|
-
Note: bundle distrobutions mean committing large bundled js files to the repo.
|
|
8
|
-
## 1. Build The Bundle
|
|
9
|
-
|
|
10
|
-
Add this recipe to `justfile`:
|
|
11
|
-
|
|
12
|
-
```just
|
|
13
|
-
# Generate schemas and bundle the standalone Node MCP server
|
|
14
|
-
build: schemagen
|
|
15
|
-
bun build ./src/index.ts --target=node --outfile=./scripts/mcp.mjs
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
Run `just setup` and `just build` from the project root. Schemas must exist before
|
|
19
|
-
bundling so their static imports are included in the output.
|
|
20
|
-
|
|
21
|
-
Keep the MCP runtime compatible with Node. Bundling does not implement Bun-only
|
|
22
|
-
APIs such as `Bun.serve` or `bun:sqlite`; port or exclude any such runtime paths.
|
|
23
|
-
The HTTP server capability is separate from this Node MCP distribution.
|
|
24
|
-
|
|
25
|
-
## 2. Change Startup
|
|
26
|
-
|
|
27
|
-
Remove `prestart` from `package.json` and change `start` to:
|
|
28
|
-
|
|
29
|
-
```json
|
|
30
|
-
"start": "node scripts/mcp.mjs mcp"
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
Declare the supported Node version range under `engines.node` and document it in
|
|
34
|
-
the README. Bun is still needed by maintainers for schema generation, tests, and
|
|
35
|
-
bundling. The Bun shell settings in `bunfig.toml` can remain for development.
|
|
36
|
-
|
|
37
|
-
## 3. Update Inline Plugin Configs
|
|
38
|
-
|
|
39
|
-
Keep MCP configuration inside the plugin manifests; do not reintroduce separate
|
|
40
|
-
root MCP config files. Replace the `mcpServers` field in
|
|
41
|
-
`.claude-plugin/plugin.json` with:
|
|
42
|
-
|
|
43
|
-
```json
|
|
44
|
-
"mcpServers": {
|
|
45
|
-
"mcp-plugin": {
|
|
46
|
-
"command": "node",
|
|
47
|
-
"args": ["${CLAUDE_PLUGIN_ROOT}/scripts/mcp.mjs", "mcp"]
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
Use the corresponding field in `.cursor-plugin/plugin.json`:
|
|
53
|
-
|
|
54
|
-
```json
|
|
55
|
-
"mcpServers": {
|
|
56
|
-
"mcp-plugin": {
|
|
57
|
-
"command": "node",
|
|
58
|
-
"args": ["${CURSOR_PLUGIN_ROOT}/scripts/mcp.mjs", "mcp"]
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
Launching Node directly avoids relying on a package manager on the user's
|
|
64
|
-
machine. Keep each path as one argument so plugin roots containing spaces work.
|
|
65
|
-
|
|
66
|
-
## 4. Package And Release
|
|
67
|
-
|
|
68
|
-
- Add `build` as a dependency of `plugin-cursor-upsert` and
|
|
69
|
-
`plugin-claude-install` so local installs have a fresh bundle.
|
|
70
|
-
- Restore `just build` in `scripts/release.ts` after version/documentation
|
|
71
|
-
updates and before committing or publishing. Fail the release if it fails.
|
|
72
|
-
- Include `scripts/mcp.mjs` in the released plugin. For repository-based
|
|
73
|
-
installation, commit the generated bundle so a fresh clone is runnable.
|
|
74
|
-
- Do not ship `node_modules` or generated schemas separately. Their runtime
|
|
75
|
-
contents should be bundled; inspect external imports and package any required
|
|
76
|
-
runtime assets explicitly.
|
|
77
|
-
- Update the README and the project-specific tooling section of `AGENTS.md`
|
|
78
|
-
to describe Node as the plugin runtime and Bun as the development tool.
|
|
79
|
-
|
|
80
|
-
## 5. Verify The Node Distribution
|
|
81
|
-
|
|
82
|
-
After building, a basic stdio check is:
|
|
83
|
-
|
|
84
|
-
```bash
|
|
85
|
-
printf '%s\n' '{"jsonrpc":"2.0","id":1,"method":"initialize","params":{}}' \
|
|
86
|
-
| node scripts/mcp.mjs mcp
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
Only JSON-RPC responses should appear on stdout. Exercise `tools/list` and a
|
|
90
|
-
representative tool call as well: successful initialization alone does not prove
|
|
91
|
-
that every command's runtime dependencies are Node-compatible.
|
|
92
|
-
|
|
93
|
-
Check both manifest commands from an unrelated working directory with the
|
|
94
|
-
plugin-root placeholders expanded to the installed path. Verify a clean copy
|
|
95
|
-
with no `node_modules` or generated schemas, using the declared minimum Node
|
|
96
|
-
version and a current supported Node version. Keep transport/package checks at
|
|
97
|
-
the integration level; agent E2E should measure real user-task outcomes.
|