impact-ui-mcp-server 1.0.1 → 1.0.3
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/NPM_PACKAGE_SETUP.md +4 -0
- package/generate-cursor-config.js +90 -37
- package/generate-windsurf-config.js +30 -7
- package/package.json +1 -1
package/NPM_PACKAGE_SETUP.md
CHANGED
|
@@ -28,6 +28,10 @@ your-project/
|
|
|
28
28
|
npm install impact-ui impact-ui-mcp-server
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
+
**Package Names:**
|
|
32
|
+
- `impact-ui` - The UI library
|
|
33
|
+
- `impact-ui-mcp-server` - The MCP server (published to npm)
|
|
34
|
+
|
|
31
35
|
## Windsurf Configuration
|
|
32
36
|
|
|
33
37
|
Since Windsurf needs absolute paths, use this configuration:
|
|
@@ -29,72 +29,124 @@ let config;
|
|
|
29
29
|
let impactUiPathToUse = impactUiPath;
|
|
30
30
|
|
|
31
31
|
if (useNpm) {
|
|
32
|
-
// Check if package is installed
|
|
33
|
-
let
|
|
32
|
+
// Check if package is installed (try both scoped and unscoped names)
|
|
33
|
+
let packageFound = false;
|
|
34
|
+
let packageName = "impact-ui-mcp-server";
|
|
35
|
+
|
|
34
36
|
try {
|
|
35
|
-
packagePath = execSync("npm list
|
|
37
|
+
const packagePath = execSync("npm list impact-ui-mcp-server --json", { encoding: "utf-8", stdio: "pipe" });
|
|
36
38
|
const packageInfo = JSON.parse(packagePath);
|
|
37
|
-
if (
|
|
38
|
-
|
|
39
|
-
console.log(" npm install @impact-analytics/impact-ui-mcp-server\n");
|
|
40
|
-
process.exit(1);
|
|
39
|
+
if (packageInfo.dependencies && packageInfo.dependencies["impact-ui-mcp-server"]) {
|
|
40
|
+
packageFound = true;
|
|
41
41
|
}
|
|
42
42
|
} catch (error) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
43
|
+
// Try scoped version
|
|
44
|
+
try {
|
|
45
|
+
const packagePath = execSync("npm list @impact-analytics/impact-ui-mcp-server --json", { encoding: "utf-8", stdio: "pipe" });
|
|
46
|
+
const packageInfo = JSON.parse(packagePath);
|
|
47
|
+
if (packageInfo.dependencies && packageInfo.dependencies["@impact-analytics/impact-ui-mcp-server"]) {
|
|
48
|
+
packageFound = true;
|
|
49
|
+
packageName = "@impact-analytics/impact-ui-mcp-server";
|
|
50
|
+
}
|
|
51
|
+
} catch (error2) {
|
|
52
|
+
// Package not found, but continue - user might install it later
|
|
53
|
+
}
|
|
53
54
|
}
|
|
54
55
|
|
|
55
|
-
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
// For npm packages, use ${workspaceFolder} variables (Cursor supports these)
|
|
57
|
+
// Try to detect actual structure, otherwise use most common structure
|
|
58
|
+
const cwd = process.cwd();
|
|
59
|
+
let mcpServerPath = "${workspaceFolder}/frontend/node_modules/impact-ui-mcp-server/src/index.js";
|
|
60
|
+
let impactUiPath = "${workspaceFolder}/frontend/node_modules/impact-ui";
|
|
61
|
+
|
|
62
|
+
// Check actual structure to determine which path to use
|
|
63
|
+
const frontendMcpPath = resolve(cwd, "frontend", "node_modules", "impact-ui-mcp-server", "src", "index.js");
|
|
64
|
+
const rootMcpPath = resolve(cwd, "node_modules", "impact-ui-mcp-server", "src", "index.js");
|
|
65
|
+
|
|
66
|
+
if (existsSync(frontendMcpPath)) {
|
|
67
|
+
// Packages are in frontend/node_modules
|
|
68
|
+
mcpServerPath = "${workspaceFolder}/frontend/node_modules/impact-ui-mcp-server/src/index.js";
|
|
69
|
+
impactUiPath = "${workspaceFolder}/frontend/node_modules/impact-ui";
|
|
70
|
+
} else if (existsSync(rootMcpPath)) {
|
|
71
|
+
// Packages are in root node_modules
|
|
72
|
+
mcpServerPath = "${workspaceFolder}/node_modules/impact-ui-mcp-server/src/index.js";
|
|
73
|
+
impactUiPath = "${workspaceFolder}/node_modules/impact-ui";
|
|
59
74
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
75
|
+
|
|
76
|
+
// Check for scoped package name
|
|
77
|
+
const frontendScopedMcpPath = resolve(cwd, "frontend", "node_modules", "@impact-analytics", "impact-ui-mcp-server", "src", "index.js");
|
|
78
|
+
const rootScopedMcpPath = resolve(cwd, "node_modules", "@impact-analytics", "impact-ui-mcp-server", "src", "index.js");
|
|
79
|
+
|
|
80
|
+
if (existsSync(frontendScopedMcpPath)) {
|
|
81
|
+
mcpServerPath = "${workspaceFolder}/frontend/node_modules/@impact-analytics/impact-ui-mcp-server/src/index.js";
|
|
82
|
+
} else if (existsSync(rootScopedMcpPath)) {
|
|
83
|
+
mcpServerPath = "${workspaceFolder}/node_modules/@impact-analytics/impact-ui-mcp-server/src/index.js";
|
|
64
84
|
}
|
|
65
85
|
|
|
66
86
|
config = {
|
|
67
87
|
"mcp.servers": {
|
|
68
88
|
"impact-ui": {
|
|
69
89
|
"command": "node",
|
|
70
|
-
"args": [
|
|
71
|
-
"./node_modules/@impact-analytics/impact-ui-mcp-server/src/index.js"
|
|
72
|
-
],
|
|
90
|
+
"args": [mcpServerPath],
|
|
73
91
|
"cwd": "${workspaceFolder}",
|
|
74
92
|
"env": {
|
|
75
|
-
"
|
|
93
|
+
"IMPACT_UI_NODE_MODULES": impactUiPath
|
|
76
94
|
}
|
|
77
95
|
}
|
|
78
96
|
}
|
|
79
97
|
};
|
|
80
98
|
|
|
81
|
-
console.log("\n📦 NPM Package Configuration\n");
|
|
99
|
+
console.log("\n📦 NPM Package Configuration (with ${workspaceFolder} variables)\n");
|
|
100
|
+
if (!packageFound) {
|
|
101
|
+
console.log("⚠️ Note: Package not detected in current directory.");
|
|
102
|
+
console.log(" Make sure to install: npm install impact-ui-mcp-server\n");
|
|
103
|
+
}
|
|
82
104
|
} else {
|
|
83
|
-
//
|
|
84
|
-
|
|
85
|
-
const
|
|
105
|
+
// For npm packages (when run from a project), use ${workspaceFolder} variables
|
|
106
|
+
// Try to detect if we're in a project with node_modules
|
|
107
|
+
const cwd = process.cwd();
|
|
108
|
+
let mcpServerPath = "${workspaceFolder}/frontend/node_modules/impact-ui-mcp-server/src/index.js";
|
|
109
|
+
let impactUiPath = "${workspaceFolder}/frontend/node_modules/impact-ui";
|
|
110
|
+
|
|
111
|
+
// Check actual structure to determine which path to use
|
|
112
|
+
const frontendMcpPath = resolve(cwd, "frontend", "node_modules", "impact-ui-mcp-server", "src", "index.js");
|
|
113
|
+
const rootMcpPath = resolve(cwd, "node_modules", "impact-ui-mcp-server", "src", "index.js");
|
|
114
|
+
|
|
115
|
+
if (existsSync(frontendMcpPath)) {
|
|
116
|
+
// Packages are in frontend/node_modules
|
|
117
|
+
mcpServerPath = "${workspaceFolder}/frontend/node_modules/impact-ui-mcp-server/src/index.js";
|
|
118
|
+
impactUiPath = "${workspaceFolder}/frontend/node_modules/impact-ui";
|
|
119
|
+
} else if (existsSync(rootMcpPath)) {
|
|
120
|
+
// Packages are in root node_modules
|
|
121
|
+
mcpServerPath = "${workspaceFolder}/node_modules/impact-ui-mcp-server/src/index.js";
|
|
122
|
+
impactUiPath = "${workspaceFolder}/node_modules/impact-ui";
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
// Check for scoped package name
|
|
126
|
+
const frontendScopedMcpPath = resolve(cwd, "frontend", "node_modules", "@impact-analytics", "impact-ui-mcp-server", "src", "index.js");
|
|
127
|
+
const rootScopedMcpPath = resolve(cwd, "node_modules", "@impact-analytics", "impact-ui-mcp-server", "src", "index.js");
|
|
128
|
+
|
|
129
|
+
if (existsSync(frontendScopedMcpPath)) {
|
|
130
|
+
mcpServerPath = "${workspaceFolder}/frontend/node_modules/@impact-analytics/impact-ui-mcp-server/src/index.js";
|
|
131
|
+
} else if (existsSync(rootScopedMcpPath)) {
|
|
132
|
+
mcpServerPath = "${workspaceFolder}/node_modules/@impact-analytics/impact-ui-mcp-server/src/index.js";
|
|
133
|
+
}
|
|
86
134
|
|
|
87
135
|
config = {
|
|
88
136
|
"mcp.servers": {
|
|
89
137
|
"impact-ui": {
|
|
90
138
|
"command": "node",
|
|
91
|
-
"args": [
|
|
92
|
-
"cwd":
|
|
139
|
+
"args": [mcpServerPath],
|
|
140
|
+
"cwd": "${workspaceFolder}",
|
|
141
|
+
"env": {
|
|
142
|
+
"IMPACT_UI_NODE_MODULES": impactUiPath
|
|
143
|
+
}
|
|
93
144
|
}
|
|
94
145
|
}
|
|
95
146
|
};
|
|
96
147
|
|
|
97
|
-
console.log("\n
|
|
148
|
+
console.log("\n📦 NPM Package Configuration (with ${workspaceFolder} variables)\n");
|
|
149
|
+
console.log("💡 Detected package structure and using ${workspaceFolder} variables for Cursor.\n");
|
|
98
150
|
}
|
|
99
151
|
|
|
100
152
|
console.log("Add this to your Cursor settings.json:\n");
|
|
@@ -109,5 +161,6 @@ console.log("🔄 Restart Cursor IDE after adding the configuration\n");
|
|
|
109
161
|
|
|
110
162
|
if (useNpm) {
|
|
111
163
|
console.log("📝 Note: Make sure to install the package first:");
|
|
112
|
-
console.log(" npm install
|
|
164
|
+
console.log(" npm install impact-ui-mcp-server\n");
|
|
165
|
+
console.log("💡 The configuration uses ${workspaceFolder} variables which Cursor resolves automatically.\n");
|
|
113
166
|
}
|
|
@@ -56,20 +56,43 @@ if (useNpm) {
|
|
|
56
56
|
process.exit(1);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
+
// For npm packages, detect structure and use appropriate paths
|
|
60
|
+
const cwd = process.cwd();
|
|
61
|
+
let mcpServerPath = "./node_modules/impact-ui-mcp-server/src/index.js";
|
|
62
|
+
let impactUiNodeModules = null;
|
|
63
|
+
|
|
64
|
+
// Check actual structure
|
|
65
|
+
const frontendMcpPath = resolve(cwd, "frontend", "node_modules", "impact-ui-mcp-server", "src", "index.js");
|
|
66
|
+
const rootMcpPath = resolve(cwd, "node_modules", "impact-ui-mcp-server", "src", "index.js");
|
|
67
|
+
|
|
68
|
+
if (existsSync(frontendMcpPath)) {
|
|
69
|
+
mcpServerPath = "./frontend/node_modules/impact-ui-mcp-server/src/index.js";
|
|
70
|
+
impactUiNodeModules = "./frontend/node_modules/impact-ui";
|
|
71
|
+
} else if (existsSync(rootMcpPath)) {
|
|
72
|
+
mcpServerPath = "./node_modules/impact-ui-mcp-server/src/index.js";
|
|
73
|
+
impactUiNodeModules = "./node_modules/impact-ui";
|
|
74
|
+
}
|
|
75
|
+
|
|
59
76
|
config = {
|
|
60
77
|
"mcpServers": {
|
|
61
78
|
"impact-ui": {
|
|
62
79
|
"command": "node",
|
|
63
|
-
"args": [
|
|
64
|
-
|
|
65
|
-
],
|
|
66
|
-
"cwd": "${workspaceFolder}",
|
|
67
|
-
"env": {
|
|
68
|
-
"IMPACT_UI_PATH": impactUiPathToUse
|
|
69
|
-
}
|
|
80
|
+
"args": [mcpServerPath],
|
|
81
|
+
"cwd": "${workspaceFolder}"
|
|
70
82
|
}
|
|
71
83
|
}
|
|
72
84
|
};
|
|
85
|
+
|
|
86
|
+
// Add environment variable if impact-ui is in node_modules
|
|
87
|
+
if (impactUiNodeModules) {
|
|
88
|
+
config.mcpServers["impact-ui"].env = {
|
|
89
|
+
"IMPACT_UI_NODE_MODULES": impactUiNodeModules
|
|
90
|
+
};
|
|
91
|
+
} else if (impactUiPathToUse) {
|
|
92
|
+
config.mcpServers["impact-ui"].env = {
|
|
93
|
+
"IMPACT_UI_PATH": impactUiPathToUse
|
|
94
|
+
};
|
|
95
|
+
}
|
|
73
96
|
|
|
74
97
|
console.log("\n📦 NPM Package Configuration\n");
|
|
75
98
|
} else {
|
package/package.json
CHANGED