@fullstackcraftllc/codevideo-mcp 1.0.2 → 1.1.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 (44) hide show
  1. package/README.md +98 -5
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.js +3370 -1935
  4. package/dist/index.js.map +7 -0
  5. package/package.json +40 -33
  6. package/bin/darwin-arm64/codevideo-cli +0 -0
  7. package/bin/darwin-x64/codevideo-cli +0 -0
  8. package/bin/linux-x64/codevideo-cli +0 -0
  9. package/bin/win32-x64/codevideo-cli.exe +0 -0
  10. package/dist/src/constants/Constants.d.ts +0 -2
  11. package/dist/src/index.d.ts +0 -2
  12. package/dist/src/prompts/instructions_to_create_a_course.d.ts +0 -1
  13. package/dist/src/prompts/instructions_to_create_lesson_actions.d.ts +0 -1
  14. package/dist/src/prompts/instructions_to_create_lesson_video.d.ts +0 -1
  15. package/dist/src/prompts/instructions_to_translate_actions.d.ts +0 -2
  16. package/dist/src/resources/get_action_names.d.ts +0 -4
  17. package/dist/src/resources/get_example_actions_array_by_keyword.d.ts +0 -1
  18. package/dist/src/resources/get_example_lessons_by_keyword.d.ts +0 -1
  19. package/dist/src/rest-server/index.d.ts +0 -24
  20. package/dist/src/rest-server/job-manager.d.ts +0 -56
  21. package/dist/src/rest-server/mcp-client.d.ts +0 -23
  22. package/dist/src/rest-server/rest-server.d.ts +0 -24
  23. package/dist/src/rest-server/server.d.ts +0 -4
  24. package/dist/src/tools/add_actions_to_lesson.d.ts +0 -2
  25. package/dist/src/tools/add_final_snapshot_to_lesson.d.ts +0 -2
  26. package/dist/src/tools/add_initial_snapshot_to_lesson.d.ts +0 -2
  27. package/dist/src/tools/add_lesson_to_course.d.ts +0 -2
  28. package/dist/src/tools/create_course_with_initial_metadata.d.ts +0 -1
  29. package/dist/src/tools/critique_video_using_gemini.d.ts +0 -2
  30. package/dist/src/tools/get_current_actions.d.ts +0 -3
  31. package/dist/src/tools/get_current_lesson.d.ts +0 -3
  32. package/dist/src/tools/get_empty_lesson_snapshot.d.ts +0 -1
  33. package/dist/src/tools/get_final_lesson_snapshot.d.ts +0 -2
  34. package/dist/src/tools/get_initial_lesson_state_from_github_repo.d.ts +0 -1
  35. package/dist/src/tools/get_initial_lesson_state_from_local_repo.d.ts +0 -1
  36. package/dist/src/tools/is_repeatable_action.d.ts +0 -2
  37. package/dist/src/tools/make_blog_post.d.ts +0 -2
  38. package/dist/src/tools/make_html_web_page.d.ts +0 -2
  39. package/dist/src/tools/make_video_from_actions.d.ts +0 -8
  40. package/dist/src/tools/make_video_from_lesson.d.ts +0 -8
  41. package/dist/src/tools/set_current_actions.d.ts +0 -2
  42. package/dist/src/tools/set_current_lesson.d.ts +0 -2
  43. package/dist/src/tools/validate_actions.d.ts +0 -6
  44. package/dist/src/utils/getBinaryPath.d.ts +0 -1
package/README.md CHANGED
@@ -17,14 +17,30 @@ Conversion:
17
17
  - "Please convert these CodeVideo JSON actions to a video"
18
18
  - "Convert these CodeVideo JSON actions to a blog post"
19
19
  - "Convert these CodeVideo JSON actions to HTML"
20
- - "Can you convert this lesson to one in Spanish?"
20
+ - "Can you convert this English-based lesson to Spanish?"
21
21
 
22
22
  Validation:
23
23
 
24
24
  - "Are these CodeVideo JSON actions valid?"
25
25
 
26
+ ## Requirements
27
+
28
+ - Node.js 22.13 or newer. The MCP keeps its data in SQLite through Node's built-in `node:sqlite`, so nothing native is compiled on install.
29
+ - For videos: the npm package installs the matching native CodeVideo CLI automatically, and rendering also needs Chrome/Chromium and FFmpeg.
30
+ - For narration, one of:
31
+ - **ElevenLabs:** `ELEVEN_LABS_API_KEY` (and optionally `ELEVEN_LABS_VOICE_ID`). The CLI uploads each clip to CodeVideo's S3 bucket, so this also needs `CODEVIDEO_S3_KEY_ID` and `CODEVIDEO_S3_SECRET` with access to it.
32
+ - **Kokoro** (self-hosted, no cloud account): `CODEVIDEO_TTS_PROVIDER=kokoro` and `TTS_SERVICE_URL` pointing at a codevideo-tts (Kokoro) service. Clips are embedded in the video job directly.
33
+
26
34
  ## Usage with Claude Desktop
27
35
 
36
+ Validate the host first with:
37
+
38
+ ```shell
39
+ npx @fullstackcraftllc/codevideo-cli doctor
40
+ ```
41
+
42
+ If Chrome is not detected, run `npx @fullstackcraftllc/codevideo-cli install-browser`. `PATH_TO_CODEVIDEO_CLI` remains available as an optional override for local CLI builds.
43
+
28
44
  Simply drop the following into your `claude_desktop_config.json` file:
29
45
 
30
46
  ```json
@@ -37,20 +53,84 @@ Simply drop the following into your `claude_desktop_config.json` file:
37
53
  "@fullstackcraftllc/codevideo-mcp@latest"
38
54
  ],
39
55
  "env": {
40
- "ELEVENLABS_API_KEY": "your-elevenlabs-api-key",
41
- "ELEVENLABS_VOICE_ID": "your-elevenlabs-voice-id"
56
+ "CODEVIDEO_TTS_PROVIDER": "kokoro",
57
+ "TTS_SERVICE_URL": "http://localhost:3000"
42
58
  }
43
59
  },
44
60
  // ... other MCP servers
45
61
  }
46
62
  ```
47
63
 
64
+ (Or the ElevenLabs and S3 variables from [Requirements](#requirements) instead of the two Kokoro ones.)
65
+
66
+ ## Usage with Codex
67
+
68
+ Add the published MCP server to `~/.codex/config.toml`:
69
+
70
+ ```toml
71
+ [mcp_servers.codevideo]
72
+ command = "npx"
73
+ args = ["-y", "@fullstackcraftllc/codevideo-mcp@latest"]
74
+ startup_timeout_sec = 60
75
+ env_vars = ["CODEVIDEO_TTS_PROVIDER", "TTS_SERVICE_URL", "ELEVEN_LABS_API_KEY", "ELEVEN_LABS_VOICE_ID", "CODEVIDEO_S3_KEY_ID", "CODEVIDEO_S3_SECRET", "GEMINI_API_KEY"]
76
+ ```
77
+
78
+ Restart Codex or open a new thread after changing MCP configuration.
79
+
48
80
  Be sure to restart Claude after modifying this config!
49
81
 
50
82
  After restarting Claude Desktop, if installation was successful, you should see `codevideo-mcp` in the list of installed MCPs:
51
83
 
52
84
  ![codevideo-mnp successfully installed in Claude Desktop](./codevideo-mcp-installed.png)
53
85
 
86
+ ## Building a course
87
+
88
+ For anything longer than one lesson, start with the `codevideo_instructions_to_build_course_from_scratch` prompt tool. The course lives in the MCP, keyed by id, so the model writes each lesson's actions once and never carries snapshots or earlier lessons in its context:
89
+
90
+ 1. `codevideo_create_course` returns a `courseId`; `codevideo_add_lesson` adds lessons, each continuing from the previous one's final state by default.
91
+ 2. `codevideo_set_lesson_actions` stores a lesson's actions. To change part of a lesson later, `codevideo_edit_lesson_actions` applies splice-style edits, and `codevideo_get_lesson_actions` reads actions back a slice at a time.
92
+ 3. `codevideo_get_lesson_file_tree`, `codevideo_get_lesson_file` and `codevideo_compile_lesson` read and check the code at the end of a lesson without pulling snapshots.
93
+ 4. `codevideo_validate_course` returns `done: true` once every lesson is valid, continuous, and compiles where it should. Previews and videos refuse to run before that. It also rejects actions that change files with nothing on screen causing them (`file-explorer-create-file` and similar), because in the video the file would just appear. Lessons make files with the mouse (right-click, New File) or with `touch` in the terminal.
94
+ 5. `codevideo_generate_course_previews` writes an HTML page per lesson to review; `codevideo_render_course_videos` then renders every lesson.
95
+ 6. `codevideo_get_course_status` shows where things stand, with an estimated length per lesson; `codevideo_export_course` writes the whole course to a JSON file and returns its path.
96
+
97
+ The model learns the actions from `codevideo_get_action_names`, which lists each one with what it does and what its value takes, straight from codevideo-types.
98
+
99
+ The older single-slot tools (`codevideo_set_current_actions`, `codevideo_set_current_lesson` and the tools that read them) still work for single videos. Every conversation shares their one slot, though, so use the course tools for anything bigger.
100
+
101
+ ## Rendering videos
102
+
103
+ Every video tool (`codevideo_make_video_from_actions`, `codevideo_make_video_from_lesson`, `codevideo_render_lesson_video`, `codevideo_render_course_videos`) queues a render job and returns at once with a `jobId`. A background worker renders the queue one video at a time, and keeps going if you close Claude or Codex.
104
+
105
+ - `codevideo_get_render_job` shows a job's status (queued, running, succeeded, failed, cancelled or interrupted), its latest progress line, the saved file, any error, and the end of the CLI's log.
106
+ - `codevideo_list_render_jobs` lists recent jobs, for one course or all.
107
+ - `codevideo_cancel_render_job` cancels one job, or everything unfinished in a course, stopping the browser too.
108
+
109
+ All four video tools take the same `options`:
110
+
111
+ | Option | Values |
112
+ | --- | --- |
113
+ | `orientation` | `landscape` (default) or `portrait` (1080×1920) |
114
+ | `theme` | `dark` or `light` |
115
+ | `isFileExplorerVisible`, `isTerminalVisible`, `isEditorTabsVisible`, `isMinimapVisible`, `isMouseVisible`, `withCaptions` | `true` / `false`; for portrait, usually hide the explorer, tabs, minimap and mouse |
116
+ | `fontSizePx`, `fileExplorerWidth`, `terminalHeight`, `mouseColor`, `wordWrap`, `defaultLanguage` | IDE layout |
117
+ | `keyboardTypingPauseMs`, `standardPauseMs`, `longPauseMs` | pacing |
118
+ | `voiceId`, `ttsProvider` | narration voice and provider |
119
+ | `renderMode` | `realtime` (default) or `deterministic`; `renderSeed` and `renderWorkers` (1–32) apply to deterministic renders |
120
+
121
+ They also take `open`: whether to open the finished video in your default player. It defaults to on for single videos and off for whole courses.
122
+
123
+ Videos are saved to `CODEVIDEO_OUTPUT_DIR`, or your Desktop.
124
+
125
+ ## Where your data lives
126
+
127
+ Everything is under `~/.codevideo/`:
128
+
129
+ - `codevideo.db`: courses, lessons, the legacy single slot, and the render queue.
130
+ - `jobs/<jobId>/`: each render's project, settings and CLI logs (`stdout.log`, `stderr.log`); `jobs/worker.log` is the worker's own log.
131
+ - `exports/`: course exports.
132
+ - `previews/`: lesson previews.
133
+
54
134
  ## Local Development
55
135
 
56
136
  Clone this repository:
@@ -67,6 +147,13 @@ npm install
67
147
  npm run build
68
148
  ```
69
149
 
150
+ Run the tests (type-check, unit and integration tests with a fake CLI, and the token-flatness check) with:
151
+
152
+ ```shell
153
+ npm run type-check
154
+ npm test
155
+ ```
156
+
70
157
  Then, use the following JSON to run the local version on your Claude Desktop:
71
158
 
72
159
  ```json
@@ -78,12 +165,18 @@ Then, use the following JSON to run the local version on your Claude Desktop:
78
165
  "/path/to/your/clone/of/codevideo-mcp/src/index.ts"
79
166
  ],
80
167
  "env": {
81
- "PATH_TO_CODEVIDEO_CLI": "/path/to/your/codevideo-cli",
168
+ "ELEVEN_LABS_API_KEY": "your-elevenlabs-api-key",
169
+ "ELEVEN_LABS_VOICE_ID": "your-elevenlabs-voice-id"
82
170
  }
83
171
  }
84
172
  // ... other MCP servers
85
173
  ```
86
174
 
175
+ ### Experimental REST server
176
+
177
+ `src/rest-server` holds an experimental REST and agent server (`npm run rest-server`). It isn't part of the published package; its dependencies are dev dependencies, and parts of it (the agent loop, the job manager) are still simulated.
178
+
87
179
  ## Known Issues
88
180
 
89
- - Currently, creating entire courses seems to be a bit flakey and perhaps too large for the context window for Claude. We're working on refining the full course flow. Single lesson, or action array generation both seem to work well.
181
+ - Compile checks can't resolve third-party packages yet: a lesson that imports `react` reports "Cannot find module 'react'", so courses that depend on npm packages can't pass `codevideo_validate_course`.
182
+ - With CLI 0.0.13, a project is passed to the CLI on its command line, so a single lesson is limited to about 120 KiB as JSON (about 30 KB on Windows). The MCP refuses bigger ones with a clear message.
@@ -0,0 +1,3 @@
1
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
+
3
+ export declare function createMcpServer(): McpServer;