tg2ai-mcp 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/package.json +1 -1
- package/src/index.js +12 -2
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -117,8 +117,18 @@ rl.on("line", (line) => {
|
|
|
117
117
|
"Content-Length": Buffer.byteLength(line)
|
|
118
118
|
}
|
|
119
119
|
}, (res) => {
|
|
120
|
-
//
|
|
121
|
-
|
|
120
|
+
// Buffer and process response body to handle synchronous tool listings and direct results
|
|
121
|
+
let body = "";
|
|
122
|
+
res.setEncoding("utf-8");
|
|
123
|
+
res.on("data", (chunk) => {
|
|
124
|
+
body += chunk;
|
|
125
|
+
});
|
|
126
|
+
res.on("end", () => {
|
|
127
|
+
const trimmed = body.trim();
|
|
128
|
+
if (trimmed && trimmed.includes("jsonrpc")) {
|
|
129
|
+
process.stdout.write(trimmed + "\n");
|
|
130
|
+
}
|
|
131
|
+
});
|
|
122
132
|
});
|
|
123
133
|
|
|
124
134
|
postReq.on("error", (err) => {
|