@vespermcp/mcp-server 1.0.6 → 1.0.8
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/build/config/config-manager.js +38 -22
- package/build/index.js +6 -2
- package/package.json +1 -1
|
@@ -95,22 +95,14 @@ export class ConfigManager {
|
|
|
95
95
|
const isStandard = key === "vscode-global";
|
|
96
96
|
const isSettings = key === "vscode-settings";
|
|
97
97
|
const isRoot = key === "vscode-root";
|
|
98
|
-
const hasClaudeFolder = fs.existsSync(path.join(appData, "Claude"));
|
|
99
|
-
const hasCursorFolder = fs.existsSync(path.join(appData, "Cursor")) || fs.existsSync(path.join(home, ".cursor"));
|
|
100
|
-
const hasCodeFolder = fs.existsSync(path.join(appData, "Code")) || fs.existsSync(path.join(home, ".vscode"));
|
|
98
|
+
const hasClaudeFolder = fs.existsSync(path.join(appData, "Claude")) || (process.platform === "darwin" && fs.existsSync(path.join(home, "Library", "Application Support", "Claude")));
|
|
99
|
+
const hasCursorFolder = fs.existsSync(path.join(appData, "Cursor")) || fs.existsSync(path.join(home, ".cursor")) || (process.platform === "darwin" && fs.existsSync(path.join(home, "Library", "Application Support", "Cursor")));
|
|
100
|
+
const hasCodeFolder = fs.existsSync(path.join(appData, "Code")) || fs.existsSync(path.join(home, ".vscode")) || (process.platform === "darwin" && fs.existsSync(path.join(home, "Library", "Application Support", "Code")));
|
|
101
101
|
const hasInsidersFolder = fs.existsSync(path.join(appData, "Code - Insiders"));
|
|
102
102
|
const hasCopilotFolder = fs.existsSync(path.join(home, ".copilot"));
|
|
103
103
|
if (process.env.VESPER_DEBUG) {
|
|
104
104
|
console.log(`[Debug] Checking ${key}:`);
|
|
105
105
|
console.log(` - Config Path: ${cp.path} (${fs.existsSync(cp.path) ? "EXISTS" : "MISSING"})`);
|
|
106
|
-
if (isClaude)
|
|
107
|
-
console.log(` - Claude Folder: ${path.join(appData, "Claude")} (${hasClaudeFolder ? "EXISTS" : "MISSING"})`);
|
|
108
|
-
if (isCursor)
|
|
109
|
-
console.log(` - Cursor Folder: ${path.join(appData, "Cursor")} (${hasCursorFolder ? "EXISTS" : "MISSING"})`);
|
|
110
|
-
if (isVSCode)
|
|
111
|
-
console.log(` - Code Folder: ${path.join(appData, "Code")} (${hasCodeFolder ? "EXISTS" : "MISSING"})`);
|
|
112
|
-
if (isCopilot)
|
|
113
|
-
console.log(` - Copilot Folder: ${path.join(this.getHomeDir(), ".copilot")} (${hasCopilotFolder ? "EXISTS" : "MISSING"})`);
|
|
114
106
|
}
|
|
115
107
|
const isCurrentIDE = (isCursor && (termProgram.includes("cursor") || (termProgram === "vscode" && hasCursorFolder))) ||
|
|
116
108
|
(isClaude && termProgram.includes("claude")) ||
|
|
@@ -121,12 +113,9 @@ export class ConfigManager {
|
|
|
121
113
|
// Also check if the config file actually exists OR the root folder exists
|
|
122
114
|
const shouldDetectByFolder = (isClaude && hasClaudeFolder) ||
|
|
123
115
|
(isCursor && hasCursorFolder) ||
|
|
124
|
-
(isVSCode && hasCodeFolder) ||
|
|
125
|
-
(key === "vscode-insiders" && hasInsidersFolder) ||
|
|
116
|
+
(isVSCode && (hasCodeFolder || hasInsidersFolder)) ||
|
|
126
117
|
(isCopilot && hasCopilotFolder) ||
|
|
127
|
-
(
|
|
128
|
-
(isSettings && hasCodeFolder) ||
|
|
129
|
-
(isRoot && fs.existsSync(process.cwd()));
|
|
118
|
+
(isSettings && hasCodeFolder);
|
|
130
119
|
if (shouldDetectByFolder || fs.existsSync(cp.path) || isCurrentIDE || key === "cursor-project" || key === "vscode-project" || key === "vscode-root") {
|
|
131
120
|
let displayName = cp.name;
|
|
132
121
|
if (isCurrentIDE) {
|
|
@@ -137,6 +126,29 @@ export class ConfigManager {
|
|
|
137
126
|
}
|
|
138
127
|
return detected.filter((v, i, a) => a.findIndex(t => t.path === v.path) === i);
|
|
139
128
|
}
|
|
129
|
+
getVesperExecutableConfig() {
|
|
130
|
+
const isWin = process.platform === "win32";
|
|
131
|
+
// Try to find absolute paths for maximum reliability in VS Code/Copilot
|
|
132
|
+
try {
|
|
133
|
+
const nodeExe = process.execPath;
|
|
134
|
+
// ConfigManager is in build/config/config-manager.js
|
|
135
|
+
// index.js is in build/index.js
|
|
136
|
+
const vesperScript = path.resolve(__dirname, "../../index.js");
|
|
137
|
+
if (fs.existsSync(vesperScript)) {
|
|
138
|
+
return {
|
|
139
|
+
command: nodeExe,
|
|
140
|
+
args: [vesperScript]
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
catch (e) {
|
|
145
|
+
// Fallback to npx
|
|
146
|
+
}
|
|
147
|
+
return {
|
|
148
|
+
command: isWin ? "npx.cmd" : "npx",
|
|
149
|
+
args: ["-y", "@vespermcp/mcp-server@latest"]
|
|
150
|
+
};
|
|
151
|
+
}
|
|
140
152
|
async installTo(configPath) {
|
|
141
153
|
try {
|
|
142
154
|
console.log(`[Vesper Setup] Installing to ${configPath.name} at ${configPath.path}...`);
|
|
@@ -165,21 +177,25 @@ export class ConfigManager {
|
|
|
165
177
|
}
|
|
166
178
|
const lastKey = keys[keys.length - 1];
|
|
167
179
|
const mcpServers = current[lastKey] || {};
|
|
168
|
-
// Use the
|
|
169
|
-
|
|
170
|
-
const isWin = process.platform === "win32";
|
|
180
|
+
// Use the most robust command format available (absolute paths if running from npx/installed)
|
|
181
|
+
const vesperExec = this.getVesperExecutableConfig();
|
|
171
182
|
const serverConfig = {
|
|
172
|
-
command:
|
|
173
|
-
args:
|
|
183
|
+
command: vesperExec.command,
|
|
184
|
+
args: vesperExec.args,
|
|
174
185
|
env: {
|
|
175
186
|
"HF_TOKEN": "YOUR_HUGGINGFACE_TOKEN_HERE",
|
|
176
|
-
// Empty by default to avoid clutter, user can add if needed
|
|
177
187
|
}
|
|
178
188
|
};
|
|
179
189
|
mcpServers["vesper"] = serverConfig;
|
|
180
190
|
// Also add alias for easy upgrading
|
|
181
191
|
mcpServers["@vespermcp/mcp-server"] = serverConfig;
|
|
182
192
|
current[lastKey] = mcpServers;
|
|
193
|
+
// If we are writing to settings.json, also add "mcp.servers" for native VS Code MCP view
|
|
194
|
+
if (configPath.key.includes("copilot")) {
|
|
195
|
+
if (!config["mcp.servers"])
|
|
196
|
+
config["mcp.servers"] = {};
|
|
197
|
+
config["mcp.servers"]["vesper"] = serverConfig;
|
|
198
|
+
}
|
|
183
199
|
const content = JSON.stringify(config, null, 2);
|
|
184
200
|
if (process.env.VESPER_DEBUG) {
|
|
185
201
|
console.log(`[Vesper Setup] Writing to ${configPath.path}:`);
|
package/build/index.js
CHANGED
|
@@ -25,13 +25,15 @@ import { MediaAnalyzer } from "./quality/media-analyzer.js";
|
|
|
25
25
|
import { QualityOrchestrator } from "./quality/quality-orchestrator.js";
|
|
26
26
|
import { ConfigManager } from "./config/config-manager.js";
|
|
27
27
|
import { Selector } from "./utils/selector.js";
|
|
28
|
+
import os from "os";
|
|
28
29
|
// Determine absolute paths relative to the compiled script
|
|
29
30
|
const __filename = fileURLToPath(import.meta.url);
|
|
30
31
|
const __dirname = path.dirname(__filename);
|
|
31
32
|
// appRoot: Where the source code/scripts are (inside node_modules or source)
|
|
32
33
|
const appRoot = path.join(__dirname, "..");
|
|
33
|
-
// dataRoot: Where database and user data live (in user home)
|
|
34
|
-
|
|
34
|
+
// dataRoot: Where database and user data live (in user home)
|
|
35
|
+
// Use os.homedir() as it's more reliable than env vars
|
|
36
|
+
const homeDir = os.homedir() || process.env.HOME || process.env.USERPROFILE || appRoot;
|
|
35
37
|
const dataRoot = path.join(homeDir, ".vesper");
|
|
36
38
|
// Ensure data directory exists
|
|
37
39
|
if (!fs.existsSync(dataRoot))
|
|
@@ -39,6 +41,8 @@ if (!fs.existsSync(dataRoot))
|
|
|
39
41
|
const dbPath = path.join(dataRoot, "data", "metadata.db");
|
|
40
42
|
const vectorPath = path.join(dataRoot, "data", "vectors.json");
|
|
41
43
|
const errorLogPath = path.join(dataRoot, "vesper_errors.log");
|
|
44
|
+
console.error(`[Vesper] Data directory: ${dataRoot}`);
|
|
45
|
+
console.error(`[Vesper] Database path: ${dbPath}`);
|
|
42
46
|
function logError(err, context) {
|
|
43
47
|
const timestamp = new Date().toISOString();
|
|
44
48
|
const stack = err.stack || String(err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vespermcp/mcp-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.8",
|
|
4
4
|
"description": "AI-powered dataset discovery, quality analysis, and preparation MCP server with multimodal support (text, image, audio, video)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "build/index.js",
|