@with-thesis/mcp 0.1.4 → 0.1.5
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/index.js +6 -2
- package/dist/stdio.js +24 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -15348,12 +15348,16 @@ function setHeaders(ctx, headersToSet) {
|
|
|
15348
15348
|
}
|
|
15349
15349
|
|
|
15350
15350
|
// src/lib/config.ts
|
|
15351
|
-
var MCP_VERSION = "0.1.
|
|
15351
|
+
var MCP_VERSION = "0.1.5";
|
|
15352
15352
|
var DEFAULT_API_URL = "https://api.withthesis.dev";
|
|
15353
15353
|
var DEFAULT_MCP_PORT = 4100;
|
|
15354
15354
|
var DEFAULT_MCP_RATE_LIMIT_REQUESTS_PER_MIN = 300;
|
|
15355
|
+
function trimEnv(value) {
|
|
15356
|
+
const trimmed = value?.trim();
|
|
15357
|
+
return trimmed ? trimmed : null;
|
|
15358
|
+
}
|
|
15355
15359
|
function resolveApiBaseUrl() {
|
|
15356
|
-
return process.env.THESIS_API_URL
|
|
15360
|
+
return trimEnv(process.env.THESIS_API_URL) || DEFAULT_API_URL;
|
|
15357
15361
|
}
|
|
15358
15362
|
function resolveHttpPort() {
|
|
15359
15363
|
return Number(process.env.PORT) || Number(process.env.MCP_PORT) || DEFAULT_MCP_PORT;
|
package/dist/stdio.js
CHANGED
|
@@ -12459,10 +12459,30 @@ function requireStdioApiKey() {
|
|
|
12459
12459
|
}
|
|
12460
12460
|
|
|
12461
12461
|
// src/lib/config.ts
|
|
12462
|
-
var MCP_VERSION = "0.1.
|
|
12462
|
+
var MCP_VERSION = "0.1.5";
|
|
12463
12463
|
var DEFAULT_API_URL = "https://api.withthesis.dev";
|
|
12464
|
-
function
|
|
12465
|
-
|
|
12464
|
+
function trimEnv(value) {
|
|
12465
|
+
const trimmed = value?.trim();
|
|
12466
|
+
return trimmed ? trimmed : null;
|
|
12467
|
+
}
|
|
12468
|
+
function isLocalhostUrl(value) {
|
|
12469
|
+
try {
|
|
12470
|
+
const url = new URL(value);
|
|
12471
|
+
return url.hostname === "localhost" || url.hostname === "127.0.0.1" || url.hostname === "::1";
|
|
12472
|
+
} catch {
|
|
12473
|
+
return false;
|
|
12474
|
+
}
|
|
12475
|
+
}
|
|
12476
|
+
function resolveStdioApiBaseUrl() {
|
|
12477
|
+
const explicitMcpUrl = trimEnv(process.env.THESIS_MCP_API_URL);
|
|
12478
|
+
if (explicitMcpUrl) {
|
|
12479
|
+
return explicitMcpUrl;
|
|
12480
|
+
}
|
|
12481
|
+
const inheritedApiUrl = trimEnv(process.env.THESIS_API_URL);
|
|
12482
|
+
if (inheritedApiUrl && isLocalhostUrl(inheritedApiUrl)) {
|
|
12483
|
+
return inheritedApiUrl;
|
|
12484
|
+
}
|
|
12485
|
+
return DEFAULT_API_URL;
|
|
12466
12486
|
}
|
|
12467
12487
|
|
|
12468
12488
|
// ../../node_modules/.bun/zod@4.3.6/node_modules/zod/v3/helpers/util.js
|
|
@@ -20240,7 +20260,7 @@ function createThesisMcpServer(options) {
|
|
|
20240
20260
|
async function startStdioServer() {
|
|
20241
20261
|
const apiKey = requireStdioApiKey();
|
|
20242
20262
|
const server = createThesisMcpServer({
|
|
20243
|
-
apiBaseUrl:
|
|
20263
|
+
apiBaseUrl: resolveStdioApiBaseUrl(),
|
|
20244
20264
|
apiKey,
|
|
20245
20265
|
clientName: "local-stdio"
|
|
20246
20266
|
});
|