Skip to content

Commit 0f034f5

Browse files
committed
fix: simplify the error output
1 parent 4933267 commit 0f034f5

File tree

4 files changed

+20
-5
lines changed

4 files changed

+20
-5
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
"@modelcontextprotocol/sdk": "^1.6.0",
2626
"eventsource": "^3.0.5",
2727
"fastmcp": "^1.18.0",
28+
"multiline-ts": "^4.0.1",
2829
"yargs": "^17.7.2"
2930
},
3031
"repository": {

pnpm-lock.yaml

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bin/mcp-proxy.ts

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { Server } from "@modelcontextprotocol/sdk/server/index.js";
88
import { proxyServer, startSSEServer } from "../MCPProxy.js";
99
import { EventSource } from "eventsource";
1010
import { setTimeout } from "node:timers/promises";
11-
import { prefixLines } from "../utilities/prefixLines.js";
11+
import multiline from 'multiline-ts';
1212

1313
if (!("EventSource" in global)) {
1414
// @ts-expect-error - figure out how to use --experimental-eventsource with vitest
@@ -81,7 +81,15 @@ try {
8181

8282
console.info('connected to the MCP server');
8383
} catch (error) {
84-
console.error('could not connect to the MCP server', error, prefixLines(stderrOutput, '> '));
84+
console.error(multiline`
85+
could not connect to the MCP server
86+
87+
--- error ---
88+
${String(error)}
89+
90+
--- stderr output ---
91+
${stderrOutput}
92+
`);
8593

8694
await setTimeout(1000);
8795

src/utilities/prefixLines.ts

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)