@mkterswingman/yt-mcp 0.3.2 → 0.3.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mkterswingman/yt-mcp",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "YouTube MCP client — local subtitles + remote API proxy",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  "build": "tsc -p tsconfig.json",
14
14
  "dev": "tsx src/cli/index.ts",
15
15
  "start": "node dist/cli/index.js",
16
- "postinstall": "node scripts/download-ytdlp.mjs"
16
+ "postinstall": "node scripts/download-ytdlp.mjs && node scripts/postinstall-hint.mjs"
17
17
  },
18
18
  "dependencies": {
19
19
  "@modelcontextprotocol/sdk": "^1.27.1",
@@ -36,6 +36,7 @@
36
36
  "files": [
37
37
  "dist/",
38
38
  "scripts/download-ytdlp.mjs",
39
+ "scripts/postinstall-hint.mjs",
39
40
  "README.md"
40
41
  ],
41
42
  "devDependencies": {
@@ -0,0 +1,34 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * Post-install: if global install + TTY available + not yet set up → auto-run setup.
5
+ * Otherwise print a hint.
6
+ */
7
+
8
+ import { existsSync } from "node:fs";
9
+ import { join } from "node:path";
10
+ import { execFileSync } from "node:child_process";
11
+
12
+ const home = process.env.HOME || process.env.USERPROFILE || "";
13
+ const authFile = join(home, ".yt-mcp", "auth.json");
14
+
15
+ // Already set up — skip silently
16
+ if (existsSync(authFile)) {
17
+ process.exit(0);
18
+ }
19
+
20
+ // Not a TTY (CI, Docker, piped) — just print hint
21
+ if (!process.stdin.isTTY) {
22
+ console.log("\n yt-mcp installed! Run: yt-mcp setup\n");
23
+ process.exit(0);
24
+ }
25
+
26
+ // Auto-launch setup
27
+ console.log("\n First time? Starting setup automatically...\n");
28
+ try {
29
+ execFileSync(process.execPath, [join(import.meta.dirname, "..", "dist", "cli", "index.js"), "setup"], {
30
+ stdio: "inherit",
31
+ });
32
+ } catch {
33
+ console.log("\n Setup interrupted. Run later: yt-mcp setup\n");
34
+ }