@linkegringo/mcp 1.0.1 → 1.0.2

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.
Files changed (2) hide show
  1. package/dist/index.js +13 -1
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -1272,6 +1272,8 @@ function runInstaller() {
1272
1272
  }
1273
1273
 
1274
1274
  // src/index.ts
1275
+ import fs2 from "fs";
1276
+ import { fileURLToPath } from "url";
1275
1277
  async function main() {
1276
1278
  if (process.argv.includes("install") || process.argv.includes("setup") || process.argv.includes("--install")) {
1277
1279
  runInstaller();
@@ -1282,7 +1284,17 @@ async function main() {
1282
1284
  await server.connect(transport);
1283
1285
  console.error("[LinkeGringo MCP] Servidor iniciado com sucesso via stdio.");
1284
1286
  }
1285
- if (import.meta.url === `file://${process.argv[1]}`) {
1287
+ function isDirectExecution() {
1288
+ if (!process.argv[1]) return false;
1289
+ try {
1290
+ const currentFilePath = fileURLToPath(import.meta.url);
1291
+ const scriptPath = fs2.existsSync(process.argv[1]) ? fs2.realpathSync(process.argv[1]) : process.argv[1];
1292
+ return currentFilePath === scriptPath || process.argv[1].endsWith("index.js") || process.argv[1].endsWith("linkegringo-mcp") || process.argv[1].endsWith("mcp") || process.argv[1].endsWith("linkegringo");
1293
+ } catch {
1294
+ return true;
1295
+ }
1296
+ }
1297
+ if (isDirectExecution()) {
1286
1298
  main().catch((err) => {
1287
1299
  console.error("[LinkeGringo MCP] Erro fatal na inicializa\xE7\xE3o:", err);
1288
1300
  process.exit(1);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@linkegringo/mcp",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Servidor MCP oficial do LinkeGringo para auditoria e otimização de perfis para o mercado internacional",
5
5
  "type": "module",
6
6
  "bin": {