whitemagic-mcp 9.0.0

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +52 -0
  3. package/bin/cli.mjs +80 -0
  4. package/package.json +34 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Lucas Bailey (WhiteMagic Labs)
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,52 @@
1
+ # whitemagic-mcp
2
+
3
+ [WhiteMagic](https://whitemagic.dev) — local-first memory and session
4
+ continuity for AI coding agents, over MCP. One static Rust binary, no
5
+ telemetry, no cloud service. MIT.
6
+
7
+ This package installs and runs the official `wm` binary from the
8
+ [GitHub releases](https://github.com/lbailey94/whitemagic/releases)
9
+ (checksum-verified at install time) so an MCP client can launch it
10
+ without a manual download step.
11
+
12
+ ## Use
13
+
14
+ Point any MCP client (Claude Desktop, Cursor, Codex, Gemini CLI,
15
+ opencode) at:
16
+
17
+ ```json
18
+ {
19
+ "mcpServers": {
20
+ "whitemagic": {
21
+ "command": "whitemagic-mcp",
22
+ "args": ["serve", "--profile", "curated"]
23
+ }
24
+ }
25
+ }
26
+ ```
27
+
28
+ Or try it directly:
29
+
30
+ ```bash
31
+ npx whitemagic-mcp --version # wm 9.0.0
32
+ npx whitemagic-mcp doctor # environment health check
33
+ ```
34
+
35
+ The binary is cached under `~/.cache/whitemagic/bin/<release-tag>/`
36
+ (respects `XDG_CACHE_HOME`); the package version's major tracks the
37
+ release tag (9.0.0 → `v9`). Pin a different release with
38
+ `WHITEMAGIC_RELEASE`.
39
+
40
+ ## Platforms
41
+
42
+ Linux x86-64 (static musl), macOS arm64/x64, Windows x64. No asset for
43
+ your platform? Build from source:
44
+ https://github.com/lbailey94/whitemagic#install
45
+
46
+ ## Privacy
47
+
48
+ Your memory store lives on your machine. `wm` does not phone home; this
49
+ installer contacts GitHub releases only to download the binary and its
50
+ checksum. See [PRIVACY_POLICY.md](https://github.com/lbailey94/whitemagic/blob/main/PRIVACY_POLICY.md).
51
+
52
+ mcp-name: io.github.lbailey94/whitemagic-mcp
package/bin/cli.mjs ADDED
@@ -0,0 +1,80 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * whitemagic-mcp — installs and runs the `wm` binary from the GitHub
4
+ * releases, with checksum verification. `npx whitemagic-mcp serve` is
5
+ * the MCP entrypoint. No dependencies; Node 18+ global fetch.
6
+ *
7
+ * Version contract: package major tracks the release tag (9.0.0 → v9).
8
+ * Override the tag with WHITEMAGIC_RELEASE (e.g. "v9").
9
+ */
10
+ import { createHash } from "node:crypto";
11
+ import { chmodSync, existsSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
12
+ import { homedir, platform, arch, tmpdir } from "node:os";
13
+ import { join } from "node:path";
14
+ import { spawnSync } from "node:child_process";
15
+
16
+ const pkg = JSON.parse(readFileSync(new URL("../package.json", import.meta.url), "utf8"));
17
+ const TAG = process.env.WHITEMAGIC_RELEASE ?? `v${pkg.version.split(".")[0]}`;
18
+ const REPO = "lbailey94/whitemagic";
19
+ const BASE = `https://github.com/${REPO}/releases/download/${TAG}`;
20
+
21
+ function assetFor() {
22
+ const p = platform(), a = arch();
23
+ if (p === "linux" && a === "x64") return "wm-linux-x86_64-musl";
24
+ if (p === "darwin" && a === "arm64") return "wm-macos-aarch64";
25
+ if (p === "darwin" && a === "x64") return "wm-macos-x86_64";
26
+ if (p === "win32" && a === "x64") return "wm-windows-x86_64.exe";
27
+ return null;
28
+ }
29
+
30
+ async function fetchTo(url, dest) {
31
+ const res = await fetch(url, { redirect: "follow" });
32
+ if (!res.ok) throw new Error(`HTTP ${res.status} for ${url}`);
33
+ writeFileSync(dest, Buffer.from(await res.arrayBuffer()));
34
+ }
35
+
36
+ async function ensureBinary() {
37
+ const asset = assetFor();
38
+ if (!asset) {
39
+ console.error(`whitemagic-mcp: no release asset for ${platform()}/${arch()} yet.`);
40
+ console.error(`Install from source instead: https://github.com/${REPO}#install`);
41
+ process.exit(1);
42
+ }
43
+ const cached = join(
44
+ process.env.XDG_CACHE_HOME ?? join(homedir(), ".cache"),
45
+ "whitemagic",
46
+ "bin",
47
+ TAG,
48
+ asset,
49
+ );
50
+ if (existsSync(cached)) return cached;
51
+
52
+ console.error(`whitemagic-mcp: fetching ${TAG}/${asset} ...`);
53
+ const binDir = join(
54
+ process.env.XDG_CACHE_HOME ?? join(homedir(), ".cache"),
55
+ "whitemagic",
56
+ "bin",
57
+ TAG,
58
+ );
59
+ mkdirSync(binDir, { recursive: true });
60
+ const tmp = mkdtempSync(join(tmpdir(), "wm-dl-"));
61
+ try {
62
+ await fetchTo(`${BASE}/${asset}`, join(tmp, asset));
63
+ await fetchTo(`${BASE}/${asset}.sha256`, join(tmp, `${asset}.sha256`));
64
+ const expected = readFileSync(join(tmp, `${asset}.sha256`), "utf8").trim().split(/\s+/)[0];
65
+ const actual = createHash("sha256").update(readFileSync(join(tmp, asset))).digest("hex");
66
+ if (expected !== actual) {
67
+ throw new Error(`checksum mismatch for ${asset}\n expected ${expected}\n actual ${actual}`);
68
+ }
69
+ writeFileSync(cached, readFileSync(join(tmp, asset)));
70
+ chmodSync(cached, 0o755);
71
+ return cached;
72
+ } finally {
73
+ rmSync(tmp, { recursive: true, force: true });
74
+ }
75
+ }
76
+
77
+ const bin = await ensureBinary();
78
+ const isWin = platform() === "win32";
79
+ const result = spawnSync(bin, process.argv.slice(2), { stdio: "inherit", shell: isWin });
80
+ process.exit(result.status ?? 1);
package/package.json ADDED
@@ -0,0 +1,34 @@
1
+ {
2
+ "name": "whitemagic-mcp",
3
+ "version": "9.0.0",
4
+ "description": "WhiteMagic MCP server — local-first memory and session continuity for AI coding agents. Installs and runs the wm binary; no telemetry, no cloud.",
5
+ "license": "MIT",
6
+ "bin": {
7
+ "whitemagic-mcp": "./bin/cli.mjs"
8
+ },
9
+ "files": [
10
+ "bin/",
11
+ "README.md",
12
+ "LICENSE"
13
+ ],
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
17
+ "keywords": [
18
+ "mcp",
19
+ "mcp-server",
20
+ "agent-memory",
21
+ "ai-agents",
22
+ "local-first",
23
+ "whitemagic",
24
+ "session-continuity"
25
+ ],
26
+ "repository": {
27
+ "type": "git",
28
+ "url": "git+https://github.com/lbailey94/whitemagic.git",
29
+ "directory": "npm/whitemagic-mcp"
30
+ },
31
+ "homepage": "https://whitemagic.dev",
32
+ "bugs": "https://github.com/lbailey94/whitemagic/issues",
33
+ "mcpName": "io.github.lbailey94/whitemagic-mcp"
34
+ }