mcp-youtube-intelligence 0.2.5 → 0.2.6

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 CHANGED
@@ -33,6 +33,16 @@ You need API keys for three services:
33
33
  npm install -g mcp-youtube-intelligence
34
34
  ```
35
35
 
36
+ ## CLI flags
37
+
38
+ ```bash
39
+ mcp-youtube-intelligence --version # or -v — print the installed version and exit
40
+ mcp-youtube-intelligence --help # or -h — print usage and exit
41
+ ```
42
+
43
+ Running the command with no flags starts the MCP server itself (stdio transport) — this is what
44
+ an MCP client config invokes; it's not meant to be run bare in a terminal for interactive use.
45
+
36
46
  ## Usage
37
47
 
38
48
  Add to your Claude Desktop / MCP client config:
@@ -97,6 +97,9 @@ export function getGeminiApiKey() {
97
97
  // ---------------------------------------------------------------------------
98
98
  export function parseChannelInput(input) {
99
99
  const trimmed = input.trim();
100
+ if (!trimmed) {
101
+ throw new Error("channel_url must not be empty.");
102
+ }
100
103
  // Bare @handle — e.g. @fireship or @web.dev (periods allowed in handles)
101
104
  if (/^@[\w.-]+$/.test(trimmed))
102
105
  return { type: "handle", value: trimmed };
package/build/cli.js ADDED
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Pure argv → output-text mapping for the --version/--help flags, split out of
3
+ * index.ts so it can be unit tested without importing index.ts itself — that
4
+ * module connects a stdio MCP transport as a top-level side effect on import,
5
+ * which would hang a test runner.
6
+ */
7
+ const HELP_TEXT = (version) => `mcp-youtube-intelligence v${version} — MCP server for YouTube channel intelligence
8
+
9
+ Usage:
10
+ mcp-youtube-intelligence [options]
11
+
12
+ Options:
13
+ --help, -h Show this help message
14
+ --version, -v Print the installed version
15
+
16
+ Tools provided:
17
+ analyze_channel Extract transcripts, topics, and competitive signals from a YouTube channel`;
18
+ /**
19
+ * Returns the text to print for --version/-v or --help/-h, or null if argv
20
+ * contains neither (the normal MCP-server-startup path). --version/-v takes
21
+ * precedence when both are present.
22
+ */
23
+ export function getCliOutput(argv, version) {
24
+ if (argv.includes("--version") || argv.includes("-v"))
25
+ return version;
26
+ if (argv.includes("--help") || argv.includes("-h"))
27
+ return HELP_TEXT(version);
28
+ return null;
29
+ }
30
+ //# sourceMappingURL=cli.js.map
package/build/index.js CHANGED
@@ -11,24 +11,12 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
11
11
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
12
12
  import { z } from "zod";
13
13
  import { analyzeChannel } from "./analyze_channel.js";
14
+ import { getCliOutput } from "./cli.js";
14
15
  const require = createRequire(import.meta.url);
15
16
  const { version: packageVersion } = require("../package.json");
16
- if (process.argv.includes("--version") || process.argv.includes("-v")) {
17
- console.log(packageVersion);
18
- process.exit(0);
19
- }
20
- if (process.argv.includes("--help") || process.argv.includes("-h")) {
21
- console.log(`mcp-youtube-intelligence v${packageVersion} — MCP server for YouTube channel intelligence
22
-
23
- Usage:
24
- mcp-youtube-intelligence [options]
25
-
26
- Options:
27
- --help, -h Show this help message
28
- --version, -v Print the installed version
29
-
30
- Tools provided:
31
- analyze_channel Extract transcripts, topics, and competitive signals from a YouTube channel`);
17
+ const cliOutput = getCliOutput(process.argv, packageVersion);
18
+ if (cliOutput !== null) {
19
+ console.log(cliOutput);
32
20
  process.exit(0);
33
21
  }
34
22
  const server = new McpServer({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mcp-youtube-intelligence",
3
- "version": "0.2.5",
3
+ "version": "0.2.6",
4
4
  "description": "MCP server for extracting structured intelligence from YouTube channels and videos — transcripts, topics, competitive signals",
5
5
  "mcpName": "io.github.dmitriusan/mcp-youtube-intelligence",
6
6
  "main": "build/index.js",