@vespermcp/mcp-server 1.3.1 → 1.4.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.
@@ -9,9 +9,8 @@
9
9
  "vespermcp"
10
10
  ],
11
11
  "env": {
12
- "KAGGLE_USERNAME": "your-kaggle-username",
13
- "KAGGLE_KEY": "your-kaggle-api-key",
14
- "HF_TOKEN": "your-huggingface-token"
12
+ "VESPER_API_KEY": "your-key-from-getvesper.dev",
13
+ "VESPER_API_URL": "https://getvesper.dev"
15
14
  }
16
15
  }
17
16
  }
package/package.json CHANGED
@@ -1,12 +1,11 @@
1
1
  {
2
2
  "name": "@vespermcp/mcp-server",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
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",
7
7
  "bin": {
8
- "vespermcp": "build/index.js",
9
- "vesper-wizard": "wizard.cjs"
8
+ "vespermcp": "build/index.js"
10
9
  },
11
10
  "files": [
12
11
  "build/**/*",
@@ -135,6 +135,37 @@ function getClaudeConfigPath() {
135
135
 
136
136
  const configPath = getClaudeConfigPath();
137
137
 
138
+ function readVesperConfigToml() {
139
+ const p = path.join(vesperDataDir, 'config.toml');
140
+ if (!fs.existsSync(p)) return {};
141
+ const content = fs.readFileSync(p, 'utf8');
142
+ const obj = {};
143
+ for (const line of content.split('\n')) {
144
+ const m = line.match(/^\s*(\w+)\s*=\s*"(.*)"\s*$/);
145
+ if (m) obj[m[1]] = m[2];
146
+ }
147
+ return obj;
148
+ }
149
+
150
+ function getMcpVesperApiUrl() {
151
+ const raw = (process.env.VESPER_API_URL || '').trim();
152
+ return raw.replace(/\/$/, '') || 'https://getvesper.dev';
153
+ }
154
+
155
+ function buildClaudeMcpVesperEntry() {
156
+ const vesperToml = readVesperConfigToml();
157
+ const apiKey = String(vesperToml.api_key || '').trim();
158
+ const npxCmd = process.platform === 'win32' ? 'npx.cmd' : 'npx';
159
+ return {
160
+ command: npxCmd,
161
+ args: ['-y', '-p', '@vespermcp/mcp-server@latest', 'vespermcp'],
162
+ env: {
163
+ VESPER_API_KEY: apiKey || 'your-key-from-getvesper.dev',
164
+ VESPER_API_URL: getMcpVesperApiUrl(),
165
+ },
166
+ };
167
+ }
168
+
138
169
  if (configPath && fs.existsSync(configPath)) {
139
170
  try {
140
171
  const configContent = fs.readFileSync(configPath, 'utf8');
@@ -142,17 +173,22 @@ if (configPath && fs.existsSync(configPath)) {
142
173
 
143
174
  if (!config.mcpServers) config.mcpServers = {};
144
175
 
145
- if (!config.mcpServers.vesper) {
146
- config.mcpServers.vesper = {
147
- command: "vesper",
148
- args: [],
149
- env: {
150
- "HF_TOKEN": ""
151
- }
152
- };
176
+ const entry = buildClaudeMcpVesperEntry();
177
+ const existing = config.mcpServers.vesper;
178
+ const isLegacy =
179
+ existing &&
180
+ existing.command === 'vesper' &&
181
+ existing.env &&
182
+ Object.prototype.hasOwnProperty.call(existing.env, 'HF_TOKEN');
153
183
 
184
+ if (!existing) {
185
+ config.mcpServers.vesper = entry;
186
+ fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
187
+ console.log(`✅ Automatically added 'vesper' (npx + VESPER_* env) to ${configPath}`);
188
+ } else if (isLegacy) {
189
+ config.mcpServers.vesper = entry;
154
190
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
155
- console.log(`✅ Automatically added 'vesper' to ${configPath}`);
191
+ console.log(`✅ Updated legacy Vesper MCP entry to npx + VESPER_* env in ${configPath}`);
156
192
  } else {
157
193
  console.log(`ℹ️ 'vesper' is already configured in ${configPath}`);
158
194
  }
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // ─────────────────────────────────────────────────────────────
4
- // vesper-wizard — Zero-friction local setup for Vesper MCP
5
- // Run: npx vesper-wizard@latest
4
+ // @vespermcp/setup — Zero-friction local setup for Vesper MCP
5
+ // Run: npx @vespermcp/setup@latest
6
6
  // ─────────────────────────────────────────────────────────────
7
7
 
8
8
  const fs = require('fs');
@@ -379,6 +379,46 @@ ${dim('────────────────────────
379
379
  }
380
380
 
381
381
  // ── MCP Auto-Config ──────────────────────────────────────────
382
+ function getMcpVesperApiUrl() {
383
+ const raw = (process.env.VESPER_API_URL || '').trim();
384
+ return raw.replace(/\/$/, '') || 'https://getvesper.dev';
385
+ }
386
+
387
+ function buildMcpServerEntry() {
388
+ const npxCmd = IS_WIN ? 'npx.cmd' : 'npx';
389
+ const state = readToml(CONFIG_TOML);
390
+ const apiKey = String(state.api_key || '').trim();
391
+ return {
392
+ command: npxCmd,
393
+ args: ['-y', '-p', '@vespermcp/mcp-server@latest', 'vespermcp'],
394
+ env: {
395
+ VESPER_API_URL: getMcpVesperApiUrl(),
396
+ VESPER_API_KEY: apiKey || 'your-key-from-getvesper.dev',
397
+ },
398
+ };
399
+ }
400
+
401
+ function escapeTomlDoubleQuoted(value) {
402
+ return String(value).replace(/\\/g, '\\\\').replace(/"/g, '\\"');
403
+ }
404
+
405
+ function upsertTomlMcpVesperBlock(content, serverEntry) {
406
+ const key = escapeTomlDoubleQuoted(serverEntry.env.VESPER_API_KEY);
407
+ const url = escapeTomlDoubleQuoted(serverEntry.env.VESPER_API_URL);
408
+ const block =
409
+ `[mcp_servers.vesper]\n` +
410
+ `command = "${serverEntry.command}"\n` +
411
+ `args = [${serverEntry.args.map((a) => `"${a}"`).join(', ')}]\n\n` +
412
+ `[mcp_servers.vesper.env]\n` +
413
+ `VESPER_API_KEY = "${key}"\n` +
414
+ `VESPER_API_URL = "${url}"\n`;
415
+ const re = /\[mcp_servers\.vesper\][\s\S]*?(?=\n\[|$)/;
416
+ if (re.test(content)) {
417
+ return content.replace(re, block.trim() + '\n');
418
+ }
419
+ return content + (content && !content.endsWith('\n') ? '\n' : '') + block;
420
+ }
421
+
382
422
  function getAllAgentConfigs() {
383
423
  const isMac = process.platform === 'darwin';
384
424
  return [
@@ -424,15 +464,13 @@ function getAllAgentConfigs() {
424
464
  }
425
465
 
426
466
  function installMcpToAgent(agent) {
427
- const npxCmd = IS_WIN ? 'npx.cmd' : 'npx';
428
- const serverEntry = { command: npxCmd, args: ['-y', '-p', '@vespermcp/mcp-server@latest', 'vespermcp'] };
467
+ const serverEntry = buildMcpServerEntry();
429
468
 
430
469
  try {
431
470
  if (agent.format === 'toml') {
432
471
  let content = fs.existsSync(agent.path) ? fs.readFileSync(agent.path, 'utf8') : '';
433
- if (content.includes('[mcp_servers.vesper]')) return true;
434
472
  ensureDir(path.dirname(agent.path));
435
- content += `\n[mcp_servers.vesper]\ncommand = "${serverEntry.command}"\nargs = [${serverEntry.args.map(a => `"${a}"`).join(', ')}]\n`;
473
+ content = upsertTomlMcpVesperBlock(content, serverEntry);
436
474
  fs.writeFileSync(agent.path, content, 'utf8');
437
475
  return true;
438
476
  }
@@ -477,7 +515,7 @@ async function checkServerHealth() {
477
515
  // ── Main Wizard ──────────────────────────────────────────────
478
516
  async function main() {
479
517
  if (!isInteractiveTerminal()) {
480
- console.error(red('vesper-wizard is interactive and cannot run in MCP stdio mode.'));
518
+ console.error(red('@vespermcp/setup is interactive and cannot run in MCP stdio mode.'));
481
519
  console.error(dim('Use this command for MCP server runtime instead:'));
482
520
  console.error(cyan('npx -y -p @vespermcp/mcp-server@latest vespermcp'));
483
521
  process.exit(2);
package/scripts/wizard.js CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  // ─────────────────────────────────────────────────────────────
4
- // vesper-wizard — Zero-friction local setup for Vesper MCP
5
- // Run: npx vesper-wizard@latest
4
+ // @vespermcp/setup — Zero-friction local setup for Vesper MCP
5
+ // Run: npx @vespermcp/setup@latest
6
6
  // ─────────────────────────────────────────────────────────────
7
7
 
8
8
  const fs = require('fs');
package/wizard.cjs CHANGED
File without changes