@nextnext/mcp-server 0.1.0 → 0.1.1
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 +22 -10
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -109081,7 +109081,8 @@ async function main() {
|
|
|
109081
109081
|
}
|
|
109082
109082
|
const port = portArg ? parseInt(portArg, 10) : 8000;
|
|
109083
109083
|
const logLevel = process.env.MCP_LOG_LEVEL || "info";
|
|
109084
|
-
const
|
|
109084
|
+
const useStderrOnly = mode === "stdio";
|
|
109085
|
+
const logger = createLogger(logLevel, useStderrOnly);
|
|
109085
109086
|
const redisEnabled = initRedis();
|
|
109086
109087
|
if (redisEnabled) {
|
|
109087
109088
|
logger.info("Redis session persistence enabled");
|
|
@@ -109126,7 +109127,7 @@ async function main() {
|
|
|
109126
109127
|
logger.info("Loading configuration from environment variables");
|
|
109127
109128
|
config3 = configManager.loadFromEnv();
|
|
109128
109129
|
}
|
|
109129
|
-
const configLogger = createLogger(config3.settings?.logLevel || "info");
|
|
109130
|
+
const configLogger = createLogger(config3.settings?.logLevel || "info", useStderrOnly);
|
|
109130
109131
|
const gateway = new GatewayServer(config3, configLogger);
|
|
109131
109132
|
await gateway.start();
|
|
109132
109133
|
const transport = new StdioServerTransport;
|
|
@@ -109158,9 +109159,10 @@ async function main() {
|
|
|
109158
109159
|
process.exit(1);
|
|
109159
109160
|
}
|
|
109160
109161
|
}
|
|
109161
|
-
function createLogger(logLevel) {
|
|
109162
|
+
function createLogger(logLevel, useStderrOnly = false) {
|
|
109162
109163
|
const levels = ["error", "warn", "info", "debug"];
|
|
109163
109164
|
const levelIndex = levels.indexOf(logLevel.toLowerCase());
|
|
109165
|
+
const output4 = useStderrOnly ? (...args) => console.error(...args) : console.log.bind(console);
|
|
109164
109166
|
return {
|
|
109165
109167
|
error: (...args) => {
|
|
109166
109168
|
if (levelIndex >= 0)
|
|
@@ -109168,23 +109170,33 @@ function createLogger(logLevel) {
|
|
|
109168
109170
|
},
|
|
109169
109171
|
warn: (...args) => {
|
|
109170
109172
|
if (levelIndex >= 1)
|
|
109171
|
-
console.
|
|
109173
|
+
console.error("[WARN]", ...args);
|
|
109172
109174
|
},
|
|
109173
109175
|
info: (...args) => {
|
|
109174
|
-
if (levelIndex >= 2)
|
|
109175
|
-
|
|
109176
|
+
if (levelIndex >= 2) {
|
|
109177
|
+
if (useStderrOnly) {
|
|
109178
|
+
console.error("[INFO]", ...args);
|
|
109179
|
+
} else {
|
|
109180
|
+
console.info("[INFO]", ...args);
|
|
109181
|
+
}
|
|
109182
|
+
}
|
|
109176
109183
|
},
|
|
109177
109184
|
log: (...args) => {
|
|
109178
|
-
if (levelIndex >= 2)
|
|
109179
|
-
|
|
109185
|
+
if (levelIndex >= 2) {
|
|
109186
|
+
if (useStderrOnly) {
|
|
109187
|
+
console.error("[INFO]", ...args);
|
|
109188
|
+
} else {
|
|
109189
|
+
console.log("[INFO]", ...args);
|
|
109190
|
+
}
|
|
109191
|
+
}
|
|
109180
109192
|
},
|
|
109181
109193
|
debug: (...args) => {
|
|
109182
109194
|
if (levelIndex >= 3)
|
|
109183
|
-
console.
|
|
109195
|
+
console.error("[DEBUG]", ...args);
|
|
109184
109196
|
},
|
|
109185
109197
|
trace: (...args) => {
|
|
109186
109198
|
if (levelIndex >= 3)
|
|
109187
|
-
console.
|
|
109199
|
+
console.error("[TRACE]", ...args);
|
|
109188
109200
|
},
|
|
109189
109201
|
assert: console.assert,
|
|
109190
109202
|
clear: console.clear,
|