scenory-youtube-mcp-server 1.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.
package/build/index.js ADDED
@@ -0,0 +1,104 @@
1
+ #!/usr/bin/env node
2
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js";
5
+ import * as dotenv from 'dotenv';
6
+ dotenv.config();
7
+ const API_KEY = process.env.SCENORY_MCP_API_KEY;
8
+ if (!API_KEY) {
9
+ console.error("SCENORY_MCP_API_KEY environment variable is required. Please set it in your Claude Desktop config or .env");
10
+ process.exit(1);
11
+ }
12
+ // The Scenory MCP Gateway Endpoint
13
+ const GATEWAY_URL = process.env.SCENORY_GATEWAY_URL || "https://yvrxujkpphiueqzraaey.supabase.co/functions/v1/mcp-agent";
14
+ const server = new Server({
15
+ name: "youtube-mcp-server",
16
+ version: "1.0.0",
17
+ }, {
18
+ capabilities: {
19
+ tools: {},
20
+ },
21
+ });
22
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
23
+ return {
24
+ tools: [
25
+ {
26
+ name: "audit_channel_and_generate_roadmap",
27
+ description: "Fetches a YouTube channel's stats and returns a detailed audit and roadmap of problems and solutions.",
28
+ inputSchema: {
29
+ type: "object",
30
+ properties: {
31
+ channelUrl: { type: "string", description: "The YouTube channel URL (e.g., https://youtube.com/@handle)" }
32
+ },
33
+ required: ["channelUrl"]
34
+ }
35
+ },
36
+ {
37
+ name: "analyze_recent_video",
38
+ description: "Analyzes why a channel's most recent video performed poorly or well by comparing it to their average.",
39
+ inputSchema: {
40
+ type: "object",
41
+ properties: {
42
+ channelUrl: { type: "string", description: "The YouTube channel URL" }
43
+ },
44
+ required: ["channelUrl"]
45
+ }
46
+ },
47
+ {
48
+ name: "suggest_content_strategy",
49
+ description: "Suggests a content strategy and viral video ideas for a specific niche based on channel context.",
50
+ inputSchema: {
51
+ type: "object",
52
+ properties: {
53
+ channelUrl: { type: "string", description: "The YouTube channel URL" },
54
+ niche: { type: "string", description: "The channel's niche or topic area" }
55
+ },
56
+ required: ["channelUrl", "niche"]
57
+ }
58
+ }
59
+ ],
60
+ };
61
+ });
62
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
63
+ try {
64
+ const response = await fetch(GATEWAY_URL, {
65
+ method: "POST",
66
+ headers: {
67
+ "Content-Type": "application/json",
68
+ "x-mcp-api-key": API_KEY,
69
+ },
70
+ body: JSON.stringify({
71
+ toolName: request.params.name,
72
+ args: request.params.arguments,
73
+ }),
74
+ });
75
+ const data = await response.json();
76
+ if (!response.ok) {
77
+ return {
78
+ content: [{ type: "text", text: `Error from Scenory: ${data.error || response.statusText}` }],
79
+ isError: true,
80
+ };
81
+ }
82
+ return {
83
+ content: [
84
+ {
85
+ type: "text",
86
+ text: data.result,
87
+ },
88
+ ],
89
+ };
90
+ }
91
+ catch (error) {
92
+ return {
93
+ content: [
94
+ {
95
+ type: "text",
96
+ text: `Error calling Scenory API: ${error.message}`,
97
+ },
98
+ ],
99
+ isError: true,
100
+ };
101
+ }
102
+ });
103
+ const transport = new StdioServerTransport();
104
+ server.connect(transport).catch(console.error);
package/package.json ADDED
@@ -0,0 +1,22 @@
1
+ {
2
+ "name": "scenory-youtube-mcp-server",
3
+ "version": "1.0.0",
4
+ "description": "Scenory AI YouTube Intelligence MCP Server",
5
+ "type": "module",
6
+ "bin": {
7
+ "scenory-youtube-mcp-server": "./build/index.js"
8
+ },
9
+ "scripts": {
10
+ "build": "tsc",
11
+ "start": "node ./build/index.js",
12
+ "dev": "tsc --watch"
13
+ },
14
+ "dependencies": {
15
+ "@modelcontextprotocol/sdk": "^1.5.0",
16
+ "dotenv": "^16.4.7"
17
+ },
18
+ "devDependencies": {
19
+ "@types/node": "^22.13.4",
20
+ "typescript": "^5.7.3"
21
+ }
22
+ }
package/src/index.ts ADDED
@@ -0,0 +1,120 @@
1
+ #!/usr/bin/env node
2
+
3
+ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
4
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
5
+ import {
6
+ CallToolRequestSchema,
7
+ ListToolsRequestSchema,
8
+ } from "@modelcontextprotocol/sdk/types.js";
9
+ import * as dotenv from 'dotenv';
10
+
11
+ dotenv.config();
12
+
13
+ const API_KEY = process.env.SCENORY_MCP_API_KEY;
14
+ if (!API_KEY) {
15
+ console.error("SCENORY_MCP_API_KEY environment variable is required. Please set it in your Claude Desktop config or .env");
16
+ process.exit(1);
17
+ }
18
+
19
+ // The Scenory MCP Gateway Endpoint
20
+ const GATEWAY_URL = process.env.SCENORY_GATEWAY_URL || "https://yvrxujkpphiueqzraaey.supabase.co/functions/v1/mcp-agent";
21
+
22
+ const server = new Server(
23
+ {
24
+ name: "youtube-mcp-server",
25
+ version: "1.0.0",
26
+ },
27
+ {
28
+ capabilities: {
29
+ tools: {},
30
+ },
31
+ }
32
+ );
33
+
34
+ server.setRequestHandler(ListToolsRequestSchema, async () => {
35
+ return {
36
+ tools: [
37
+ {
38
+ name: "audit_channel_and_generate_roadmap",
39
+ description: "Fetches a YouTube channel's stats and returns a detailed audit and roadmap of problems and solutions.",
40
+ inputSchema: {
41
+ type: "object",
42
+ properties: {
43
+ channelUrl: { type: "string", description: "The YouTube channel URL (e.g., https://youtube.com/@handle)" }
44
+ },
45
+ required: ["channelUrl"]
46
+ }
47
+ },
48
+ {
49
+ name: "analyze_recent_video",
50
+ description: "Analyzes why a channel's most recent video performed poorly or well by comparing it to their average.",
51
+ inputSchema: {
52
+ type: "object",
53
+ properties: {
54
+ channelUrl: { type: "string", description: "The YouTube channel URL" }
55
+ },
56
+ required: ["channelUrl"]
57
+ }
58
+ },
59
+ {
60
+ name: "suggest_content_strategy",
61
+ description: "Suggests a content strategy and viral video ideas for a specific niche based on channel context.",
62
+ inputSchema: {
63
+ type: "object",
64
+ properties: {
65
+ channelUrl: { type: "string", description: "The YouTube channel URL" },
66
+ niche: { type: "string", description: "The channel's niche or topic area" }
67
+ },
68
+ required: ["channelUrl", "niche"]
69
+ }
70
+ }
71
+ ],
72
+ };
73
+ });
74
+
75
+ server.setRequestHandler(CallToolRequestSchema, async (request) => {
76
+ try {
77
+ const response = await fetch(GATEWAY_URL, {
78
+ method: "POST",
79
+ headers: {
80
+ "Content-Type": "application/json",
81
+ "x-mcp-api-key": API_KEY,
82
+ },
83
+ body: JSON.stringify({
84
+ toolName: request.params.name,
85
+ args: request.params.arguments,
86
+ }),
87
+ });
88
+
89
+ const data = await response.json();
90
+
91
+ if (!response.ok) {
92
+ return {
93
+ content: [{ type: "text", text: `Error from Scenory: ${data.error || response.statusText}` }],
94
+ isError: true,
95
+ }
96
+ }
97
+
98
+ return {
99
+ content: [
100
+ {
101
+ type: "text",
102
+ text: data.result,
103
+ },
104
+ ],
105
+ };
106
+ } catch (error: any) {
107
+ return {
108
+ content: [
109
+ {
110
+ type: "text",
111
+ text: `Error calling Scenory API: ${error.message}`,
112
+ },
113
+ ],
114
+ isError: true,
115
+ };
116
+ }
117
+ });
118
+
119
+ const transport = new StdioServerTransport();
120
+ server.connect(transport).catch(console.error);
package/tsconfig.json ADDED
@@ -0,0 +1,14 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "NodeNext",
5
+ "moduleResolution": "NodeNext",
6
+ "outDir": "./build",
7
+ "rootDir": "./src",
8
+ "strict": true,
9
+ "esModuleInterop": true,
10
+ "skipLibCheck": true,
11
+ "forceConsistentCasingInFileNames": true
12
+ },
13
+ "include": ["src/**/*"]
14
+ }