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