@myvtp/mcp 0.1.0 → 0.2.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.
- package/README.md +42 -3
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +16 -169
- package/dist/index.js.map +1 -1
- package/dist/install/clients.d.ts +25 -0
- package/dist/install/clients.d.ts.map +1 -0
- package/dist/install/clients.js +68 -0
- package/dist/install/clients.js.map +1 -0
- package/dist/install/config.d.ts +27 -0
- package/dist/install/config.d.ts.map +1 -0
- package/dist/install/config.js +70 -0
- package/dist/install/config.js.map +1 -0
- package/dist/install/constants.d.ts +14 -0
- package/dist/install/constants.d.ts.map +1 -0
- package/dist/install/constants.js +96 -0
- package/dist/install/constants.js.map +1 -0
- package/dist/install/index.d.ts +8 -0
- package/dist/install/index.d.ts.map +1 -0
- package/dist/install/index.js +249 -0
- package/dist/install/index.js.map +1 -0
- package/dist/install/types.d.ts +57 -0
- package/dist/install/types.d.ts.map +1 -0
- package/dist/install/types.js +5 -0
- package/dist/install/types.js.map +1 -0
- package/dist/server.d.ts +5 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +174 -0
- package/dist/server.js.map +1 -0
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -2,9 +2,36 @@
|
|
|
2
2
|
|
|
3
3
|
MCP (Model Context Protocol) server for VTP - deploy apps via Claude Code.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Run the installer to automatically configure your AI coding assistant:
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npx myvtp-mcp install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
This will detect and configure any of the following clients:
|
|
14
|
+
- **Claude Desktop** - Anthropic's desktop app
|
|
15
|
+
- **Claude Code** - Anthropic's CLI tool
|
|
16
|
+
- **Cursor** - AI-powered code editor
|
|
17
|
+
- **VS Code** - Project-level MCP config
|
|
18
|
+
- **Windsurf** - Codeium's AI code editor
|
|
19
|
+
- **Project (.mcp.json)** - Generic project-level config
|
|
20
|
+
|
|
21
|
+
### Installer Options
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npx myvtp-mcp install # Interactive mode
|
|
25
|
+
npx myvtp-mcp install --yes # Configure all detected clients
|
|
26
|
+
npx myvtp-mcp install --yes claude-desktop # Configure specific client
|
|
27
|
+
npx myvtp-mcp install --force # Overwrite existing VTP config
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Press **Escape** or **Ctrl+C** to cancel the installer.
|
|
31
|
+
|
|
32
|
+
## Manual Installation
|
|
33
|
+
|
|
34
|
+
Add to your MCP configuration file:
|
|
8
35
|
|
|
9
36
|
```json
|
|
10
37
|
{
|
|
@@ -17,9 +44,21 @@ Add to your Claude Code configuration (`~/.claude.json`):
|
|
|
17
44
|
}
|
|
18
45
|
```
|
|
19
46
|
|
|
47
|
+
### Config File Locations
|
|
48
|
+
|
|
49
|
+
| Client | Config Path |
|
|
50
|
+
|--------|-------------|
|
|
51
|
+
| Claude Desktop (macOS) | `~/Library/Application Support/Claude/claude_desktop_config.json` |
|
|
52
|
+
| Claude Desktop (Windows) | `%APPDATA%\Claude\claude_desktop_config.json` |
|
|
53
|
+
| Claude Code | `~/.claude.json` |
|
|
54
|
+
| Cursor | `~/.cursor/mcp.json` |
|
|
55
|
+
| VS Code | `.vscode/mcp.json` (project-level) |
|
|
56
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json` |
|
|
57
|
+
| Generic | `.mcp.json` (project-level) |
|
|
58
|
+
|
|
20
59
|
## Usage
|
|
21
60
|
|
|
22
|
-
Once configured, simply ask Claude
|
|
61
|
+
Once configured, simply ask Claude to deploy your app:
|
|
23
62
|
|
|
24
63
|
```
|
|
25
64
|
Deploy this app to VTP
|
package/dist/index.d.ts
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* VTP MCP Package Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Routes to either the MCP server or the install command based on arguments:
|
|
6
|
+
* - `npx myvtp-mcp` or `npx -y @myvtp/mcp` → runs the MCP server
|
|
7
|
+
* - `npx myvtp-mcp install` → runs the installer
|
|
8
|
+
*/
|
|
2
9
|
export {};
|
|
3
10
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG"}
|
package/dist/index.js
CHANGED
|
@@ -1,172 +1,19 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
tools: {},
|
|
14
|
-
},
|
|
15
|
-
});
|
|
16
|
-
// List available tools
|
|
17
|
-
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
18
|
-
tools: toolDefinitions,
|
|
19
|
-
}));
|
|
20
|
-
// Handle tool calls - all delegate to HTTP API via client
|
|
21
|
-
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
22
|
-
const { name, arguments: args } = request.params;
|
|
23
|
-
try {
|
|
24
|
-
switch (name) {
|
|
25
|
-
case 'list_app_types': {
|
|
26
|
-
const types = await client.listAppTypes();
|
|
27
|
-
const typeList = types
|
|
28
|
-
.map(t => `- **${t.displayName}** (${t.type})\n ${t.description}`)
|
|
29
|
-
.join('\n');
|
|
30
|
-
return {
|
|
31
|
-
content: [{
|
|
32
|
-
type: 'text',
|
|
33
|
-
text: `Supported app types:\n\n${typeList}\n\n` +
|
|
34
|
-
`Use get_deployment_guide with a type to see detailed instructions.`,
|
|
35
|
-
}],
|
|
36
|
-
};
|
|
37
|
-
}
|
|
38
|
-
case 'get_deployment_guide': {
|
|
39
|
-
const { type: guideType } = GuideTypeSchema.parse(args);
|
|
40
|
-
try {
|
|
41
|
-
const guide = await client.getDeploymentGuide(guideType);
|
|
42
|
-
return {
|
|
43
|
-
content: [{
|
|
44
|
-
type: 'text',
|
|
45
|
-
text: guide.content,
|
|
46
|
-
}],
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
catch (error) {
|
|
50
|
-
if (error instanceof Error && error.message.includes('guide_not_found')) {
|
|
51
|
-
const types = await client.listAppTypes();
|
|
52
|
-
const available = types.map(t => t.type).join(', ');
|
|
53
|
-
return {
|
|
54
|
-
content: [{
|
|
55
|
-
type: 'text',
|
|
56
|
-
text: `Unknown app type: "${guideType}"\n\nAvailable types: ${available}`,
|
|
57
|
-
}],
|
|
58
|
-
isError: true,
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
throw error;
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
case 'deploy': {
|
|
65
|
-
const { config, force } = DeploySchema.parse(args);
|
|
66
|
-
const configPath = config || './vtp.yaml';
|
|
67
|
-
// Validate config exists
|
|
68
|
-
if (!existsSync(configPath)) {
|
|
69
|
-
return {
|
|
70
|
-
content: [{
|
|
71
|
-
type: 'text',
|
|
72
|
-
text: `Error: Config file not found: ${configPath}\n\n` +
|
|
73
|
-
`Create a vtp.yaml file with:\n` +
|
|
74
|
-
` name: My App Name # Display name\n` +
|
|
75
|
-
` id: my-app # Optional: URL slug\n` +
|
|
76
|
-
` type: static # or "node"\n` +
|
|
77
|
-
` path: ./dist # folder to deploy\n\n` +
|
|
78
|
-
`Use list_app_types and get_deployment_guide for help.`,
|
|
79
|
-
}],
|
|
80
|
-
isError: true,
|
|
81
|
-
};
|
|
82
|
-
}
|
|
83
|
-
// Deploy via HTTP API
|
|
84
|
-
const result = await client.deploy(configPath, force ?? false);
|
|
85
|
-
// Handle conflict
|
|
86
|
-
if (result.error === 'conflict') {
|
|
87
|
-
const existingApp = result.existingApp;
|
|
88
|
-
return {
|
|
89
|
-
content: [{
|
|
90
|
-
type: 'text',
|
|
91
|
-
text: `App '${existingApp?.id}' already exists at ${existingApp?.url || 'unknown URL'}\n` +
|
|
92
|
-
`Name: ${existingApp?.name || 'unknown'}\n` +
|
|
93
|
-
`Status: ${existingApp?.status || 'unknown'}\n\n` +
|
|
94
|
-
`Use force: true to replace it.`,
|
|
95
|
-
}],
|
|
96
|
-
};
|
|
97
|
-
}
|
|
98
|
-
// Handle other errors
|
|
99
|
-
if (result.error) {
|
|
100
|
-
return {
|
|
101
|
-
content: [{
|
|
102
|
-
type: 'text',
|
|
103
|
-
text: `Error: ${result.message || result.error}`,
|
|
104
|
-
}],
|
|
105
|
-
isError: true,
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
// Success
|
|
109
|
-
const app = result.app;
|
|
110
|
-
const prefix = result.replaced ? 'Replaced' : 'Deployed';
|
|
111
|
-
return {
|
|
112
|
-
content: [{
|
|
113
|
-
type: 'text',
|
|
114
|
-
text: `${prefix} ${app.name} (@${app.id})\n` +
|
|
115
|
-
` URL: ${app.url}\n` +
|
|
116
|
-
` Type: ${app.type}\n` +
|
|
117
|
-
` Status: ${app.status}`,
|
|
118
|
-
}],
|
|
119
|
-
};
|
|
120
|
-
}
|
|
121
|
-
case 'list': {
|
|
122
|
-
const apps = await client.listApps();
|
|
123
|
-
if (apps.length === 0) {
|
|
124
|
-
return {
|
|
125
|
-
content: [{
|
|
126
|
-
type: 'text',
|
|
127
|
-
text: 'No apps deployed yet.',
|
|
128
|
-
}],
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
const appList = apps
|
|
132
|
-
.map(app => {
|
|
133
|
-
const desc = app.description ? `\n ${app.description}` : '';
|
|
134
|
-
return `- ${app.name} (@${app.id}) - ${app.type} - ${app.status}${desc}\n ${app.url}`;
|
|
135
|
-
})
|
|
136
|
-
.join('\n');
|
|
137
|
-
return {
|
|
138
|
-
content: [{
|
|
139
|
-
type: 'text',
|
|
140
|
-
text: `Deployed apps:\n${appList}`,
|
|
141
|
-
}],
|
|
142
|
-
};
|
|
143
|
-
}
|
|
144
|
-
default:
|
|
145
|
-
return {
|
|
146
|
-
content: [{
|
|
147
|
-
type: 'text',
|
|
148
|
-
text: `Unknown tool: ${name}`,
|
|
149
|
-
}],
|
|
150
|
-
isError: true,
|
|
151
|
-
};
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
156
|
-
return {
|
|
157
|
-
content: [{
|
|
158
|
-
type: 'text',
|
|
159
|
-
text: `Error: ${message}`,
|
|
160
|
-
}],
|
|
161
|
-
isError: true,
|
|
162
|
-
};
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
// Start the server
|
|
166
|
-
async function main() {
|
|
167
|
-
const transport = new StdioServerTransport();
|
|
168
|
-
await server.connect(transport);
|
|
169
|
-
console.error('VTP MCP server running on stdio');
|
|
2
|
+
/**
|
|
3
|
+
* VTP MCP Package Entry Point
|
|
4
|
+
*
|
|
5
|
+
* Routes to either the MCP server or the install command based on arguments:
|
|
6
|
+
* - `npx myvtp-mcp` or `npx -y @myvtp/mcp` → runs the MCP server
|
|
7
|
+
* - `npx myvtp-mcp install` → runs the installer
|
|
8
|
+
*/
|
|
9
|
+
const args = process.argv.slice(2);
|
|
10
|
+
if (args[0] === 'install') {
|
|
11
|
+
// Run the install command
|
|
12
|
+
import('./install/index.js').then(m => m.default(args.slice(1)));
|
|
170
13
|
}
|
|
171
|
-
|
|
14
|
+
else {
|
|
15
|
+
// Run the MCP server (default)
|
|
16
|
+
import('./server.js');
|
|
17
|
+
}
|
|
18
|
+
export {};
|
|
172
19
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;GAMG;AAEH,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;AAEnC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,SAAS,EAAE,CAAC;IAC1B,0BAA0B;IAC1B,MAAM,CAAC,oBAAoB,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;AACnE,CAAC;KAAM,CAAC;IACN,+BAA+B;IAC/B,MAAM,CAAC,aAAa,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client detection utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { ClientConfig, DetectedClient } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Get the config path for a client on the current platform
|
|
7
|
+
*/
|
|
8
|
+
export declare function getConfigPath(client: ClientConfig): string | null;
|
|
9
|
+
/**
|
|
10
|
+
* Detect a single client's status
|
|
11
|
+
*/
|
|
12
|
+
export declare function detectClient(client: ClientConfig): DetectedClient | null;
|
|
13
|
+
/**
|
|
14
|
+
* Detect all available clients on the current system
|
|
15
|
+
*/
|
|
16
|
+
export declare function detectAllClients(): DetectedClient[];
|
|
17
|
+
/**
|
|
18
|
+
* Filter clients by ID
|
|
19
|
+
*/
|
|
20
|
+
export declare function filterClients(clients: DetectedClient[], ids: string[]): DetectedClient[];
|
|
21
|
+
/**
|
|
22
|
+
* Get a client by ID
|
|
23
|
+
*/
|
|
24
|
+
export declare function getClientById(id: string): ClientConfig | undefined;
|
|
25
|
+
//# sourceMappingURL=clients.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.d.ts","sourceRoot":"","sources":["../../src/install/clients.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE/D;;GAEG;AACH,wBAAgB,aAAa,CAAC,MAAM,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,CAGjE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,YAAY,GAAG,cAAc,GAAG,IAAI,CA4BxE;AAED;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,cAAc,EAAE,CAWnD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,cAAc,EAAE,CAExF;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,EAAE,MAAM,GAAG,YAAY,GAAG,SAAS,CAElE"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Client detection utilities
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync } from 'fs';
|
|
5
|
+
import { CLIENTS, VTP_SERVER_NAME } from './constants.js';
|
|
6
|
+
import { isVtpConfigured, readConfig } from './config.js';
|
|
7
|
+
/**
|
|
8
|
+
* Get the config path for a client on the current platform
|
|
9
|
+
*/
|
|
10
|
+
export function getConfigPath(client) {
|
|
11
|
+
const platform = process.platform;
|
|
12
|
+
return client.paths[platform] || null;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Detect a single client's status
|
|
16
|
+
*/
|
|
17
|
+
export function detectClient(client) {
|
|
18
|
+
const configPath = getConfigPath(client);
|
|
19
|
+
if (!configPath) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
const configExists = existsSync(configPath);
|
|
23
|
+
let existingConfig = null;
|
|
24
|
+
let vtpConfigured = false;
|
|
25
|
+
if (configExists) {
|
|
26
|
+
try {
|
|
27
|
+
existingConfig = readConfig(configPath);
|
|
28
|
+
vtpConfigured = isVtpConfigured(existingConfig, VTP_SERVER_NAME);
|
|
29
|
+
}
|
|
30
|
+
catch {
|
|
31
|
+
// Config exists but is invalid - we can still offer to fix it
|
|
32
|
+
existingConfig = null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return {
|
|
36
|
+
client,
|
|
37
|
+
configPath,
|
|
38
|
+
configExists,
|
|
39
|
+
vtpConfigured,
|
|
40
|
+
existingConfig: existingConfig || undefined,
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Detect all available clients on the current system
|
|
45
|
+
*/
|
|
46
|
+
export function detectAllClients() {
|
|
47
|
+
const detected = [];
|
|
48
|
+
for (const client of CLIENTS) {
|
|
49
|
+
const result = detectClient(client);
|
|
50
|
+
if (result) {
|
|
51
|
+
detected.push(result);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
return detected;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Filter clients by ID
|
|
58
|
+
*/
|
|
59
|
+
export function filterClients(clients, ids) {
|
|
60
|
+
return clients.filter(c => ids.includes(c.client.id));
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Get a client by ID
|
|
64
|
+
*/
|
|
65
|
+
export function getClientById(id) {
|
|
66
|
+
return CLIENTS.find(c => c.id === id);
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=clients.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"clients.js","sourceRoot":"","sources":["../../src/install/clients.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAG1D;;GA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,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACxD,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa,CAAC,EAAU;IACtC,OAAO,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration file reading and writing utilities
|
|
3
|
+
*/
|
|
4
|
+
import type { McpConfig, McpServerConfig } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Read and parse a JSON config file
|
|
7
|
+
* Returns null if file doesn't exist, throws on parse error
|
|
8
|
+
*/
|
|
9
|
+
export declare function readConfig(configPath: string): McpConfig | null;
|
|
10
|
+
/**
|
|
11
|
+
* Check if VTP is already configured in a config file
|
|
12
|
+
*/
|
|
13
|
+
export declare function isVtpConfigured(config: McpConfig | null, serverName: string): boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Merge VTP server config into existing config
|
|
16
|
+
* Creates a new config if none exists
|
|
17
|
+
* Preserves all existing servers and settings
|
|
18
|
+
*/
|
|
19
|
+
export declare function mergeVtpConfig(existingConfig: McpConfig | null, serverName: string, serverConfig: McpServerConfig, force?: boolean): {
|
|
20
|
+
config: McpConfig;
|
|
21
|
+
action: 'created' | 'updated' | 'skipped';
|
|
22
|
+
};
|
|
23
|
+
/**
|
|
24
|
+
* Write config to file, creating directories as needed
|
|
25
|
+
*/
|
|
26
|
+
export declare function writeConfig(configPath: string, config: McpConfig): void;
|
|
27
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/install/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE7D;;;GAGG;AACH,wBAAgB,UAAU,CAAC,UAAU,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAc/D;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,GAAG,IAAI,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAKrF;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAC5B,cAAc,EAAE,SAAS,GAAG,IAAI,EAChC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,eAAe,EAC7B,KAAK,GAAE,OAAe,GACrB;IAAE,MAAM,EAAE,SAAS,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,SAAS,CAAA;CAAE,CAuBlE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,GAAG,IAAI,CAUvE"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Configuration file reading and writing utilities
|
|
3
|
+
*/
|
|
4
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
|
|
5
|
+
import { dirname } from 'path';
|
|
6
|
+
/**
|
|
7
|
+
* Read and parse a JSON config file
|
|
8
|
+
* Returns null if file doesn't exist, throws on parse error
|
|
9
|
+
*/
|
|
10
|
+
export function readConfig(configPath) {
|
|
11
|
+
if (!existsSync(configPath)) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
try {
|
|
15
|
+
const content = readFileSync(configPath, 'utf-8');
|
|
16
|
+
return JSON.parse(content);
|
|
17
|
+
}
|
|
18
|
+
catch (error) {
|
|
19
|
+
if (error instanceof SyntaxError) {
|
|
20
|
+
throw new Error(`Invalid JSON in ${configPath}: ${error.message}`);
|
|
21
|
+
}
|
|
22
|
+
throw error;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Check if VTP is already configured in a config file
|
|
27
|
+
*/
|
|
28
|
+
export function isVtpConfigured(config, serverName) {
|
|
29
|
+
if (!config?.mcpServers) {
|
|
30
|
+
return false;
|
|
31
|
+
}
|
|
32
|
+
return serverName in config.mcpServers;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Merge VTP server config into existing config
|
|
36
|
+
* Creates a new config if none exists
|
|
37
|
+
* Preserves all existing servers and settings
|
|
38
|
+
*/
|
|
39
|
+
export function mergeVtpConfig(existingConfig, serverName, serverConfig, force = false) {
|
|
40
|
+
const config = existingConfig ? { ...existingConfig } : {};
|
|
41
|
+
// Ensure mcpServers exists
|
|
42
|
+
if (!config.mcpServers) {
|
|
43
|
+
config.mcpServers = {};
|
|
44
|
+
}
|
|
45
|
+
// Check if already configured
|
|
46
|
+
const alreadyConfigured = serverName in config.mcpServers;
|
|
47
|
+
if (alreadyConfigured && !force) {
|
|
48
|
+
return { config, action: 'skipped' };
|
|
49
|
+
}
|
|
50
|
+
// Add or update VTP server
|
|
51
|
+
config.mcpServers = {
|
|
52
|
+
...config.mcpServers,
|
|
53
|
+
[serverName]: serverConfig,
|
|
54
|
+
};
|
|
55
|
+
const action = existingConfig === null ? 'created' : 'updated';
|
|
56
|
+
return { config, action };
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Write config to file, creating directories as needed
|
|
60
|
+
*/
|
|
61
|
+
export function writeConfig(configPath, config) {
|
|
62
|
+
const dir = dirname(configPath);
|
|
63
|
+
// Create directory if it doesn't exist
|
|
64
|
+
if (!existsSync(dir)) {
|
|
65
|
+
mkdirSync(dir, { recursive: true });
|
|
66
|
+
}
|
|
67
|
+
const content = JSON.stringify(config, null, 2);
|
|
68
|
+
writeFileSync(configPath, content + '\n', 'utf-8');
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/install/config.ts"],"names":[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,IAAI,MAAM,CAAC,UAAU,CAAC;IAE1D,IAAI,iBAAiB,IAAI,CAAC,KAAK,EAAE,CAAC;QAChC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC;IACvC,CAAC;IAED,2BAA2B;IAC3B,MAAM,CAAC,UAAU,GAAG;QAClB,GAAG,MAAM,CAAC,UAAU;QACpB,CAAC,UAAU,CAAC,EAAE,YAAY;KAC3B,CAAC;IAEF,MAAM,MAAM,GAAG,cAAc,KAAK,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AAC5B,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,WAAW,CAAC,UAAkB,EAAE,MAAiB;IAC/D,MAAM,GAAG,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAEhC,uCAAuC;IACvC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACrB,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACtC,CAAC;IAED,MAAM,OAAO,GAAG,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IAChD,aAAa,CAAC,UAAU,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,CAAC,CAAC;AACrD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants and client definitions for the install command
|
|
3
|
+
*/
|
|
4
|
+
import type { ClientConfig, McpServerConfig } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Supported MCP clients with their config locations
|
|
7
|
+
*/
|
|
8
|
+
export declare const CLIENTS: ClientConfig[];
|
|
9
|
+
/**
|
|
10
|
+
* The VTP MCP server configuration to inject
|
|
11
|
+
*/
|
|
12
|
+
export declare function getVtpServerConfig(): McpServerConfig;
|
|
13
|
+
export declare const VTP_SERVER_NAME = "vtp";
|
|
14
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/install/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAEhE;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,YAAY,EAqEjC,CAAC;AAEF;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,eAAe,CAcpD;AAED,eAAO,MAAM,eAAe,QAAQ,CAAC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Constants and client definitions for the install command
|
|
3
|
+
*/
|
|
4
|
+
import { homedir } from 'os';
|
|
5
|
+
import { join } from 'path';
|
|
6
|
+
/**
|
|
7
|
+
* Supported MCP clients with their config locations
|
|
8
|
+
*/
|
|
9
|
+
export const CLIENTS = [
|
|
10
|
+
{
|
|
11
|
+
id: 'claude-desktop',
|
|
12
|
+
name: 'Claude Desktop',
|
|
13
|
+
description: 'Anthropic\'s desktop app for Claude',
|
|
14
|
+
paths: {
|
|
15
|
+
darwin: join(homedir(), 'Library', 'Application Support', 'Claude', 'claude_desktop_config.json'),
|
|
16
|
+
win32: join(process.env.APPDATA || '', 'Claude', 'claude_desktop_config.json'),
|
|
17
|
+
linux: join(homedir(), '.config', 'Claude', 'claude_desktop_config.json'),
|
|
18
|
+
},
|
|
19
|
+
restartInstructions: 'Quit and restart Claude Desktop',
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
id: 'claude-code',
|
|
23
|
+
name: 'Claude Code',
|
|
24
|
+
description: 'Anthropic\'s CLI tool for Claude',
|
|
25
|
+
paths: {
|
|
26
|
+
darwin: join(homedir(), '.claude.json'),
|
|
27
|
+
win32: join(homedir(), '.claude.json'),
|
|
28
|
+
linux: join(homedir(), '.claude.json'),
|
|
29
|
+
},
|
|
30
|
+
restartInstructions: 'Start a new Claude Code session',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: 'cursor',
|
|
34
|
+
name: 'Cursor',
|
|
35
|
+
description: 'AI-powered code editor',
|
|
36
|
+
paths: {
|
|
37
|
+
darwin: join(homedir(), '.cursor', 'mcp.json'),
|
|
38
|
+
win32: join(homedir(), '.cursor', 'mcp.json'),
|
|
39
|
+
linux: join(homedir(), '.cursor', 'mcp.json'),
|
|
40
|
+
},
|
|
41
|
+
restartInstructions: 'Restart Cursor',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: 'project',
|
|
45
|
+
name: 'Project (.mcp.json)',
|
|
46
|
+
description: 'Project-level config in current directory',
|
|
47
|
+
paths: {
|
|
48
|
+
darwin: join(process.cwd(), '.mcp.json'),
|
|
49
|
+
win32: join(process.cwd(), '.mcp.json'),
|
|
50
|
+
linux: join(process.cwd(), '.mcp.json'),
|
|
51
|
+
},
|
|
52
|
+
projectLevel: true,
|
|
53
|
+
restartInstructions: 'Restart your AI coding assistant',
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
id: 'vscode',
|
|
57
|
+
name: 'VS Code',
|
|
58
|
+
description: 'Project-level MCP config for VS Code',
|
|
59
|
+
paths: {
|
|
60
|
+
darwin: join(process.cwd(), '.vscode', 'mcp.json'),
|
|
61
|
+
win32: join(process.cwd(), '.vscode', 'mcp.json'),
|
|
62
|
+
linux: join(process.cwd(), '.vscode', 'mcp.json'),
|
|
63
|
+
},
|
|
64
|
+
projectLevel: true,
|
|
65
|
+
restartInstructions: 'Reload VS Code window (Cmd/Ctrl+Shift+P → "Reload Window")',
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: 'windsurf',
|
|
69
|
+
name: 'Windsurf',
|
|
70
|
+
description: 'Codeium\'s AI code editor',
|
|
71
|
+
paths: {
|
|
72
|
+
darwin: join(homedir(), '.codeium', 'windsurf', 'mcp_config.json'),
|
|
73
|
+
win32: join(homedir(), '.codeium', 'windsurf', 'mcp_config.json'),
|
|
74
|
+
linux: join(homedir(), '.codeium', 'windsurf', 'mcp_config.json'),
|
|
75
|
+
},
|
|
76
|
+
restartInstructions: 'Restart Windsurf',
|
|
77
|
+
},
|
|
78
|
+
];
|
|
79
|
+
/**
|
|
80
|
+
* The VTP MCP server configuration to inject
|
|
81
|
+
*/
|
|
82
|
+
export function getVtpServerConfig() {
|
|
83
|
+
const isWindows = process.platform === 'win32';
|
|
84
|
+
if (isWindows) {
|
|
85
|
+
return {
|
|
86
|
+
command: 'cmd',
|
|
87
|
+
args: ['/c', 'npx', '-y', '@myvtp/mcp'],
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
return {
|
|
91
|
+
command: 'npx',
|
|
92
|
+
args: ['-y', '@myvtp/mcp'],
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
export const VTP_SERVER_NAME = 'vtp';
|
|
96
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/install/constants.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAG5B;;GAEG;AACH,MAAM,CAAC,MAAM,OAAO,GAAmB;IACrC;QACE,EAAE,EAAE,gBAAgB;QACpB,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,qCAAqC;QAClD,KAAK,EAAE;YACL,MAAM,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,qBAAqB,EAAE,QAAQ,EAAE,4BAA4B,CAAC;YACjG,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE,QAAQ,EAAE,4BAA4B,CAAC;YAC9E,KAAK,EAAE,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,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AEG;AAmLH;;GAEG;AACH,wBAA8B,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAsGnE"}
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Install command - configures VTP MCP server for AI coding clients
|
|
3
|
+
*/
|
|
4
|
+
import { checkbox, confirm } from '@inquirer/prompts';
|
|
5
|
+
import pc from 'picocolors';
|
|
6
|
+
import { detectAllClients, filterClients, getClientById } from './clients.js';
|
|
7
|
+
import { mergeVtpConfig, readConfig, writeConfig } from './config.js';
|
|
8
|
+
import { getVtpServerConfig, VTP_SERVER_NAME } from './constants.js';
|
|
9
|
+
/**
|
|
10
|
+
* Wrap a cancellable prompt to also cancel on Escape key
|
|
11
|
+
*/
|
|
12
|
+
function withEscapeCancel(prompt) {
|
|
13
|
+
return new Promise((resolve, reject) => {
|
|
14
|
+
// Set up escape key listener
|
|
15
|
+
const onData = (data) => {
|
|
16
|
+
// Escape key is 0x1b (27) as a single byte
|
|
17
|
+
if (data.length === 1 && data[0] === 0x1b) {
|
|
18
|
+
prompt.cancel();
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
process.stdin.on('data', onData);
|
|
22
|
+
prompt
|
|
23
|
+
.then(resolve)
|
|
24
|
+
.catch(reject)
|
|
25
|
+
.finally(() => {
|
|
26
|
+
process.stdin.off('data', onData);
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Parse CLI arguments into install options
|
|
32
|
+
*/
|
|
33
|
+
function parseArgs(args) {
|
|
34
|
+
const options = {};
|
|
35
|
+
for (let i = 0; i < args.length; i++) {
|
|
36
|
+
const arg = args[i];
|
|
37
|
+
if (arg === '--yes' || arg === '-y') {
|
|
38
|
+
options.yes = true;
|
|
39
|
+
}
|
|
40
|
+
else if (arg === '--force' || arg === '-f') {
|
|
41
|
+
options.force = true;
|
|
42
|
+
}
|
|
43
|
+
else if (!arg.startsWith('-')) {
|
|
44
|
+
// Client ID
|
|
45
|
+
if (!options.clients) {
|
|
46
|
+
options.clients = [];
|
|
47
|
+
}
|
|
48
|
+
options.clients.push(arg);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return options;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Format client choice for the checkbox prompt
|
|
55
|
+
*/
|
|
56
|
+
function formatClientChoice(detected) {
|
|
57
|
+
const { client, configExists, vtpConfigured, configPath } = detected;
|
|
58
|
+
let status = '';
|
|
59
|
+
let checked = true;
|
|
60
|
+
if (vtpConfigured) {
|
|
61
|
+
status = pc.yellow(' (already configured)');
|
|
62
|
+
checked = false;
|
|
63
|
+
}
|
|
64
|
+
else if (configExists) {
|
|
65
|
+
status = pc.dim(' (will update config)');
|
|
66
|
+
}
|
|
67
|
+
else if (client.projectLevel) {
|
|
68
|
+
status = pc.dim(` (will create ${configPath})`);
|
|
69
|
+
checked = false; // Don't auto-select project-level configs
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
status = pc.dim(' (will create config)');
|
|
73
|
+
}
|
|
74
|
+
return {
|
|
75
|
+
name: `${client.name}${status}`,
|
|
76
|
+
value: client.id,
|
|
77
|
+
checked,
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* Configure a single client
|
|
82
|
+
*/
|
|
83
|
+
function configureClient(detected, force) {
|
|
84
|
+
const { client, configPath, vtpConfigured } = detected;
|
|
85
|
+
// Skip if already configured and not forcing
|
|
86
|
+
if (vtpConfigured && !force) {
|
|
87
|
+
return {
|
|
88
|
+
client,
|
|
89
|
+
success: true,
|
|
90
|
+
action: 'skipped',
|
|
91
|
+
message: 'VTP already configured',
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
const existingConfig = readConfig(configPath);
|
|
96
|
+
const vtpConfig = getVtpServerConfig();
|
|
97
|
+
const { config, action } = mergeVtpConfig(existingConfig, VTP_SERVER_NAME, vtpConfig, force);
|
|
98
|
+
if (action === 'skipped') {
|
|
99
|
+
return {
|
|
100
|
+
client,
|
|
101
|
+
success: true,
|
|
102
|
+
action: 'skipped',
|
|
103
|
+
message: 'VTP already configured',
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
writeConfig(configPath, config);
|
|
107
|
+
return {
|
|
108
|
+
client,
|
|
109
|
+
success: true,
|
|
110
|
+
action,
|
|
111
|
+
message: action === 'created' ? 'Created new config with VTP server' : 'Added VTP server to existing config',
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
catch (error) {
|
|
115
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
116
|
+
return {
|
|
117
|
+
client,
|
|
118
|
+
success: false,
|
|
119
|
+
action: 'error',
|
|
120
|
+
message,
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Print the results summary
|
|
126
|
+
*/
|
|
127
|
+
function printResults(results) {
|
|
128
|
+
console.log();
|
|
129
|
+
const successResults = results.filter(r => r.success && r.action !== 'skipped');
|
|
130
|
+
const skippedResults = results.filter(r => r.action === 'skipped');
|
|
131
|
+
const errorResults = results.filter(r => !r.success);
|
|
132
|
+
// Print successes
|
|
133
|
+
for (const result of successResults) {
|
|
134
|
+
console.log(` ${pc.green('✓')} ${result.client.name}: ${result.message}`);
|
|
135
|
+
}
|
|
136
|
+
// Print skipped
|
|
137
|
+
for (const result of skippedResults) {
|
|
138
|
+
console.log(` ${pc.yellow('○')} ${result.client.name}: ${result.message}`);
|
|
139
|
+
}
|
|
140
|
+
// Print errors
|
|
141
|
+
for (const result of errorResults) {
|
|
142
|
+
console.log(` ${pc.red('✗')} ${result.client.name}: ${result.message}`);
|
|
143
|
+
}
|
|
144
|
+
// Print next steps if we configured anything
|
|
145
|
+
if (successResults.length > 0) {
|
|
146
|
+
console.log();
|
|
147
|
+
console.log(pc.bold(' Next steps:'));
|
|
148
|
+
const restartInstructions = [...new Set(successResults.map(r => r.client.restartInstructions))];
|
|
149
|
+
restartInstructions.forEach((instruction, i) => {
|
|
150
|
+
console.log(` ${i + 1}. ${instruction}`);
|
|
151
|
+
});
|
|
152
|
+
console.log();
|
|
153
|
+
console.log(pc.dim(' Once restarted, ask Claude to "deploy my app" to get started.'));
|
|
154
|
+
}
|
|
155
|
+
console.log();
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Main install command
|
|
159
|
+
*/
|
|
160
|
+
export default async function install(args) {
|
|
161
|
+
const options = parseArgs(args);
|
|
162
|
+
// Header
|
|
163
|
+
console.log();
|
|
164
|
+
console.log(pc.bold(' VTP MCP Server Setup'));
|
|
165
|
+
console.log(pc.dim(' Configure AI coding assistants to use VTP for deployments'));
|
|
166
|
+
console.log();
|
|
167
|
+
// Detect available clients
|
|
168
|
+
let detected = detectAllClients();
|
|
169
|
+
if (detected.length === 0) {
|
|
170
|
+
console.log(pc.yellow(' No supported AI clients detected.'));
|
|
171
|
+
console.log();
|
|
172
|
+
console.log(' Supported clients: Claude Desktop, Claude Code, Cursor, VS Code, Windsurf');
|
|
173
|
+
console.log();
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
// Filter by specified clients if provided
|
|
177
|
+
if (options.clients && options.clients.length > 0) {
|
|
178
|
+
// Validate client IDs
|
|
179
|
+
for (const id of options.clients) {
|
|
180
|
+
if (!getClientById(id)) {
|
|
181
|
+
console.log(pc.red(` Unknown client: ${id}`));
|
|
182
|
+
console.log();
|
|
183
|
+
console.log(' Available clients: ' + detected.map(d => d.client.id).join(', '));
|
|
184
|
+
console.log();
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
detected = filterClients(detected, options.clients);
|
|
189
|
+
}
|
|
190
|
+
let selectedClients;
|
|
191
|
+
if (options.yes) {
|
|
192
|
+
// Non-interactive mode: select all (or filtered) clients
|
|
193
|
+
selectedClients = detected;
|
|
194
|
+
if (selectedClients.length === 0) {
|
|
195
|
+
console.log(pc.yellow(' No clients to configure.'));
|
|
196
|
+
console.log();
|
|
197
|
+
return;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
// Interactive mode: show checkbox prompt
|
|
202
|
+
const choices = detected.map(formatClientChoice);
|
|
203
|
+
try {
|
|
204
|
+
const checkboxPrompt = checkbox({
|
|
205
|
+
message: 'Select AI clients to configure:',
|
|
206
|
+
choices,
|
|
207
|
+
pageSize: 10,
|
|
208
|
+
required: true,
|
|
209
|
+
});
|
|
210
|
+
const selectedIds = await withEscapeCancel(checkboxPrompt);
|
|
211
|
+
if (selectedIds.length === 0) {
|
|
212
|
+
console.log(pc.yellow(' No clients selected.'));
|
|
213
|
+
console.log();
|
|
214
|
+
return;
|
|
215
|
+
}
|
|
216
|
+
selectedClients = filterClients(detected, selectedIds);
|
|
217
|
+
// Check for already-configured clients and confirm overwrite
|
|
218
|
+
const alreadyConfigured = selectedClients.filter(c => c.vtpConfigured);
|
|
219
|
+
if (alreadyConfigured.length > 0 && !options.force) {
|
|
220
|
+
const names = alreadyConfigured.map(c => c.client.name).join(', ');
|
|
221
|
+
const confirmPrompt = confirm({
|
|
222
|
+
message: `${names} already have VTP configured. Overwrite?`,
|
|
223
|
+
default: false,
|
|
224
|
+
});
|
|
225
|
+
const shouldOverwrite = await withEscapeCancel(confirmPrompt);
|
|
226
|
+
if (!shouldOverwrite) {
|
|
227
|
+
selectedClients = selectedClients.filter(c => !c.vtpConfigured);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
options.force = true;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
catch {
|
|
235
|
+
// User cancelled (Ctrl+C or Escape)
|
|
236
|
+
console.log();
|
|
237
|
+
return;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
// Configure selected clients
|
|
241
|
+
const results = [];
|
|
242
|
+
for (const detected of selectedClients) {
|
|
243
|
+
const result = configureClient(detected, options.force || false);
|
|
244
|
+
results.push(result);
|
|
245
|
+
}
|
|
246
|
+
// Print results
|
|
247
|
+
printResults(results);
|
|
248
|
+
}
|
|
249
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/install/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC9E,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAKrE;;GAEG;AACH,SAAS,gBAAgB,CAAI,MAA6B;IACxD,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,6BAA6B;QAC7B,MAAM,MAAM,GAAG,CAAC,IAAY,EAAE,EAAE;YAC9B,2CAA2C;YAC3C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,EAAE,CAAC;gBAC1C,MAAM,CAAC,MAAM,EAAE,CAAC;YAClB,CAAC;QACH,CAAC,CAAC;QAEF,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAEjC,MAAM;aACH,IAAI,CAAC,OAAO,CAAC;aACb,KAAK,CAAC,MAAM,CAAC;aACb,OAAO,CAAC,GAAG,EAAE;YACZ,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACpC,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,SAAS,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f,CAAgC,CAAC;gBAElC,MAAM,eAAe,GAAG,MAAM,gBAAgB,CAAC,aAAa,CAAC,CAAC;gBAE9D,IAAI,CAAC,eAAe,EAAE,CAAC;oBACrB,eAAe,GAAG,eAAe,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC;gBAClE,CAAC;qBAAM,CAAC;oBACN,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;gBACvB,CAAC;YACH,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oCAAoC;YACpC,OAAO,CAAC,GAAG,EAAE,CAAC;YACd,OAAO;QACT,CAAC;IACH,CAAC;IAED,6BAA6B;IAC7B,MAAM,OAAO,GAAoB,EAAE,CAAC;IACpC,KAAK,MAAM,QAAQ,IAAI,eAAe,EAAE,CAAC;QACvC,MAAM,MAAM,GAAG,eAAe,CAAC,QAAQ,EAAE,OAAO,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC;QACjE,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IACvB,CAAC;IAED,gBAAgB;IAChB,YAAY,CAAC,OAAO,CAAC,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Type definitions for the install command
|
|
3
|
+
*/
|
|
4
|
+
export interface ClientConfig {
|
|
5
|
+
/** Display name for the client */
|
|
6
|
+
name: string;
|
|
7
|
+
/** Unique identifier used in CLI args */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Description shown in the installer */
|
|
10
|
+
description: string;
|
|
11
|
+
/** Config file paths per platform */
|
|
12
|
+
paths: {
|
|
13
|
+
darwin?: string;
|
|
14
|
+
win32?: string;
|
|
15
|
+
linux?: string;
|
|
16
|
+
};
|
|
17
|
+
/** Whether this is a project-level config (like VS Code) */
|
|
18
|
+
projectLevel?: boolean;
|
|
19
|
+
/** Restart instructions after configuration */
|
|
20
|
+
restartInstructions: string;
|
|
21
|
+
}
|
|
22
|
+
export interface DetectedClient {
|
|
23
|
+
/** Client definition */
|
|
24
|
+
client: ClientConfig;
|
|
25
|
+
/** Resolved config path for current platform */
|
|
26
|
+
configPath: string;
|
|
27
|
+
/** Whether the config file exists */
|
|
28
|
+
configExists: boolean;
|
|
29
|
+
/** Whether VTP is already configured */
|
|
30
|
+
vtpConfigured: boolean;
|
|
31
|
+
/** The existing config content (if readable) */
|
|
32
|
+
existingConfig?: McpConfig;
|
|
33
|
+
}
|
|
34
|
+
export interface McpServerConfig {
|
|
35
|
+
command: string;
|
|
36
|
+
args: string[];
|
|
37
|
+
env?: Record<string, string>;
|
|
38
|
+
}
|
|
39
|
+
export interface McpConfig {
|
|
40
|
+
mcpServers?: Record<string, McpServerConfig>;
|
|
41
|
+
[key: string]: unknown;
|
|
42
|
+
}
|
|
43
|
+
export interface InstallOptions {
|
|
44
|
+
/** Run without prompts, configure all detected clients */
|
|
45
|
+
yes?: boolean;
|
|
46
|
+
/** Force overwrite existing VTP config */
|
|
47
|
+
force?: boolean;
|
|
48
|
+
/** Specific clients to configure (by id) */
|
|
49
|
+
clients?: string[];
|
|
50
|
+
}
|
|
51
|
+
export interface InstallResult {
|
|
52
|
+
client: ClientConfig;
|
|
53
|
+
success: boolean;
|
|
54
|
+
action: 'created' | 'updated' | 'skipped' | 'error';
|
|
55
|
+
message: string;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/install/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,yCAAyC;IACzC,EAAE,EAAE,MAAM,CAAC;IACX,yCAAyC;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,qCAAqC;IACrC,KAAK,EAAE;QACL,MAAM,CAAC,EAAE,MAAM,CAAC;QA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A;;GAEG"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG"}
|
package/dist/server.js
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* VTP MCP Server - handles tool requests from AI assistants
|
|
3
|
+
*/
|
|
4
|
+
import { Server } from '@modelcontextprotocol/sdk/server/index.js';
|
|
5
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
6
|
+
import { CallToolRequestSchema, ListToolsRequestSchema, } from '@modelcontextprotocol/sdk/types.js';
|
|
7
|
+
import { existsSync } from 'fs';
|
|
8
|
+
import * as client from './client.js';
|
|
9
|
+
import { DeploySchema, GuideTypeSchema, toolDefinitions } from './tools.js';
|
|
10
|
+
const server = new Server({
|
|
11
|
+
name: 'vtp',
|
|
12
|
+
version: '0.7.0',
|
|
13
|
+
}, {
|
|
14
|
+
capabilities: {
|
|
15
|
+
tools: {},
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
// List available tools
|
|
19
|
+
server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
20
|
+
tools: toolDefinitions,
|
|
21
|
+
}));
|
|
22
|
+
// Handle tool calls - all delegate to HTTP API via client
|
|
23
|
+
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
24
|
+
const { name, arguments: args } = request.params;
|
|
25
|
+
try {
|
|
26
|
+
switch (name) {
|
|
27
|
+
case 'list_app_types': {
|
|
28
|
+
const types = await client.listAppTypes();
|
|
29
|
+
const typeList = types
|
|
30
|
+
.map(t => `- **${t.displayName}** (${t.type})\n ${t.description}`)
|
|
31
|
+
.join('\n');
|
|
32
|
+
return {
|
|
33
|
+
content: [{
|
|
34
|
+
type: 'text',
|
|
35
|
+
text: `Supported app types:\n\n${typeList}\n\n` +
|
|
36
|
+
`Use get_deployment_guide with a type to see detailed instructions.`,
|
|
37
|
+
}],
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
case 'get_deployment_guide': {
|
|
41
|
+
const { type: guideType } = GuideTypeSchema.parse(args);
|
|
42
|
+
try {
|
|
43
|
+
const guide = await client.getDeploymentGuide(guideType);
|
|
44
|
+
return {
|
|
45
|
+
content: [{
|
|
46
|
+
type: 'text',
|
|
47
|
+
text: guide.content,
|
|
48
|
+
}],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
if (error instanceof Error && error.message.includes('guide_not_found')) {
|
|
53
|
+
const types = await client.listAppTypes();
|
|
54
|
+
const available = types.map(t => t.type).join(', ');
|
|
55
|
+
return {
|
|
56
|
+
content: [{
|
|
57
|
+
type: 'text',
|
|
58
|
+
text: `Unknown app type: "${guideType}"\n\nAvailable types: ${available}`,
|
|
59
|
+
}],
|
|
60
|
+
isError: true,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
case 'deploy': {
|
|
67
|
+
const { config, force } = DeploySchema.parse(args);
|
|
68
|
+
const configPath = config || './vtp.yaml';
|
|
69
|
+
// Validate config exists
|
|
70
|
+
if (!existsSync(configPath)) {
|
|
71
|
+
return {
|
|
72
|
+
content: [{
|
|
73
|
+
type: 'text',
|
|
74
|
+
text: `Error: Config file not found: ${configPath}\n\n` +
|
|
75
|
+
`Create a vtp.yaml file with:\n` +
|
|
76
|
+
` name: My App Name # Display name\n` +
|
|
77
|
+
` id: my-app # Optional: URL slug\n` +
|
|
78
|
+
` type: static # or "node"\n` +
|
|
79
|
+
` path: ./dist # folder to deploy\n\n` +
|
|
80
|
+
`Use list_app_types and get_deployment_guide for help.`,
|
|
81
|
+
}],
|
|
82
|
+
isError: true,
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// Deploy via HTTP API
|
|
86
|
+
const result = await client.deploy(configPath, force ?? false);
|
|
87
|
+
// Handle conflict
|
|
88
|
+
if (result.error === 'conflict') {
|
|
89
|
+
const existingApp = result.existingApp;
|
|
90
|
+
return {
|
|
91
|
+
content: [{
|
|
92
|
+
type: 'text',
|
|
93
|
+
text: `App '${existingApp?.id}' already exists at ${existingApp?.url || 'unknown URL'}\n` +
|
|
94
|
+
`Name: ${existingApp?.name || 'unknown'}\n` +
|
|
95
|
+
`Status: ${existingApp?.status || 'unknown'}\n\n` +
|
|
96
|
+
`Use force: true to replace it.`,
|
|
97
|
+
}],
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
// Handle other errors
|
|
101
|
+
if (result.error) {
|
|
102
|
+
return {
|
|
103
|
+
content: [{
|
|
104
|
+
type: 'text',
|
|
105
|
+
text: `Error: ${result.message || result.error}`,
|
|
106
|
+
}],
|
|
107
|
+
isError: true,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
// Success
|
|
111
|
+
const app = result.app;
|
|
112
|
+
const prefix = result.replaced ? 'Replaced' : 'Deployed';
|
|
113
|
+
return {
|
|
114
|
+
content: [{
|
|
115
|
+
type: 'text',
|
|
116
|
+
text: `${prefix} ${app.name} (@${app.id})\n` +
|
|
117
|
+
` URL: ${app.url}\n` +
|
|
118
|
+
` Type: ${app.type}\n` +
|
|
119
|
+
` Status: ${app.status}`,
|
|
120
|
+
}],
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
case 'list': {
|
|
124
|
+
const apps = await client.listApps();
|
|
125
|
+
if (apps.length === 0) {
|
|
126
|
+
return {
|
|
127
|
+
content: [{
|
|
128
|
+
type: 'text',
|
|
129
|
+
text: 'No apps deployed yet.',
|
|
130
|
+
}],
|
|
131
|
+
};
|
|
132
|
+
}
|
|
133
|
+
const appList = apps
|
|
134
|
+
.map(app => {
|
|
135
|
+
const desc = app.description ? `\n ${app.description}` : '';
|
|
136
|
+
return `- ${app.name} (@${app.id}) - ${app.type} - ${app.status}${desc}\n ${app.url}`;
|
|
137
|
+
})
|
|
138
|
+
.join('\n');
|
|
139
|
+
return {
|
|
140
|
+
content: [{
|
|
141
|
+
type: 'text',
|
|
142
|
+
text: `Deployed apps:\n${appList}`,
|
|
143
|
+
}],
|
|
144
|
+
};
|
|
145
|
+
}
|
|
146
|
+
default:
|
|
147
|
+
return {
|
|
148
|
+
content: [{
|
|
149
|
+
type: 'text',
|
|
150
|
+
text: `Unknown tool: ${name}`,
|
|
151
|
+
}],
|
|
152
|
+
isError: true,
|
|
153
|
+
};
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
catch (error) {
|
|
157
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
158
|
+
return {
|
|
159
|
+
content: [{
|
|
160
|
+
type: 'text',
|
|
161
|
+
text: `Error: ${message}`,
|
|
162
|
+
}],
|
|
163
|
+
isError: true,
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
// Start the server
|
|
168
|
+
async function main() {
|
|
169
|
+
const transport = new StdioServerTransport();
|
|
170
|
+
await server.connect(transport);
|
|
171
|
+
console.error('VTP MCP server running on stdio');
|
|
172
|
+
}
|
|
173
|
+
main().catch(console.error);
|
|
174
|
+
//# sourceMappingURL=server.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.js","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,2CAA2C,CAAC;AACnE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EACL,qBAAqB,EACrB,sBAAsB,GACvB,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAEhC,OAAO,KAAK,MAAM,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAE5E,MAAM,MAAM,GAAG,IAAI,MAAM,CACvB;IACE,IAAI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,CAAC;AAEH,mBAAmB;AACnB,KAAK,UAAU,IAAI;IACjB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;IAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IAChC,OAAO,CAAC,KAAK,CAAC,iCAAiC,CAAC,CAAC;AACnD,CAAC;AAED,IAAI,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myvtp/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for VTP - deploy apps via Claude Code",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
},
|
|
33
33
|
"homepage": "https://github.com/myvtp/mcp#readme",
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@inquirer/prompts": "^7.0.0",
|
|
35
36
|
"@modelcontextprotocol/sdk": "^1.0.0",
|
|
36
37
|
"form-data": "^4.0.0",
|
|
37
38
|
"ignore": "^7.0.5",
|
|
39
|
+
"picocolors": "^1.1.0",
|
|
38
40
|
"tar": "^7.5.7",
|
|
39
41
|
"yaml": "^2.8.2",
|
|
40
42
|
"zod": "^3.22.4"
|