@leanmcp/core 0.3.2 → 0.3.3
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 +14 -8
- package/dist/index.mjs +14 -8
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -473,12 +473,18 @@ async function createHTTPServer(serverInput, options) {
|
|
|
473
473
|
prefix: "HTTP"
|
|
474
474
|
});
|
|
475
475
|
const logPrimary = /* @__PURE__ */ __name((message) => {
|
|
476
|
-
|
|
477
|
-
|
|
476
|
+
if (httpOptions.logging) {
|
|
477
|
+
logger.info?.(message);
|
|
478
|
+
} else {
|
|
479
|
+
console.log(message);
|
|
480
|
+
}
|
|
478
481
|
}, "logPrimary");
|
|
479
482
|
const warnPrimary = /* @__PURE__ */ __name((message) => {
|
|
480
|
-
|
|
481
|
-
|
|
483
|
+
if (httpOptions.logging) {
|
|
484
|
+
logger.warn?.(message);
|
|
485
|
+
} else {
|
|
486
|
+
console.warn(message);
|
|
487
|
+
}
|
|
482
488
|
}, "warnPrimary");
|
|
483
489
|
const startServerWithPortRetry = /* @__PURE__ */ __name(async () => {
|
|
484
490
|
const maxAttempts = 20;
|
|
@@ -539,7 +545,7 @@ async function createHTTPServer(serverInput, options) {
|
|
|
539
545
|
}
|
|
540
546
|
}
|
|
541
547
|
app.use(express.json());
|
|
542
|
-
|
|
548
|
+
console.log("Starting LeanMCP HTTP Server...");
|
|
543
549
|
app.get("/health", (req, res) => {
|
|
544
550
|
res.json({
|
|
545
551
|
status: "ok",
|
|
@@ -624,9 +630,9 @@ async function createHTTPServer(serverInput, options) {
|
|
|
624
630
|
activeListener = listener;
|
|
625
631
|
process.env.PORT = String(port);
|
|
626
632
|
listener.port = port;
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
633
|
+
console.log(`Server running on http://localhost:${port}`);
|
|
634
|
+
console.log(`MCP endpoint: http://localhost:${port}/mcp`);
|
|
635
|
+
console.log(`Health check: http://localhost:${port}/health`);
|
|
630
636
|
resolve({
|
|
631
637
|
listener,
|
|
632
638
|
port
|
package/dist/index.mjs
CHANGED
|
@@ -434,12 +434,18 @@ async function createHTTPServer(serverInput, options) {
|
|
|
434
434
|
prefix: "HTTP"
|
|
435
435
|
});
|
|
436
436
|
const logPrimary = /* @__PURE__ */ __name((message) => {
|
|
437
|
-
|
|
438
|
-
|
|
437
|
+
if (httpOptions.logging) {
|
|
438
|
+
logger.info?.(message);
|
|
439
|
+
} else {
|
|
440
|
+
console.log(message);
|
|
441
|
+
}
|
|
439
442
|
}, "logPrimary");
|
|
440
443
|
const warnPrimary = /* @__PURE__ */ __name((message) => {
|
|
441
|
-
|
|
442
|
-
|
|
444
|
+
if (httpOptions.logging) {
|
|
445
|
+
logger.warn?.(message);
|
|
446
|
+
} else {
|
|
447
|
+
console.warn(message);
|
|
448
|
+
}
|
|
443
449
|
}, "warnPrimary");
|
|
444
450
|
const startServerWithPortRetry = /* @__PURE__ */ __name(async () => {
|
|
445
451
|
const maxAttempts = 20;
|
|
@@ -500,7 +506,7 @@ async function createHTTPServer(serverInput, options) {
|
|
|
500
506
|
}
|
|
501
507
|
}
|
|
502
508
|
app.use(express.json());
|
|
503
|
-
|
|
509
|
+
console.log("Starting LeanMCP HTTP Server...");
|
|
504
510
|
app.get("/health", (req, res) => {
|
|
505
511
|
res.json({
|
|
506
512
|
status: "ok",
|
|
@@ -585,9 +591,9 @@ async function createHTTPServer(serverInput, options) {
|
|
|
585
591
|
activeListener = listener;
|
|
586
592
|
process.env.PORT = String(port);
|
|
587
593
|
listener.port = port;
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
594
|
+
console.log(`Server running on http://localhost:${port}`);
|
|
595
|
+
console.log(`MCP endpoint: http://localhost:${port}/mcp`);
|
|
596
|
+
console.log(`Health check: http://localhost:${port}/health`);
|
|
591
597
|
resolve({
|
|
592
598
|
listener,
|
|
593
599
|
port
|