accoding-mcp-server-test-new 0.1.1 → 0.1.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.
package/build/utils/logger.d.ts
CHANGED
package/build/utils/logger.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { pino } from "pino";
|
|
2
|
+
/**
|
|
3
|
+
* 创建 logger 实例
|
|
4
|
+
* 在 stdio 模式下,MCP 使用 stdout 进行 JSONRPC 通信
|
|
5
|
+
* 因此日志必须输出到 stderr,避免干扰 JSONRPC 消息
|
|
6
|
+
*/
|
|
2
7
|
const logger = pino({
|
|
3
8
|
level: "info",
|
|
4
9
|
formatters: {
|
|
@@ -7,6 +12,8 @@ const logger = pino({
|
|
|
7
12
|
timestamp: () => `,"timestamp":"${new Date().toISOString()}"`,
|
|
8
13
|
messageKey: "message",
|
|
9
14
|
nestedKey: "payload"
|
|
10
|
-
}
|
|
15
|
+
},
|
|
16
|
+
// 输出到 stderr,避免干扰 MCP 的 JSONRPC 通信(使用 stdout)
|
|
17
|
+
process.stderr);
|
|
11
18
|
export default logger;
|
|
12
19
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B,MAAM,MAAM,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAE5B;;;;GAIG;AACH,MAAM,MAAM,GAAG,IAAI,CACf;IACI,KAAK,EAAE,MAAM;IACb,UAAU,EAAE;QACR,KAAK,EAAE,CAAC,KAAa,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK,EAAE,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;KAC7D;IACD,SAAS,EAAE,GAAG,EAAE,CAAC,iBAAiB,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE,GAAG;IAC7D,UAAU,EAAE,SAAS;IACrB,SAAS,EAAE,SAAS;CACvB;AACD,8CAA8C;AAC9C,OAAO,CAAC,MAAM,CACjB,CAAC;AAEF,eAAe,MAAM,CAAC"}
|