@velt-js/mcp-installer 0.1.0 → 0.2.1

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
@@ -2,36 +2,27 @@
2
2
 
3
3
  An MCP (Model Context Protocol) server that provides AI-assisted installation of Velt collaboration features into React and Next.js projects.
4
4
 
5
- ## Setup
5
+ ## Part of the Velt Plugin Pipeline
6
6
 
7
- Add the Velt MCP server to your coding IDE. Pick the section that matches your editor.
8
-
9
- ### Claude Code
10
-
11
- Run this command in your terminal:
12
-
13
- ```bash
14
- claude mcp add velt-installer -- npx -y @velt-js/mcp-installer
7
+ ```
8
+ Velt Plugin (Cursor/Claude) → registers this MCP server
9
+
10
+ This MCP Installer → orchestrates guided setup
11
+ runs
12
+ Velt CLI (@velt-js/add-velt) → scaffolds files + installs deps
13
+ ↓ references
14
+ Agent Skills → implementation patterns (118 rules)
15
15
  ```
16
16
 
17
- ### Cursor
17
+ If you're using the [Velt Cursor plugin](https://github.com/velt-js/velt-plugin), this MCP server is **auto-registered** — you don't need to configure it manually.
18
18
 
19
- Add to `.cursor/mcp.json` in your project (or global config):
19
+ ## Manual Setup (without plugin)
20
20
 
21
- ```json
22
- {
23
- "mcpServers": {
24
- "velt-installer": {
25
- "command": "npx",
26
- "args": ["-y", "@velt-js/mcp-installer"]
27
- }
28
- }
29
- }
30
- ```
21
+ If you're not using the Velt plugin, add the MCP server to your IDE:
31
22
 
32
- ### Windsurf
23
+ ### Cursor
33
24
 
34
- Add to your Windsurf MCP config:
25
+ Add to `.cursor/mcp.json`:
35
26
 
36
27
  ```json
37
28
  {
@@ -44,33 +35,19 @@ Add to your Windsurf MCP config:
44
35
  }
45
36
  ```
46
37
 
47
- ### Claude Desktop
48
-
49
- Add to `~/Library/Application Support/Claude/claude_desktop_config.json` (macOS) or `%APPDATA%\Claude\claude_desktop_config.json` (Windows):
38
+ ### Claude Code
50
39
 
51
- ```json
52
- {
53
- "mcpServers": {
54
- "velt-installer": {
55
- "command": "npx",
56
- "args": ["-y", "@velt-js/mcp-installer"]
57
- }
58
- }
59
- }
40
+ ```bash
41
+ claude mcp add velt-installer -- npx -y @velt-js/mcp-installer
60
42
  ```
61
43
 
62
- ### Any other MCP-compatible IDE
63
-
64
- The server runs over stdio. Use this command:
44
+ ### Any MCP-compatible IDE
65
45
 
46
+ The server runs over stdio:
66
47
  ```
67
48
  npx -y @velt-js/mcp-installer
68
49
  ```
69
50
 
70
- Add it to your IDE's MCP server configuration with `command: "npx"` and `args: ["-y", "@velt-js/mcp-installer"]`.
71
-
72
- ---
73
-
74
51
  After adding the config, **restart your IDE** to load the MCP server.
75
52
 
76
53
  ## Usage
@@ -82,7 +59,6 @@ install velt
82
59
  ```
83
60
 
84
61
  The AI will walk you through:
85
-
86
62
  1. Confirming your project directory
87
63
  2. Providing your Velt API key and auth token (from https://console.velt.dev)
88
64
  3. Selecting features (or typing SKIP for CLI-only mode)
@@ -91,282 +67,45 @@ The AI will walk you through:
91
67
  6. Reviewing the implementation plan
92
68
  7. Approving and applying the plan
93
69
 
94
- ## Installation Modes
95
-
96
- ### Guided Mode (Default)
97
-
98
- Full interactive installation with plan generation and user approval:
99
-
100
- 1. Confirm project directory (validates React/Next.js project)
101
- 2. Provide API key and auth token
102
- 3. Select features (comments, presence, cursors, notifications, recorder, CRDT)
103
- 4. Choose VeltProvider location (app/page.tsx recommended)
104
- 5. Choose corner position for Velt features (top-left/top-right/bottom-left/bottom-right)
105
- 6. Tool generates implementation plan
106
- 7. User reviews and approves the plan
107
- 8. AI applies the plan step-by-step
108
- 9. Full QA validation
109
-
110
- ### CLI-Only Mode (SKIP)
111
-
112
- Fast scaffolding without feature integration:
113
-
114
- 1. Confirm project directory
115
- 2. Provide API key and auth token
116
- 3. Type **SKIP** at feature selection
117
- 4. Velt CLI runs, creates scaffold files
118
- 5. Basic QA validation
119
- 6. TODO checklist for manual setup
70
+ ## Prerequisite: Agent Skills
120
71
 
121
- **When to use SKIP:**
122
- - You're experienced with Velt
123
- - You want to wire features yourself
124
- - You just need the base files
125
-
126
- ## How SKIP Works
127
-
128
- At the feature selection prompt (Step 4), the AI will show:
129
-
130
- ```
131
- Select features to install OR type SKIP for CLI-only:
132
-
133
- Comments (specify type: freestyle/popover/page/text/inline/tiptap/lexical/slate)
134
- Presence
135
- Cursors
136
- Notifications
137
- Recorder
138
- CRDT (specify editor: tiptap/codemirror/blocknote)
139
-
140
- SKIP = CLI scaffolding only, no feature integration
141
- ```
142
-
143
- If you type `SKIP` (case-insensitive):
144
- - Runs Velt CLI scaffolding (creates base files)
145
- - Runs basic QA validation
146
- - Returns TODO checklist for manual setup
147
- - Does NOT generate an implementation plan
148
- - Does NOT modify project files beyond CLI scaffolding
149
-
150
- ## Plan/Apply Workflow (Guided Mode)
151
-
152
- The guided mode uses a multi-step workflow with **discovery consent** and **verification**:
153
-
154
- ```
155
- PHASE 1: COLLECT INFO (AI asks questions one at a time)
156
- Step 1: Confirm project directory
157
- Step 2: Get API key
158
- Step 3: Get auth token
159
- Step 4: Select features (or type SKIP)
160
- Step 5: Choose VeltProvider location
161
- Step 6: Choose corner position
162
-
163
- PHASE 2: CLI + DISCOVERY CONSENT
164
- Tool Call #1: mode="guided", stage="plan"
165
- -> Run CLI + Scan Codebase
166
- -> status="awaiting_discovery_consent"
167
- AI asks: "Scan codebase for wiring info? [YES/NO]"
168
-
169
- PHASE 3A: SCAN PATH (if YES)
170
- Tool Call #2: discoveryConsent="yes"
171
- -> Run Discovery Scan
172
- -> status="awaiting_discovery_verification"
173
- AI shows findings, asks: "Verify? [CONFIRM ALL/EDIT/UNSURE]"
174
- Tool Call #3: discoveryVerification={status:"confirmed"}
175
- -> Proceeds to PHASE 4
176
-
177
- PHASE 3B: MANUAL PATH (if NO)
178
- Tool Call #2: discoveryConsent="no"
179
- -> status="awaiting_manual_wiring_answers"
180
- AI asks questionnaire (document ID, user auth, JWT, init location)
181
- Tool Call #3: manualWiring={...}
182
- -> Proceeds to PHASE 4
183
-
184
- PHASE 4: PLAN GENERATION
185
- -> Generate Plan with Wiring
186
- -> status="plan_generated"
187
- AI presents plan, asks: "Would you like me to implement?"
188
-
189
- PHASE 5: APPLY
190
- Tool Call #4: mode="guided", stage="apply", approved=true
191
- -> Full QA Validation
192
- -> status="apply_complete"
193
- ```
194
-
195
- ### Tool Response Statuses
196
-
197
- | Status | Meaning | Next Action |
198
- |--------|---------|-------------|
199
- | `awaiting_discovery_consent` | CLI done, need YES/NO for scanning | Ask user, call with `discoveryConsent` |
200
- | `awaiting_discovery_verification` | Scan done, need verification | Show findings, call with `discoveryVerification` |
201
- | `awaiting_manual_wiring_answers` | User said NO, need questionnaire | Ask questionnaire, call with `manualWiring` |
202
- | `plan_generated` | Plan ready with verified/manual wiring | Present plan, ask approval |
203
- | `apply_complete` | Installation complete | Show results |
204
- | `cli_only_complete` | SKIP mode complete | Show TODO checklist |
205
-
206
- ## Generated Code Pattern
207
-
208
- The installer follows this architecture pattern (based on Velt sample apps):
209
-
210
- ### File Structure
211
-
212
- ```
213
- app/
214
- ├── layout.tsx # Wraps with AppUserProvider
215
- ├── page.tsx # Contains VeltProvider with authProvider hook
216
- └── userAuth/
217
- ├── AppUserContext.tsx # User context provider
218
- └── useAppUser.tsx # User data hook
219
-
220
- components/velt/
221
- ├── VeltInitializeUser.tsx # Exports useVeltAuthProvider hook
222
- ├── VeltInitializeDocument.tsx # Exports useCurrentDocument hook
223
- └── VeltCollaboration.tsx # All Velt feature components
224
-
225
- app/api/velt/token/
226
- └── route.ts # JWT token generation API
227
- ```
228
-
229
- ### layout.tsx Pattern
230
-
231
- ```tsx
232
- import { AppUserProvider } from './userAuth/AppUserContext'
233
-
234
- export default function RootLayout({ children }) {
235
- return (
236
- <html><body>
237
- <AppUserProvider>{children}</AppUserProvider>
238
- </body></html>
239
- )
240
- }
241
- ```
242
-
243
- ### page.tsx Pattern
244
-
245
- ```tsx
246
- "use client";
247
- import { VeltProvider } from '@veltdev/react';
248
- import { useVeltAuthProvider } from '@/components/velt/VeltInitializeUser';
249
- import { useCurrentDocument } from '@/components/velt/VeltInitializeDocument';
250
- import { VeltCollaboration } from '@/components/velt/VeltCollaboration';
251
-
252
- export default function Page() {
253
- const { authProvider } = useVeltAuthProvider();
254
- const { documentId } = useCurrentDocument();
255
-
256
- return (
257
- <VeltProvider apiKey={VELT_API_KEY} authProvider={authProvider}>
258
- <VeltCollaboration documentId={documentId} />
259
- {/* Your page content */}
260
- </VeltProvider>
261
- );
262
- }
263
- ```
264
-
265
- ### Corner Positioning
266
-
267
- All Velt feature components (presence, notifications, comments sidebar) are grouped in the user's chosen corner:
268
-
269
- ```tsx
270
- // VeltCollaboration.tsx
271
- <div className="fixed top-4 right-4 z-50 flex flex-col gap-2">
272
- <VeltPresence />
273
- <VeltNotificationsTool />
274
- <VeltCommentsSidebar />
275
- </div>
276
- <VeltCursor />
277
- ```
278
-
279
- ## Source Priority: Agent Skills First
280
-
281
- The MCP uses a three-tier source priority system for implementation guidance:
282
-
283
- ### Prerequisite
284
-
285
- Install Velt Agent Skills into your AI editor:
72
+ For best results, install the Velt agent-skills library:
286
73
 
287
74
  ```bash
288
75
  npx skills add velt-js/agent-skills
289
76
  ```
290
77
 
291
- This installs four skills:
292
- - `velt-setup-best-practices` — VeltProvider setup, authentication, document identity, project structure
293
- - `velt-comments-best-practices` — All comment types (freestyle, popover, page, text, tiptap, lexical, slate)
294
- - `velt-crdt-best-practices` — Tiptap, BlockNote, CodeMirror, ReactFlow CRDT patterns
295
- - `velt-notifications-best-practices` — Notification setup, customization, delivery
296
-
297
- ### Source Priority Order
298
-
299
- | Priority | Source | When to Use |
300
- |----------|--------|-------------|
301
- | 1 (Primary) | **Agent Skills** | Always use first for features with skills coverage |
302
- | 2 (Secondary) | **Docs URLs** (docs.velt.dev) | Only for features WITHOUT skills: presence, cursors, recorder |
303
- | 3 (Tertiary) | **Velt Docs MCP** | Only for user follow-up questions AFTER implementation |
78
+ The installer generates plans that reference these skills by name. Without them, the AI falls back to embedded rules (concise summaries).
304
79
 
305
- ## Host App Wiring Discovery
306
-
307
- The guided mode includes automatic discovery of integration points in your codebase:
308
-
309
- ### What It Scans For
80
+ ## Installation Modes
310
81
 
311
- 1. **Document ID Source**: Dynamic route params, query params, database fetches, state variables
312
- 2. **User Authentication**: Next-Auth, Clerk, Auth0, Firebase Auth, Supabase Auth, custom auth
313
- 3. **Setup Location**: Root layout, specific pages, custom providers
314
- 4. **JWT Authentication**: Token generation endpoints, bearer auth patterns
82
+ ### Guided Mode (Default)
315
83
 
316
- If it can't determine something with confidence, it emits explicit questions rather than guessing.
84
+ Full interactive installation with plan generation, codebase scanning, and user approval. The plan references specific agent-skills rules for each implementation step.
317
85
 
318
- ## Framework Support
86
+ ### CLI-Only Mode (SKIP)
319
87
 
320
- | Framework | Support Level | "use client" Directives |
321
- |-----------|--------------|------------------------|
322
- | **Next.js (App Router)** | Full | Auto-applied |
323
- | **Next.js (Pages Router)** | Full | N/A |
324
- | **Vite + React** | Full | Not needed |
325
- | **Create React App** | Full | Not needed |
326
- | **Plain React** | Full | Not needed |
88
+ Type **SKIP** at feature selection for quick scaffolding without guided setup.
327
89
 
328
- ## Available Tools
90
+ ## Available MCP Tools
329
91
 
330
92
  | Tool | Description |
331
93
  |------|-------------|
332
- | `install_velt_interactive` | Unified installer with guided or CLI-only mode |
333
- | `install_velt_freestyle` | Legacy installer for basic freestyle comments |
94
+ | `install_velt_interactive` | Guided or CLI-only installation |
334
95
  | `take_project_screenshot` | Capture screenshot of running app |
335
- | `detect_comment_placement` | Analyze project structure for comment placement |
96
+ | `detect_comment_placement` | Analyze project for comment placement |
336
97
 
337
- ## Features
98
+ ## Features Supported
338
99
 
339
- - Guided mode with plan generation and user approval
340
- - CLI-only mode (SKIP) for quick scaffolding
341
- - Comments (8 types: freestyle, popover, page, text, inline, tiptap, lexical, slate)
342
- - Presence (live user avatars)
343
- - Cursors (real-time cursor tracking)
344
- - Notifications
345
- - Recorder
346
- - CRDT (collaborative editing: Tiptap, CodeMirror, BlockNote)
347
- - Basic and full integration validation
348
- - Automatic framework detection
349
- - "use client" directive handling for Next.js
100
+ Comments (8 types), Presence, Cursors, Notifications, Recorder, CRDT (Tiptap, CodeMirror, BlockNote, ReactFlow)
350
101
 
351
- ## Development
102
+ ## Related Repositories
352
103
 
353
- ```bash
354
- # Clone the repo
355
- git clone https://github.com/velt-js/mcp-installer.git
356
- cd mcp-installer
357
-
358
- # Install dependencies
359
- npm install
360
-
361
- # Start the server (stdio)
362
- npm start
363
-
364
- # Watch mode
365
- npm run dev
366
-
367
- # Test JSON-RPC
368
- echo '{"jsonrpc":"2.0","method":"tools/list","id":1}' | node bin/mcp-server.js
369
- ```
104
+ | Repository | Role |
105
+ |-----------|------|
106
+ | [velt-js/velt-plugin](https://github.com/velt-js/velt-plugin) | Cursor and Claude plugins (registers this MCP server) |
107
+ | [velt-js/agent-skills](https://github.com/velt-js/agent-skills) | Implementation rules referenced by the installer plans |
108
+ | [velt-js/add-velt-next-js](https://github.com/velt-js/add-velt-next-js) | CLI scaffolder invoked by this installer |
370
109
 
371
110
  ## License
372
111
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@velt-js/mcp-installer",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "MCP server for AI-assisted installation of Velt collaboration features into React and Next.js projects",
5
5
  "type": "module",
6
6
  "main": "src/index.js",
package/src/utils/cli.js CHANGED
@@ -148,7 +148,7 @@ export async function runVeltCli({
148
148
  }
149
149
 
150
150
  // Build npx command
151
- const npxArgs = ['@velt-js/add-velt', ...flags];
151
+ const npxArgs = ['@velt-js/add-velt@latest', ...flags];
152
152
  const fullCommand = `npx ${npxArgs.join(' ')}`;
153
153
 
154
154
  console.error('\n ═══════════════════════════════════════════════════════════');
@@ -355,7 +355,7 @@ export async function runVeltCliCoreOnly({
355
355
  export function getCliResolutionInfo() {
356
356
  return {
357
357
  method: 'npx',
358
- command: 'npx @velt-js/add-velt',
358
+ command: 'npx @velt-js/add-velt@latest',
359
359
  path: null,
360
360
  };
361
361
  }