viewgate-wrapper 1.10.27 → 1.10.29

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/dist/cli.js CHANGED
@@ -14,31 +14,10 @@ async function setup() {
14
14
  console.error(`❌ Could not find mcp_config.json at ${configPath}`);
15
15
  process.exit(1);
16
16
  }
17
- // 2. Determine the path to the MCP server
18
- // In production (node_modules), we'll be in dist/cli.js, so mcp-server is at ../mcp-server
19
- // During local dev, it might be different.
20
- let mcpServerPath = '';
21
- // Check if we are running from node_modules or local dev
22
- const isLocalDev = __dirname.includes('view-gate-wrapper' + path.sep + 'src') || __dirname.includes('view-gate-wrapper' + path.sep + 'dist');
23
- if (isLocalDev) {
24
- // Find the root of the project
25
- let root = __dirname;
26
- while (root !== path.parse(root).root && !fs.existsSync(path.join(root, 'package.json'))) {
27
- root = path.dirname(root);
28
- }
29
- mcpServerPath = path.join(root, 'mcp-server', 'dist', 'index.js');
30
- }
31
- else {
32
- // In node_modules, we expect to be in something like node_modules/viewgate-wrapper/dist
33
- mcpServerPath = path.join(__dirname, '..', 'mcp-server', 'dist', 'index.js');
34
- }
35
- // Normalize to forward slashes for the JSON config (cleaner on Windows)
36
- const normalizedMcpPath = mcpServerPath.replace(/\\/g, '/');
37
- if (!fs.existsSync(mcpServerPath)) {
38
- console.error(`❌ MCP Server not found at: ${mcpServerPath}`);
39
- console.log('Please ensure you have built the project: npm run build');
40
- process.exit(1);
41
- }
17
+ // 2. Determine the path or URL
18
+ // Since we now have a standalone server, we can point to its URL or local path.
19
+ // The user wants it to be scalable, so we'll prioritize a server URL.
20
+ const mcpServerUrl = process.env.MCP_SERVER_URL || 'https://view-gate.vercel.app/sse';
42
21
  // 3. Read and update mcp_config.json
43
22
  try {
44
23
  const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
@@ -48,22 +27,24 @@ async function setup() {
48
27
  const currentServer = config.mcpServers.viewgate || {};
49
28
  const env = currentServer.env || {};
50
29
  // Default values if not present
51
- const backendUrl = env.BACKEND_URL || 'https://view-gate.vercel.app';
52
- const apiKey = env.API_KEY || 'YOUR_API_KEY_HERE';
30
+ const backendUrl = env.BACKEND_URL || 'http://localhost:5000';
31
+ const apiKey = env.API_KEY || '';
53
32
  config.mcpServers.viewgate = {
54
- command: 'node',
55
- args: [normalizedMcpPath],
56
- env: {
57
- BACKEND_URL: backendUrl,
58
- API_KEY: apiKey
59
- }
33
+ command: "npx",
34
+ args: [
35
+ "-y",
36
+ "mcp-remote",
37
+ `${mcpServerUrl}${mcpServerUrl.includes('?') ? '&' : '?'}apiKey=${apiKey}`
38
+ ],
39
+ env: {}
60
40
  };
61
41
  fs.writeFileSync(configPath, JSON.stringify(config, null, 2));
62
42
  console.log(`✅ Updated mcp_config.json successfully!`);
63
- console.log(`📍 MCP Path: ${normalizedMcpPath}`);
64
- if (apiKey === 'YOUR_API_KEY_HERE') {
65
- console.log('\n⚠️ Remember to set your API_KEY in:');
43
+ console.log(`📍 MCP Server URL: ${mcpServerUrl}`);
44
+ if (!apiKey) {
45
+ console.log('\n⚠️ Recuerda configurar tu API_KEY en:');
66
46
  console.log(` ${configPath}`);
47
+ console.log(' Puedes encontrar tu API_KEY en el Dashboard de ViewGate.');
67
48
  }
68
49
  }
69
50
  catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAwBnF,OAAO,wBAAwB,CAAC;AAkyBhC,eAAO,MAAM,eAAe,EAAE,EAg2D7B,CAAC"}
1
+ {"version":3,"file":"ViewGateOverlay.d.ts","sourceRoot":"","sources":["../../src/components/ViewGateOverlay.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAqD,KAAK,EAAE,EAAE,MAAM,OAAO,CAAC;AAwBnF,OAAO,wBAAwB,CAAC;AAkyBhC,eAAO,MAAM,eAAe,EAAE,EAg5D7B,CAAC"}