@fullstackcraftllc/codevideo-mcp 1.0.0 → 1.0.2
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 +5 -1
- package/dist/index.js +1327 -354
- package/dist/src/constants/Constants.d.ts +2 -0
- package/dist/src/index.d.ts +2 -1
- package/dist/src/prompts/instructions_to_translate_actions.d.ts +2 -0
- package/dist/src/resources/get_example_actions_array_by_keyword.d.ts +1 -0
- package/dist/src/resources/get_example_lessons_by_keyword.d.ts +1 -0
- package/dist/src/rest-server/index.d.ts +24 -0
- package/dist/src/rest-server/job-manager.d.ts +56 -0
- package/dist/src/rest-server/mcp-client.d.ts +23 -0
- package/dist/src/rest-server/rest-server.d.ts +24 -0
- package/dist/src/rest-server/server.d.ts +4 -0
- package/dist/src/tools/get_current_lesson.d.ts +3 -0
- package/dist/src/tools/get_initial_lesson_state_from_github_repo.d.ts +1 -0
- package/dist/src/tools/{make_video.d.ts → make_video_from_actions.d.ts} +1 -1
- package/dist/src/tools/make_video_from_lesson.d.ts +8 -0
- package/dist/src/tools/set_current_lesson.d.ts +2 -0
- package/package.json +19 -5
- package/dist/src/resources/get_example_lesson.d.ts +0 -1
package/dist/src/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
export declare function createMcpServer(): McpServer;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getExampleActionsArrayByKeyword: (keyword: string | string[]) => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getExampleLessonByKeyword: (keyword: string | string[]) => string;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
declare class RestMcpServer {
|
|
3
|
+
app: express.Application;
|
|
4
|
+
private httpServer;
|
|
5
|
+
private io;
|
|
6
|
+
private jobManager;
|
|
7
|
+
private mcpServer;
|
|
8
|
+
private mcpClient;
|
|
9
|
+
private mcpTransport;
|
|
10
|
+
private tasks;
|
|
11
|
+
private port;
|
|
12
|
+
constructor(port?: number);
|
|
13
|
+
private setupMiddleware;
|
|
14
|
+
private initializeMcpServer;
|
|
15
|
+
private setupRoutes;
|
|
16
|
+
private setupWebSocket;
|
|
17
|
+
private processRequest;
|
|
18
|
+
private processPrompt;
|
|
19
|
+
private processTool;
|
|
20
|
+
private notifyTaskUpdate;
|
|
21
|
+
start(): void;
|
|
22
|
+
stop(): void;
|
|
23
|
+
}
|
|
24
|
+
export { RestMcpServer };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { EventEmitter } from 'events';
|
|
2
|
+
interface Job {
|
|
3
|
+
id: string;
|
|
4
|
+
taskId: string;
|
|
5
|
+
type: string;
|
|
6
|
+
data: any;
|
|
7
|
+
status: 'pending' | 'running' | 'completed' | 'failed' | 'cancelled';
|
|
8
|
+
createdAt: Date;
|
|
9
|
+
startedAt?: Date;
|
|
10
|
+
completedAt?: Date;
|
|
11
|
+
retryCount: number;
|
|
12
|
+
maxRetries: number;
|
|
13
|
+
priority: number;
|
|
14
|
+
timeout?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class JobManager extends EventEmitter {
|
|
17
|
+
private jobs;
|
|
18
|
+
private queue;
|
|
19
|
+
private workers;
|
|
20
|
+
private isRunning;
|
|
21
|
+
private maxConcurrentJobs;
|
|
22
|
+
private pollInterval;
|
|
23
|
+
constructor(maxConcurrentJobs?: number);
|
|
24
|
+
addJob(taskId: string, type: string, data: any, options?: {
|
|
25
|
+
priority?: number;
|
|
26
|
+
maxRetries?: number;
|
|
27
|
+
timeout?: number;
|
|
28
|
+
}): string;
|
|
29
|
+
getJob(jobId: string): Job | undefined;
|
|
30
|
+
cancelJob(taskId: string): boolean;
|
|
31
|
+
getQueueStatus(): {
|
|
32
|
+
pending: number;
|
|
33
|
+
running: number;
|
|
34
|
+
completed: number;
|
|
35
|
+
failed: number;
|
|
36
|
+
cancelled: number;
|
|
37
|
+
};
|
|
38
|
+
getQueueInfo(): {
|
|
39
|
+
queueLength: number;
|
|
40
|
+
activeWorkers: number;
|
|
41
|
+
totalJobs: number;
|
|
42
|
+
status: {
|
|
43
|
+
[key: string]: number;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
private enqueue;
|
|
47
|
+
private processNextJob;
|
|
48
|
+
private executeJob;
|
|
49
|
+
private getJobExecutionTime;
|
|
50
|
+
private handleJobTimeout;
|
|
51
|
+
private start;
|
|
52
|
+
private processQueue;
|
|
53
|
+
shutdown(): void;
|
|
54
|
+
clearCompleted(): number;
|
|
55
|
+
}
|
|
56
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
2
|
+
interface McpToolCall {
|
|
3
|
+
name: string;
|
|
4
|
+
arguments: any;
|
|
5
|
+
}
|
|
6
|
+
interface McpResponse {
|
|
7
|
+
content: any[];
|
|
8
|
+
isError?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class McpClient {
|
|
11
|
+
private server;
|
|
12
|
+
private isConnected;
|
|
13
|
+
constructor(server: McpServer);
|
|
14
|
+
connect(): Promise<void>;
|
|
15
|
+
listTools(): Promise<any[]>;
|
|
16
|
+
callTool(toolCall: McpToolCall): Promise<McpResponse>;
|
|
17
|
+
getPrompts(): Promise<any[]>;
|
|
18
|
+
getPrompt(name: string, args?: any): Promise<any>;
|
|
19
|
+
getResources(): Promise<any[]>;
|
|
20
|
+
readResource(uri: string): Promise<any>;
|
|
21
|
+
disconnect(): void;
|
|
22
|
+
}
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import express from 'express';
|
|
3
|
+
declare class RestMcpServer {
|
|
4
|
+
app: express.Application;
|
|
5
|
+
private httpServer;
|
|
6
|
+
private io;
|
|
7
|
+
private jobManager;
|
|
8
|
+
private mcpServer;
|
|
9
|
+
private mcpClient;
|
|
10
|
+
private tasks;
|
|
11
|
+
private port;
|
|
12
|
+
constructor(port?: number);
|
|
13
|
+
private setupMiddleware;
|
|
14
|
+
private initializeMcpServer;
|
|
15
|
+
private setupRoutes;
|
|
16
|
+
private setupWebSocket;
|
|
17
|
+
private processRequest;
|
|
18
|
+
private processPrompt;
|
|
19
|
+
private processTool;
|
|
20
|
+
private notifyTaskUpdate;
|
|
21
|
+
start(): void;
|
|
22
|
+
stop(): void;
|
|
23
|
+
}
|
|
24
|
+
export { RestMcpServer };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const getInitialLessonStateFromGitHubRepo: (repoUrl: string) => Promise<string>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fullstackcraftllc/codevideo-mcp",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "The MCP server for CodeVideo. Create software educational content using natural language.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.cjs.js",
|
|
@@ -20,7 +20,11 @@
|
|
|
20
20
|
"build-typescript": "tsc",
|
|
21
21
|
"test": "jest",
|
|
22
22
|
"type-check": "tsc --noEmit",
|
|
23
|
-
"download-binaries": "tsx scripts/download-binaries.ts"
|
|
23
|
+
"download-binaries": "tsx scripts/download-binaries.ts",
|
|
24
|
+
"rest-server": "tsx src/rest-server/server.ts",
|
|
25
|
+
"rest-server:dev": "tsx --watch src/rest-server/server.ts",
|
|
26
|
+
"client:example": "tsx examples/rest-client.ts",
|
|
27
|
+
"examples:curl": "./examples/curl-examples.sh"
|
|
24
28
|
},
|
|
25
29
|
"repository": {
|
|
26
30
|
"type": "git",
|
|
@@ -39,21 +43,31 @@
|
|
|
39
43
|
},
|
|
40
44
|
"homepage": "https://github.com/codevideo/codevideo-mcp#readme",
|
|
41
45
|
"dependencies": {
|
|
42
|
-
"@fullstackcraftllc/codevideo-adapters": "^1.0.
|
|
46
|
+
"@fullstackcraftllc/codevideo-adapters": "^1.0.12",
|
|
43
47
|
"@fullstackcraftllc/codevideo-exporters": "^0.0.9",
|
|
44
|
-
"@fullstackcraftllc/codevideo-types": "^2.1.
|
|
48
|
+
"@fullstackcraftllc/codevideo-types": "^2.1.26",
|
|
45
49
|
"@google/genai": "^0.14.1",
|
|
46
50
|
"@modelcontextprotocol/sdk": "^1.10.0",
|
|
47
51
|
"@types/better-sqlite3": "^7.6.13",
|
|
48
52
|
"better-sqlite3": "^11.10.0",
|
|
49
|
-
"
|
|
53
|
+
"cors": "^2.8.5",
|
|
54
|
+
"dotenv": "^16.5.0",
|
|
55
|
+
"express": "^4.21.2",
|
|
56
|
+
"node-fetch": "^3.3.2",
|
|
57
|
+
"socket.io": "^4.8.1",
|
|
58
|
+
"uuid": "^9.0.1",
|
|
59
|
+
"ws": "^8.18.2"
|
|
50
60
|
},
|
|
51
61
|
"devDependencies": {
|
|
52
62
|
"@rollup/plugin-commonjs": "^28.0.3",
|
|
53
63
|
"@rollup/plugin-json": "^6.1.0",
|
|
54
64
|
"@rollup/plugin-node-resolve": "^16.0.1",
|
|
55
65
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
66
|
+
"@types/cors": "^2.8.19",
|
|
67
|
+
"@types/express": "^4.17.23",
|
|
56
68
|
"@types/node": "^22.14.1",
|
|
69
|
+
"@types/uuid": "^9.0.8",
|
|
70
|
+
"@types/ws": "^8.18.1",
|
|
57
71
|
"rimraf": "^6.0.1",
|
|
58
72
|
"rollup": "^4.40.0",
|
|
59
73
|
"rollup-plugin-dts": "^6.2.1",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const getExampleLesson: (keyword: string | string[]) => string;
|