Skip to content

Commit 6bce3b7

Browse files
authored
Merge pull request #46 from CodeDuckky/fix/sse-transport
fix: add missing server listen call in SSE mode
2 parents 784babb + e22514a commit 6bce3b7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,6 +1347,18 @@ async function runSSELocalServer() {
13471347
transport.handlePostMessage(req, res);
13481348
}
13491349
});
1350+
1351+
const PORT = process.env.PORT || 3000;
1352+
console.log('Starting server on port', PORT);
1353+
try {
1354+
app.listen(PORT, () => {
1355+
console.log(`MCP SSE Server listening on http://localhost:${PORT}`);
1356+
console.log(`SSE endpoint: http://localhost:${PORT}/sse`);
1357+
console.log(`Message endpoint: http://localhost:${PORT}/messages`);
1358+
});
1359+
} catch (error) {
1360+
console.error('Error starting server:', error);
1361+
}
13501362
}
13511363

13521364
async function runSSECloudServer() {

0 commit comments

Comments
 (0)