Skip to content

Commit f2cae3d

Browse files
authored
Merge pull request #554 from nabuskey/con-refused
fix connection refused error message
2 parents 13014a0 + f3f06ef commit f2cae3d

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

server/src/mcpProxy.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,10 @@ function onClientError(error: Error) {
66
}
77

88
function onServerError(error: Error) {
9-
if (
10-
(error?.message &&
11-
error.message.includes("Error POSTing to endpoint (HTTP 404)")) ||
12-
(error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED"))
13-
) {
9+
if (error?.cause && JSON.stringify(error.cause).includes("ECONNREFUSED")) {
1410
console.error("Connection refused. Is the MCP server running?");
11+
} else if (error.message && error.message.includes("404")) {
12+
console.error("Error accessing endpoint (HTTP 404)");
1513
} else {
1614
console.error("Error from MCP server:", error);
1715
}

0 commit comments

Comments
 (0)