@mcpjam/inspector 0.9.46 → 0.9.47
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/server/index.js +18 -5
- package/dist/server/index.js.map +1 -1
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -6,8 +6,9 @@ import { Hono as Hono13 } from "hono";
|
|
|
6
6
|
import { cors } from "hono/cors";
|
|
7
7
|
import { logger } from "hono/logger";
|
|
8
8
|
import { serveStatic } from "@hono/node-server/serve-static";
|
|
9
|
-
import { readFileSync } from "fs";
|
|
10
|
-
import { join } from "path";
|
|
9
|
+
import { existsSync, readFileSync } from "fs";
|
|
10
|
+
import { dirname, join } from "path";
|
|
11
|
+
import { fileURLToPath } from "url";
|
|
11
12
|
|
|
12
13
|
// routes/mcp/index.ts
|
|
13
14
|
import { Hono as Hono12 } from "hono";
|
|
@@ -3567,6 +3568,8 @@ function logBox(content, title) {
|
|
|
3567
3568
|
});
|
|
3568
3569
|
console.log("\u2514" + "\u2500".repeat(width) + "\u2518");
|
|
3569
3570
|
}
|
|
3571
|
+
var __dirname = dirname(fileURLToPath(import.meta.url));
|
|
3572
|
+
var projectRoot = join(__dirname, "..", "..");
|
|
3570
3573
|
function getMCPConfigFromEnv() {
|
|
3571
3574
|
const configData = process.env.MCP_CONFIG_DATA;
|
|
3572
3575
|
if (configData) {
|
|
@@ -3625,10 +3628,20 @@ try {
|
|
|
3625
3628
|
}
|
|
3626
3629
|
var app = new Hono13();
|
|
3627
3630
|
try {
|
|
3628
|
-
const
|
|
3629
|
-
|
|
3631
|
+
const envFileName = process.env.NODE_ENV === "production" ? ".env.production" : ".env.development";
|
|
3632
|
+
const envFilePath = join(projectRoot, envFileName);
|
|
3633
|
+
if (existsSync(envFilePath)) {
|
|
3634
|
+
dotenv.config({ path: envFilePath });
|
|
3635
|
+
} else {
|
|
3636
|
+
dotenv.config({ path: envFileName });
|
|
3637
|
+
}
|
|
3630
3638
|
if (!process.env.CONVEX_HTTP_URL) {
|
|
3631
|
-
|
|
3639
|
+
const fallbackEnv = join(projectRoot, ".env");
|
|
3640
|
+
if (existsSync(fallbackEnv)) {
|
|
3641
|
+
dotenv.config({ path: fallbackEnv });
|
|
3642
|
+
} else {
|
|
3643
|
+
dotenv.config();
|
|
3644
|
+
}
|
|
3632
3645
|
}
|
|
3633
3646
|
} catch (error) {
|
|
3634
3647
|
console.warn("[startup] Failed loading env files", error);
|