fastmode-mcp 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.
Files changed (67) hide show
  1. package/README.md +561 -0
  2. package/bin/run.js +50 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +802 -0
  6. package/dist/lib/api-client.d.ts +81 -0
  7. package/dist/lib/api-client.d.ts.map +1 -0
  8. package/dist/lib/api-client.js +237 -0
  9. package/dist/lib/auth-state.d.ts +13 -0
  10. package/dist/lib/auth-state.d.ts.map +1 -0
  11. package/dist/lib/auth-state.js +24 -0
  12. package/dist/lib/context-fetcher.d.ts +67 -0
  13. package/dist/lib/context-fetcher.d.ts.map +1 -0
  14. package/dist/lib/context-fetcher.js +190 -0
  15. package/dist/lib/credentials.d.ts +52 -0
  16. package/dist/lib/credentials.d.ts.map +1 -0
  17. package/dist/lib/credentials.js +196 -0
  18. package/dist/lib/device-flow.d.ts +14 -0
  19. package/dist/lib/device-flow.d.ts.map +1 -0
  20. package/dist/lib/device-flow.js +244 -0
  21. package/dist/tools/cms-items.d.ts +56 -0
  22. package/dist/tools/cms-items.d.ts.map +1 -0
  23. package/dist/tools/cms-items.js +376 -0
  24. package/dist/tools/create-site.d.ts +9 -0
  25. package/dist/tools/create-site.d.ts.map +1 -0
  26. package/dist/tools/create-site.js +202 -0
  27. package/dist/tools/deploy-package.d.ts +9 -0
  28. package/dist/tools/deploy-package.d.ts.map +1 -0
  29. package/dist/tools/deploy-package.js +434 -0
  30. package/dist/tools/generate-samples.d.ts +19 -0
  31. package/dist/tools/generate-samples.d.ts.map +1 -0
  32. package/dist/tools/generate-samples.js +272 -0
  33. package/dist/tools/get-conversion-guide.d.ts +7 -0
  34. package/dist/tools/get-conversion-guide.d.ts.map +1 -0
  35. package/dist/tools/get-conversion-guide.js +1323 -0
  36. package/dist/tools/get-example.d.ts +7 -0
  37. package/dist/tools/get-example.d.ts.map +1 -0
  38. package/dist/tools/get-example.js +1568 -0
  39. package/dist/tools/get-field-types.d.ts +30 -0
  40. package/dist/tools/get-field-types.d.ts.map +1 -0
  41. package/dist/tools/get-field-types.js +154 -0
  42. package/dist/tools/get-schema.d.ts +5 -0
  43. package/dist/tools/get-schema.d.ts.map +1 -0
  44. package/dist/tools/get-schema.js +320 -0
  45. package/dist/tools/get-started.d.ts +21 -0
  46. package/dist/tools/get-started.d.ts.map +1 -0
  47. package/dist/tools/get-started.js +624 -0
  48. package/dist/tools/get-tenant-schema.d.ts +18 -0
  49. package/dist/tools/get-tenant-schema.d.ts.map +1 -0
  50. package/dist/tools/get-tenant-schema.js +158 -0
  51. package/dist/tools/list-projects.d.ts +5 -0
  52. package/dist/tools/list-projects.d.ts.map +1 -0
  53. package/dist/tools/list-projects.js +101 -0
  54. package/dist/tools/sync-schema.d.ts +41 -0
  55. package/dist/tools/sync-schema.d.ts.map +1 -0
  56. package/dist/tools/sync-schema.js +483 -0
  57. package/dist/tools/validate-manifest.d.ts +5 -0
  58. package/dist/tools/validate-manifest.d.ts.map +1 -0
  59. package/dist/tools/validate-manifest.js +311 -0
  60. package/dist/tools/validate-package.d.ts +5 -0
  61. package/dist/tools/validate-package.d.ts.map +1 -0
  62. package/dist/tools/validate-package.js +337 -0
  63. package/dist/tools/validate-template.d.ts +12 -0
  64. package/dist/tools/validate-template.d.ts.map +1 -0
  65. package/dist/tools/validate-template.js +790 -0
  66. package/package.json +54 -0
  67. package/scripts/postinstall.js +129 -0
package/README.md ADDED
@@ -0,0 +1,561 @@
1
+ # Fast Mode MCP Server
2
+
3
+ An MCP (Model Context Protocol) server that enables AI assistants to convert, validate, and deploy websites to [Fast Mode](https://fastmode.ai).
4
+
5
+ ## What is Fast Mode?
6
+
7
+ Fast Mode is a modern CMS platform that turns static HTML websites into fully editable, content-managed sites. Unlike traditional CMSs that force you into their templates, Fast Mode works with **your existing design** — just add simple template tokens and your site becomes editable.
8
+
9
+ ### Key Features
10
+
11
+ - **Keep Your Design** — Use any HTML/CSS. No themes, no page builders, no compromises.
12
+ - **Custom Collections** — Create any content type you need (blog posts, team members, products, etc.)
13
+ - **Visual Editor** — Edit content directly on your live site.
14
+ - **Instant Deploy** — Push from GitHub or upload directly. Sites go live in seconds.
15
+ - **Forms & Submissions** — Collect form data without any backend code.
16
+ - **Custom Domains** — Use your own domain with automatic SSL.
17
+
18
+ ### Links
19
+
20
+ - **Website:** [fastmode.ai](https://fastmode.ai)
21
+ - **Dashboard:** [app.fastmode.ai](https://app.fastmode.ai)
22
+ - **Documentation:** [docs.fastmode.ai](https://docs.fastmode.ai)
23
+
24
+ ---
25
+
26
+ ## MCP Server Tools
27
+
28
+ This MCP server provides tools for AI assistants (Claude, Cursor, etc.) to help you convert websites to Fast Mode format and deploy them.
29
+
30
+ ### IMPORTANT: Start with get_started
31
+
32
+ The `get_started` tool is your entry point for any task. It automatically:
33
+ - Checks authentication status
34
+ - Lists your projects with status
35
+ - Shows collection/field details
36
+ - Returns the exact workflow for your task
37
+
38
+ ```
39
+ get_started(intent: "add_content", projectId: "my-project")
40
+ ```
41
+
42
+ **Available intents:**
43
+ | Intent | Use Case |
44
+ |--------|----------|
45
+ | `explore` | See what projects and content exist |
46
+ | `add_content` | Create/edit CMS items (blog posts, team, etc.) |
47
+ | `update_schema` | Add collections or fields |
48
+ | `convert` | Build a new website from scratch |
49
+ | `deploy` | Push changes live |
50
+
51
+ ### Validation Tools (No Auth Required)
52
+
53
+ These tools work without authentication — perfect for converting and validating websites before deploying:
54
+
55
+ | Tool | Description |
56
+ |------|-------------|
57
+ | `get_started` | **CALL FIRST** - Checks state and returns exact workflow |
58
+ | `get_field_types` | Get available field types for creating custom fields |
59
+ | `validate_manifest` | Validate your manifest.json file |
60
+ | `validate_template` | Check HTML templates for correct token usage, form handling, and schema validation |
61
+ | `validate_package` | Validate complete package structure |
62
+ | `get_example` | Get example code for common patterns |
63
+ | `get_conversion_guide` | Step-by-step website conversion guide |
64
+
65
+ ### MCP Resources (Alternative to Tools)
66
+
67
+ The server also exposes static content as **MCP Resources** that can be browsed and fetched:
68
+
69
+ | Resource URI | Description |
70
+ |--------------|-------------|
71
+ | `fastmode://help` | Quick start guide |
72
+ | `fastmode://reference/field-types` | Available field types for creating collections |
73
+ | `fastmode://guide/{section}` | Conversion guide sections (full, first_steps, analysis, structure, seo, manifest, templates, tokens, forms, assets, checklist, common_mistakes) |
74
+ | `fastmode://examples/{type}` | Code examples (manifest_basic, blog_post_template, form_handling, etc.) |
75
+
76
+ Resources provide the same content as `get_field_types`, `get_conversion_guide`, and `get_example` tools but in a browsable format.
77
+
78
+ ### What validate_template Checks
79
+
80
+ The `validate_template` tool performs comprehensive validation:
81
+
82
+ **Token Validation:**
83
+ - Balanced `{{#each}}`, `{{#if}}`, `{{#unless}}` blocks
84
+ - Proper triple braces for richText fields (`{{{body}}}`)
85
+ - Asset paths with `/public/` prefix
86
+ - YouTube iframe required attributes
87
+
88
+ **Form Validation (v1.5.0+):**
89
+ - `data-form` attribute on forms (error if missing)
90
+ - Input `name` attributes (error if missing - data won't be captured)
91
+ - Submit button presence (warning)
92
+ - Deprecation warning for legacy `data-form-name` attribute
93
+ - Suggestion to create a thank-you page
94
+
95
+ **Static Page Validation:**
96
+ - Detects `{{#each collection}}` loops (e.g., featured posts on homepage)
97
+ - Validates referenced collections exist in schema
98
+ - Error if collections don't exist with `sync_schema` instructions
99
+
100
+ **Schema Validation (when authenticated):**
101
+ - Checks all tokens against actual project schema
102
+ - Reports missing fields with exact `sync_schema` call to create them
103
+
104
+ ### Authenticated Tools
105
+
106
+ These tools require a Fast Mode account. The MCP server will automatically open your browser for login when needed:
107
+
108
+ | Tool | Description |
109
+ |------|-------------|
110
+ | `list_projects` | List all your Fast Mode projects |
111
+ | `get_tenant_schema` | Get schema for a specific project (including custom fields) |
112
+ | `create_site` | Create a new Fast Mode project |
113
+ | `deploy_package` | Deploy a website package to Fast Mode |
114
+ | `sync_schema` | Create collections and fields in your project |
115
+ | `generate_sample_items` | Generate placeholder content for collections |
116
+
117
+ ### CMS Item Management Tools
118
+
119
+ Manage content directly from your AI assistant:
120
+
121
+ | Tool | Description |
122
+ |------|-------------|
123
+ | `create_cms_item` | Create a new item in a collection (blog post, team member, etc.) |
124
+ | `list_cms_items` | List items in a collection with optional sorting/filtering |
125
+ | `get_cms_item` | Get a single item by its slug |
126
+ | `update_cms_item` | Update an existing item's name, data, or publish status |
127
+ | `delete_cms_item` | Delete an item (requires explicit user confirmation) |
128
+
129
+ **⚠️ Delete Safety:** The `delete_cms_item` tool requires `confirmDelete: true` and will prompt you to ask the user for permission before deleting anything.
130
+
131
+ ---
132
+
133
+ ## Installation
134
+
135
+ The MCP server automatically downloads prebuilt binaries for your platform during installation. This eliminates Node.js PATH issues that can occur in some IDE environments.
136
+
137
+ ### For Claude Code (CLI & VS Code Extension)
138
+
139
+ Add to `~/.claude/settings.json`:
140
+
141
+ ```json
142
+ {
143
+ "mcpServers": {
144
+ "fastmode": {
145
+ "command": "npx",
146
+ "args": ["-y", "fastmode-mcp"]
147
+ }
148
+ }
149
+ }
150
+ ```
151
+
152
+ ### For Cursor
153
+
154
+ Add to your Cursor MCP settings (`~/.cursor/mcp.json` or project-level `.cursor/mcp.json`):
155
+
156
+ ```json
157
+ {
158
+ "mcpServers": {
159
+ "fastmode": {
160
+ "command": "npx",
161
+ "args": ["-y", "fastmode-mcp"]
162
+ }
163
+ }
164
+ }
165
+ ```
166
+
167
+ ### For Claude Desktop
168
+
169
+ Add to your Claude config (`~/Library/Application Support/Claude/claude_desktop_config.json` on macOS):
170
+
171
+ ```json
172
+ {
173
+ "mcpServers": {
174
+ "fastmode": {
175
+ "command": "npx",
176
+ "args": ["-y", "fastmode-mcp"]
177
+ }
178
+ }
179
+ }
180
+ ```
181
+
182
+ ### For Windsurf
183
+
184
+ Add to `~/.codeium/windsurf/mcp_config.json`:
185
+
186
+ ```json
187
+ {
188
+ "mcpServers": {
189
+ "fastmode": {
190
+ "command": "npx",
191
+ "args": ["-y", "fastmode-mcp"]
192
+ }
193
+ }
194
+ }
195
+ ```
196
+
197
+ ### Troubleshooting
198
+
199
+ If the MCP server doesn't start (especially with custom Node.js installations like nvm, volta, or homebrew):
200
+
201
+ **Option 1: Use shell wrapper (macOS/Linux)**
202
+
203
+ ```json
204
+ {
205
+ "mcpServers": {
206
+ "fastmode": {
207
+ "command": "/bin/zsh",
208
+ "args": ["-l", "-c", "npx -y fastmode-mcp"]
209
+ }
210
+ }
211
+ }
212
+ ```
213
+
214
+ **Option 2: Use absolute path to npx**
215
+
216
+ Find your npx path with `which npx`, then:
217
+
218
+ ```json
219
+ {
220
+ "mcpServers": {
221
+ "fastmode": {
222
+ "command": "/path/to/your/npx",
223
+ "args": ["-y", "fastmode-mcp"]
224
+ }
225
+ }
226
+ }
227
+ ```
228
+
229
+ **After any config change:** Fully quit and reopen your IDE (Cmd+Q on macOS, not just close window).
230
+
231
+ ---
232
+
233
+ ## Quick Start
234
+
235
+ ### 1. Start with get_started
236
+
237
+ Ask your AI assistant what you want to do:
238
+
239
+ > "I want to add some blog posts to my Fast Mode site"
240
+
241
+ The AI will call `get_started(intent: "add_content")` to see your projects and schema.
242
+
243
+ ### 2. Convert a Website
244
+
245
+ > "Convert this website to Fast Mode format"
246
+
247
+ The AI will use validation tools to create a proper package structure.
248
+
249
+ ### 2. Validate & Create Schema (Important!)
250
+
251
+ Before deploying, validate your templates against the project schema:
252
+
253
+ > "Validate my templates against my Fast Mode project and create any missing fields or collections"
254
+
255
+ **The AI will automatically:**
256
+ 1. Check each template for fields that don't exist
257
+ 2. Call `get_field_types` to see available types
258
+ 3. Call `sync_schema` to create missing collections and fields
259
+ 4. Confirm everything is ready for deployment
260
+
261
+ ⚠️ **This step is critical!** Templates won't render correctly if the fields don't exist.
262
+
263
+ ### 3. Deploy to Fast Mode
264
+
265
+ Once your schema is synced:
266
+
267
+ > "Deploy this to Fast Mode"
268
+
269
+ The AI will:
270
+ 1. Open your browser for login (if needed)
271
+ 2. Show your existing projects or create a new one
272
+ 3. Upload and deploy your site
273
+
274
+ ### 4. Your Site is Live!
275
+
276
+ Your site will be available at `https://your-site.fastmode.ai` and you can manage content at [app.fastmode.ai](https://app.fastmode.ai).
277
+
278
+ ---
279
+
280
+ ## Schema Sync (Critical for Custom Fields)
281
+
282
+ When your templates use custom fields, you **must** create them in the CMS before deploying. The MCP server handles this automatically.
283
+
284
+ ### Recommended Workflow
285
+
286
+ ```
287
+ 1. "Convert my website to Fast Mode format"
288
+ 2. "Validate all templates against my project and create any missing fields"
289
+ 3. "Deploy to Fast Mode"
290
+ ```
291
+
292
+ The AI will:
293
+ - Use `validate_template` with your project ID to find missing fields
294
+ - Use `get_field_types` to determine the correct field type for each
295
+ - Use `sync_schema` to create fields/collections before deploying
296
+
297
+ ### What Happens During Validation
298
+
299
+ When you validate a template with a project ID, the tool will:
300
+
301
+ 1. **✅ All fields exist** → Schema validation passed, ready to deploy
302
+ 2. **🚨 Missing fields** → Provides exact `sync_schema` call to create them
303
+ 3. **🚨 Missing collection** → Provides exact `sync_schema` call to create collection with fields
304
+
305
+ ### Available Field Types
306
+
307
+ | Type | Use For |
308
+ |------|---------|
309
+ | `text` | Short text (titles, names, single lines) |
310
+ | `richText` | Long formatted content with HTML (blog bodies, bios) |
311
+ | `number` | Numeric values (prices, counts, order) |
312
+ | `boolean` | True/false toggles (featured, published) |
313
+ | `date` | Date picker (publishedAt, eventDate) |
314
+ | `datetime` | Date + time picker |
315
+ | `image` | Image uploads (heroImage, thumbnail, photo) |
316
+ | `url` | Links (website, social profiles) |
317
+ | `videoEmbed` | **Use for video content** - YouTube, Vimeo, Wistia, Loom. Template: `{{#videoEmbed field}}{{/videoEmbed}}` |
318
+ | `email` | Email addresses |
319
+ | `select` | Single dropdown choice (category, status) |
320
+ | `multiSelect` | Multiple dropdown choices (tags) |
321
+ | `relation` | **Use for linked content** (author → authors). Template: `{{author.name}}`, `{{author.url}}` |
322
+
323
+ ### Field Type Tips
324
+
325
+ The MCP server now provides intelligent field type suggestions when you use sync_schema:
326
+
327
+ **For Video Content:**
328
+ - Use `videoEmbed` type (NOT `url` or `text`)
329
+ - Outputs responsive iframes with correct YouTube settings
330
+ - Template: `{{#videoEmbed videoFieldName}}{{/videoEmbed}}`
331
+
332
+ **For Linked Content:**
333
+ - Use `relation` type (NOT `text`)
334
+ - Links to items in another collection
335
+ - Access with dot notation: `{{author.name}}`, `{{category.url}}`
336
+ - Requires `referenceCollection` parameter
337
+
338
+ ### Example: Adding Fields to Existing Collection
339
+
340
+ ```json
341
+ {
342
+ "projectId": "my-project",
343
+ "fieldsToAdd": [
344
+ {
345
+ "collectionSlug": "posts",
346
+ "fields": [
347
+ { "slug": "heroImage", "name": "Hero Image", "type": "image" },
348
+ { "slug": "category", "name": "Category", "type": "select", "options": "Tech,Business,Lifestyle" }
349
+ ]
350
+ }
351
+ ]
352
+ }
353
+ ```
354
+
355
+ ### Example: Creating a Custom Collection
356
+
357
+ ```json
358
+ {
359
+ "projectId": "my-project",
360
+ "collections": [
361
+ {
362
+ "slug": "products",
363
+ "name": "Products",
364
+ "nameSingular": "Product",
365
+ "fields": [
366
+ { "slug": "price", "name": "Price", "type": "number" },
367
+ { "slug": "description", "name": "Description", "type": "richText" },
368
+ { "slug": "image", "name": "Product Image", "type": "image" }
369
+ ]
370
+ }
371
+ ]
372
+ }
373
+ ```
374
+
375
+ **Features:**
376
+ - ✅ Two-phase creation: collections first, then fields (relation fields always work)
377
+ - ✅ Automatic retry for transient failures
378
+ - ✅ Validates all field types before creating
379
+ - ✅ Skips duplicates automatically (safe to re-run)
380
+ - ✅ Reports detailed summary table with status
381
+
382
+ ---
383
+
384
+ ## Example Prompts
385
+
386
+ ### Complete Workflow (Recommended)
387
+
388
+ ```
389
+ "Convert this website to Fast Mode, validate against my project, create any missing fields, and deploy"
390
+ ```
391
+
392
+ ### Step by Step
393
+
394
+ ```
395
+ # 1. Convert website
396
+ "Convert this website to Fast Mode format"
397
+
398
+ # 2. Validate and sync schema (IMPORTANT - don't skip!)
399
+ "Validate my templates against my Fast Mode project and create any missing fields or collections"
400
+
401
+ # 3. Deploy
402
+ "Deploy to my Fast Mode project"
403
+ ```
404
+
405
+ ### Individual Operations
406
+
407
+ ```
408
+ # Check what fields you can create
409
+ "What field types are available in Fast Mode?"
410
+
411
+ # Add a specific field
412
+ "Add a heroImage field (image type) to the blogs collection"
413
+
414
+ # Create a new custom collection
415
+ "Create a 'testimonials' collection with name (text), quote (richText), and photo (image) fields"
416
+
417
+ # Validate a single template
418
+ "Validate my blog_post.html template against my project"
419
+ ```
420
+
421
+ ### Content Management
422
+
423
+ ```
424
+ # List all blog posts
425
+ "Show me all items in my blog collection"
426
+
427
+ # Get details of a specific post
428
+ "Get the blog post with slug 'my-first-post'"
429
+
430
+ # Create a new blog post
431
+ "Create a new blog post titled 'AI in 2025' with content about artificial intelligence trends"
432
+
433
+ # Update an existing post
434
+ "Update the blog post 'my-first-post' to set featured to true"
435
+
436
+ # Delete a post (AI will ask for confirmation first)
437
+ "Delete the blog post 'old-draft-post'"
438
+ ```
439
+
440
+ ---
441
+
442
+ ## Authentication
443
+
444
+ The MCP server uses browser-based authentication (OAuth device flow). When you run a tool that requires auth:
445
+
446
+ 1. Your browser opens automatically
447
+ 2. Log in or create a Fast Mode account
448
+ 3. The MCP server receives your credentials
449
+ 4. Credentials are stored locally at `~/.fastmode/credentials.json`
450
+
451
+ You can also set the `FASTMODE_AUTH_TOKEN` environment variable if you prefer.
452
+
453
+ ---
454
+
455
+ ## Static Pages with CMS Content
456
+
457
+ Static pages (like homepages) can display content from CMS collections using `{{#each}}` loops:
458
+
459
+ ```html
460
+ <!-- Homepage showing 3 featured blog posts -->
461
+ <section class="featured-posts">
462
+ <h2>Latest Articles</h2>
463
+ {{#each posts featured=true limit=3}}
464
+ <article>
465
+ <h3><a href="{{url}}">{{name}}</a></h3>
466
+ <p>{{summary}}</p>
467
+ </article>
468
+ {{/each}}
469
+ </section>
470
+ ```
471
+
472
+ **The MCP validation tool will:**
473
+ - Detect collection references (e.g., `posts`, `team`, `products`)
474
+ - Validate that referenced collections exist in your schema
475
+ - Error if collections are missing, with `sync_schema` instructions to create them
476
+
477
+ This ensures your homepage's featured content section will work correctly after deployment.
478
+
479
+ ---
480
+
481
+ ## Form Handling
482
+
483
+ Fast Mode automatically captures form submissions. Use the `data-form` attribute to identify forms:
484
+
485
+ ```html
486
+ <form data-form="contact">
487
+ <input type="text" name="name" required>
488
+ <input type="email" name="email" required>
489
+ <textarea name="message"></textarea>
490
+ <button type="submit">Send</button>
491
+ </form>
492
+ ```
493
+
494
+ **Requirements:**
495
+ - `data-form="formname"` attribute identifies the form
496
+ - All inputs must have `name` attributes to be captured
497
+ - Include a submit button
498
+
499
+ **The MCP validation tool will check:**
500
+ - ✅ Form has `data-form` attribute
501
+ - ✅ All inputs have `name` attributes
502
+ - ⚠️ Warning if no submit button
503
+ - 💡 Suggestion to create a `/thank-you` page
504
+
505
+ **Note:** The legacy `data-form-name` attribute is deprecated. Use `data-form` instead.
506
+
507
+ Use `get_example("form_handling")` to see the full form handler script.
508
+
509
+ ---
510
+
511
+ ## Package Structure
512
+
513
+ Fast Mode websites follow this structure:
514
+
515
+ ```
516
+ my-site/
517
+ ├── manifest.json # Site configuration
518
+ ├── pages/ # HTML pages
519
+ │ ├── index.html
520
+ │ ├── about.html
521
+ │ └── contact.html
522
+ ├── public/ # Static assets
523
+ │ ├── css/
524
+ │ ├── js/
525
+ │ └── images/
526
+ └── templates/ # CMS templates (optional)
527
+ ├── blog_index.html
528
+ ├── blog_post.html
529
+ └── team.html
530
+ ```
531
+
532
+ Use the `get_conversion_guide` tool for detailed instructions.
533
+
534
+ ---
535
+
536
+ ## Support
537
+
538
+ - **Issues:** [GitHub Issues](https://github.com/arihgoldstein/multisite-cms/issues)
539
+ - **Email:** support@fastmode.ai
540
+
541
+ ---
542
+
543
+ ## Changelog
544
+
545
+ ### v1.0.0
546
+ - **New Package Name** — Renamed from `multisite-cms-mcp` to `fastmode-mcp` for clarity
547
+ - **Prebuilt Binaries** — Automatic binary downloads for macOS, Linux, and Windows (Intel & ARM)
548
+ - **No PATH Issues** — Works regardless of how Node.js is installed (nvm, volta, homebrew, etc.)
549
+ - **get_started Tool** — Intelligent entry point that detects project state and returns exact workflows
550
+ - **CMS Item Management** — Full CRUD tools: `create_cms_item`, `list_cms_items`, `get_cms_item`, `update_cms_item`, `delete_cms_item`
551
+ - **Schema Sync** — Create collections and fields with `sync_schema`
552
+ - **Deploy Gate** — `deploy_package` validates internally and BLOCKS deployment if there are errors
553
+ - **Form Validation** — Validates `data-form` attribute, input names, submit buttons
554
+ - **Static Page Validation** — Validates `{{#each}}` collection references against schema
555
+
556
+ ---
557
+
558
+ ## License
559
+
560
+ MIT
561
+
package/bin/run.js ADDED
@@ -0,0 +1,50 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Entry point that tries to run the native binary first, then falls back to Node.js.
4
+ * This allows the MCP server to work regardless of how Node.js is installed.
5
+ */
6
+ const { spawn } = require('child_process');
7
+ const path = require('path');
8
+ const fs = require('fs');
9
+
10
+ const BINARY_NAME = 'fastmode-mcp';
11
+
12
+ function getNativeBinaryPath() {
13
+ const ext = process.platform === 'win32' ? '.exe' : '';
14
+ const binaryPath = path.join(__dirname, `${BINARY_NAME}${ext}`);
15
+
16
+ if (fs.existsSync(binaryPath)) {
17
+ return binaryPath;
18
+ }
19
+
20
+ return null;
21
+ }
22
+
23
+ function runNativeBinary(binaryPath) {
24
+ const child = spawn(binaryPath, process.argv.slice(2), {
25
+ stdio: 'inherit',
26
+ env: process.env,
27
+ });
28
+
29
+ child.on('error', (error) => {
30
+ console.error(`Failed to run native binary: ${error.message}`);
31
+ runNodeFallback();
32
+ });
33
+
34
+ child.on('exit', (code) => {
35
+ process.exit(code || 0);
36
+ });
37
+ }
38
+
39
+ function runNodeFallback() {
40
+ // Fall back to the Node.js version
41
+ require('../dist/index.js');
42
+ }
43
+
44
+ const nativeBinary = getNativeBinaryPath();
45
+
46
+ if (nativeBinary) {
47
+ runNativeBinary(nativeBinary);
48
+ } else {
49
+ runNodeFallback();
50
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}