@insforge/install 0.0.49 → 0.0.51
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/.mcp.json +2 -2
- package/AGENTS.md +99 -0
- package/dist/index.js +50 -7
- package/dist/utils.js +4 -4
- package/package.json +2 -1
package/.mcp.json
CHANGED
package/AGENTS.md
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Instructions building apps with MCP
|
|
3
|
+
globs: *
|
|
4
|
+
alwaysApply: true
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# InsForge SDK Documentation - Overview
|
|
8
|
+
|
|
9
|
+
## What is InsForge?
|
|
10
|
+
|
|
11
|
+
Backend-as-a-service (BaaS) platform providing:
|
|
12
|
+
|
|
13
|
+
- **Database**: PostgreSQL with PostgREST API
|
|
14
|
+
- **Authentication**: Email/password + OAuth (Google, GitHub)
|
|
15
|
+
- **Storage**: File upload/download
|
|
16
|
+
- **AI**: Chat completions and image generation (OpenAI-compatible)
|
|
17
|
+
- **Functions**: Serverless function deployment
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
### 🚨 CRITICAL: Follow these steps in order
|
|
22
|
+
|
|
23
|
+
### Step 1: Download Template
|
|
24
|
+
|
|
25
|
+
Use the `download-template` MCP tool to create a new project with your backend URL and anon key pre-configured.
|
|
26
|
+
|
|
27
|
+
### Step 2: Install SDK
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @insforge/sdk@latest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### Step 3: Create SDK Client
|
|
34
|
+
|
|
35
|
+
You must create a client instance using `createClient()` with your base URL and anon key:
|
|
36
|
+
|
|
37
|
+
```javascript
|
|
38
|
+
import { createClient } from '@insforge/sdk';
|
|
39
|
+
|
|
40
|
+
const client = createClient({
|
|
41
|
+
baseUrl: 'https://your-app.region.insforge.app', // Your InsForge backend URL
|
|
42
|
+
anonKey: 'your-anon-key-here' // Get this from backend metadata
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
**API BASE URL**: Your API base URL is `https://your-app.region.insforge.app`.
|
|
48
|
+
|
|
49
|
+
## Getting Detailed Documentation
|
|
50
|
+
|
|
51
|
+
### 🚨 CRITICAL: Always Fetch Documentation Before Writing Code
|
|
52
|
+
|
|
53
|
+
Before writing or editing any InsForge integration code, you **MUST** call the `fetch-docs` MCP tool to get the latest SDK documentation. This ensures you have accurate, up-to-date implementation patterns.
|
|
54
|
+
|
|
55
|
+
### Use the InsForge `fetch-docs` MCP tool to get specific SDK documentation:
|
|
56
|
+
|
|
57
|
+
Available documentation types:
|
|
58
|
+
|
|
59
|
+
- `"instructions"` - Essential backend setup (START HERE)
|
|
60
|
+
- `"db-sdk"` - Database operations with SDK
|
|
61
|
+
- **Authentication** - Choose based on implementation:
|
|
62
|
+
- `"auth-sdk"` - Direct SDK methods for custom auth flows
|
|
63
|
+
- `"auth-components-react"` - Pre-built auth UI for React+Vite (singlepage App)
|
|
64
|
+
- `"auth-components-react-router"` - Pre-built auth UI for React(Vite+React Router) (Multipage App)
|
|
65
|
+
- `"auth-components-nextjs"` - Pre-built auth UI for Nextjs (SSR App)
|
|
66
|
+
- `"storage-sdk"` - File storage operations
|
|
67
|
+
- `"functions-sdk"` - Serverless functions invocation
|
|
68
|
+
- `"ai-integration-sdk"` - AI chat and image generation
|
|
69
|
+
- `"real-time"` - Real-time pub/sub (database + client events) via WebSockets
|
|
70
|
+
- `"deployment"` - Deploy frontend applications via MCP tool
|
|
71
|
+
|
|
72
|
+
## When to Use SDK vs MCP Tools
|
|
73
|
+
|
|
74
|
+
### Always SDK for Application Logic:
|
|
75
|
+
|
|
76
|
+
- Authentication (register, login, logout, profiles)
|
|
77
|
+
- Database CRUD (select, insert, update, delete)
|
|
78
|
+
- Storage operations (upload, download files)
|
|
79
|
+
- AI operations (chat, image generation)
|
|
80
|
+
- Serverless function invocation
|
|
81
|
+
|
|
82
|
+
### Use MCP Tools for Infrastructure:
|
|
83
|
+
|
|
84
|
+
- Project scaffolding (`download-template`) - Download starter templates with InsForge integration
|
|
85
|
+
- Backend setup and metadata (`get-backend-metadata`)
|
|
86
|
+
- Database schema management (`run-raw-sql`, `get-table-schema`)
|
|
87
|
+
- Storage bucket creation (`create-bucket`, `list-buckets`, `delete-bucket`)
|
|
88
|
+
- Serverless function deployment (`create-function`, `update-function`, `delete-function`)
|
|
89
|
+
- Frontend deployment (`create-deployment`) - Deploy frontend apps to InsForge hosting
|
|
90
|
+
|
|
91
|
+
## Important Notes
|
|
92
|
+
|
|
93
|
+
- For auth: use `auth-sdk` for custom UI, or framework-specific components for pre-built UI
|
|
94
|
+
- SDK returns `{data, error}` structure for all operations
|
|
95
|
+
- Database inserts require array format: `[{...}]`
|
|
96
|
+
- Serverless functions have single endpoint (no subpaths)
|
|
97
|
+
- Storage: Upload files to buckets, store URLs in database
|
|
98
|
+
- AI operations are OpenAI-compatible
|
|
99
|
+
- **EXTRA IMPORTANT**: Use Tailwind CSS 3.4 (do not upgrade to v4). Lock these dependencies in `package.json`
|
package/dist/index.js
CHANGED
|
@@ -11,8 +11,9 @@ import {
|
|
|
11
11
|
|
|
12
12
|
import yargs from "yargs";
|
|
13
13
|
import { hideBin } from "yargs/helpers";
|
|
14
|
-
|
|
14
|
+
|
|
15
15
|
import pc from "picocolors";
|
|
16
|
+
import select from "@inquirer/select";
|
|
16
17
|
var { green, red, yellow, cyan } = pc;
|
|
17
18
|
|
|
18
19
|
// Section header helper
|
|
@@ -35,9 +36,25 @@ import {
|
|
|
35
36
|
╚═╝╚═╝ ╚═══╝╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═╝ ╚═════╝ ╚══════╝
|
|
36
37
|
`;
|
|
37
38
|
|
|
38
|
-
|
|
39
|
+
// Map client names to display names for better UX
|
|
40
|
+
const clientDisplayNames = {
|
|
41
|
+
"claude-code": "Claude Code",
|
|
42
|
+
"cursor": "Cursor",
|
|
43
|
+
"windsurf": "Windsurf",
|
|
44
|
+
"cline": "Cline",
|
|
45
|
+
"roocode": "Roo Code",
|
|
46
|
+
"trae": "Trae",
|
|
47
|
+
"codex": "Codex",
|
|
48
|
+
"copilot": "GitHub Copilot",
|
|
49
|
+
"qoder": "Qoder",
|
|
50
|
+
"antigravity": "Antigravity",
|
|
51
|
+
"kiro": "Kiro"
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
function printPostInstallMessage(clientName) {
|
|
55
|
+
const displayName = clientDisplayNames[clientName] || clientName;
|
|
39
56
|
console.log(INSFORGE_LOGO);
|
|
40
|
-
console.log(green(
|
|
57
|
+
console.log(green(`✓ InsForge MCP is now configured for ${cyan(displayName)}!`));
|
|
41
58
|
console.log();
|
|
42
59
|
console.log('Next steps:');
|
|
43
60
|
console.log(' 1. Restart your coding agent to load InsForge');
|
|
@@ -59,7 +76,7 @@ import {
|
|
|
59
76
|
return yargs2.option("client", {
|
|
60
77
|
type: "string",
|
|
61
78
|
description: "Client to use for installation",
|
|
62
|
-
demandOption:
|
|
79
|
+
demandOption: false,
|
|
63
80
|
choices: clientNames
|
|
64
81
|
}).option("env", {
|
|
65
82
|
type: "string",
|
|
@@ -71,11 +88,37 @@ import {
|
|
|
71
88
|
default: false
|
|
72
89
|
});
|
|
73
90
|
}
|
|
91
|
+
|
|
74
92
|
async function handler(argv) {
|
|
75
|
-
|
|
76
|
-
|
|
93
|
+
let selectedClient = argv.client;
|
|
94
|
+
|
|
95
|
+
// If no client specified, show interactive selection
|
|
96
|
+
if (!selectedClient) {
|
|
97
|
+
console.log();
|
|
98
|
+
console.log(LINE);
|
|
99
|
+
console.log(` ${cyan('InsForge MCP Installer')}`);
|
|
100
|
+
console.log(LINE);
|
|
101
|
+
console.log();
|
|
102
|
+
|
|
103
|
+
selectedClient = await select({
|
|
104
|
+
message: 'Select your coding agent:',
|
|
105
|
+
pageSize: 15,
|
|
106
|
+
loop: false,
|
|
107
|
+
choices: clientNames.map(name => ({
|
|
108
|
+
name: clientDisplayNames[name] || name,
|
|
109
|
+
value: name
|
|
110
|
+
}))
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
// Validate client
|
|
115
|
+
if (!clientNames.includes(selectedClient)) {
|
|
116
|
+
logger.error(`Invalid client: ${selectedClient}. Available clients: ${clientNames.join(", ")}`);
|
|
77
117
|
return;
|
|
78
118
|
}
|
|
119
|
+
|
|
120
|
+
// Update argv.client with selected value for downstream use
|
|
121
|
+
argv.client = selectedClient;
|
|
79
122
|
const envVars = {};
|
|
80
123
|
if (argv.env && argv.env.length > 0) {
|
|
81
124
|
for (const envVar of argv.env) {
|
|
@@ -319,7 +362,7 @@ alwaysApply: true
|
|
|
319
362
|
}
|
|
320
363
|
|
|
321
364
|
printHeader('Setup Complete!');
|
|
322
|
-
printPostInstallMessage();
|
|
365
|
+
printPostInstallMessage(argv.client);
|
|
323
366
|
} catch (e) {
|
|
324
367
|
logger.error(red(e.message));
|
|
325
368
|
}
|
package/dist/utils.js
CHANGED
|
@@ -28,15 +28,15 @@ var platformPaths = {
|
|
|
28
28
|
var platform = process.platform;
|
|
29
29
|
var { baseDir, vscodePath } = platformPaths[platform];
|
|
30
30
|
var clientPaths = {
|
|
31
|
-
"claude-code": {
|
|
32
|
-
type: "file",
|
|
33
|
-
path: path.join(process.cwd(), ".mcp.json")
|
|
34
|
-
},
|
|
35
31
|
cursor: {
|
|
36
32
|
type: "file",
|
|
37
33
|
path: path.join(homeDir, ".cursor", "mcp.json"),
|
|
38
34
|
localPath: path.join(process.cwd(), ".cursor", "mcp.json")
|
|
39
35
|
},
|
|
36
|
+
"claude-code": {
|
|
37
|
+
type: "file",
|
|
38
|
+
path: path.join(process.cwd(), ".mcp.json")
|
|
39
|
+
},
|
|
40
40
|
windsurf: {
|
|
41
41
|
type: "file",
|
|
42
42
|
path: path.join(homeDir, ".codeium", "windsurf", "mcp_config.json")
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insforge/install",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.51",
|
|
4
4
|
"description": "CLI tool for installing Insforge MCP servers across different AI clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"start": "node dist/index.js"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
+
"@inquirer/select": "^4.4.2",
|
|
14
15
|
"consola": "^3.2.3",
|
|
15
16
|
"node-fetch": "^3.3.2",
|
|
16
17
|
"picocolors": "^1.0.0",
|