fix: Configure HTTP server to listen on 0.0.0.0:8080
This commit is contained in:
parent
7da435c107
commit
0f0b957d54
|
@ -48,7 +48,7 @@ const config = {
|
||||||
if (portIndex !== -1 && portIndex + 1 < process.argv.length) {
|
if (portIndex !== -1 && portIndex + 1 < process.argv.length) {
|
||||||
return parseInt(process.argv[portIndex + 1]);
|
return parseInt(process.argv[portIndex + 1]);
|
||||||
}
|
}
|
||||||
// Default port
|
// Default port for MCP
|
||||||
return 8080;
|
return 8080;
|
||||||
})()
|
})()
|
||||||
};
|
};
|
||||||
|
@ -90,7 +90,7 @@ const autoLogin = async () => {
|
||||||
const initializeTransport = () => {
|
const initializeTransport = () => {
|
||||||
switch (config.TRANSPORT.toLowerCase()) {
|
switch (config.TRANSPORT.toLowerCase()) {
|
||||||
case 'http':
|
case 'http':
|
||||||
info(`Initializing HTTP transport on port ${config.HTTP_PORT}`);
|
info(`Initializing HTTP transport on 0.0.0.0:${config.HTTP_PORT}`);
|
||||||
return new StreamableHttpTransport(config.HTTP_PORT);
|
return new StreamableHttpTransport(config.HTTP_PORT);
|
||||||
case 'stdio':
|
case 'stdio':
|
||||||
info('Initializing stdio transport');
|
info('Initializing stdio transport');
|
||||||
|
|
|
@ -56,7 +56,7 @@ export class StreamableHttpTransport implements MCPTransport {
|
||||||
private transport: StreamableHTTPServerTransport | null = null;
|
private transport: StreamableHTTPServerTransport | null = null;
|
||||||
private toolContext: ReturnType<typeof createToolContext> | null = null;
|
private toolContext: ReturnType<typeof createToolContext> | null = null;
|
||||||
|
|
||||||
constructor(private port: number = 3000) {
|
constructor(private port: number = 8080) {
|
||||||
this.app = express();
|
this.app = express();
|
||||||
this.app.use(express.json());
|
this.app.use(express.json());
|
||||||
this.setupEndpoints();
|
this.setupEndpoints();
|
||||||
|
@ -343,8 +343,8 @@ export class StreamableHttpTransport implements MCPTransport {
|
||||||
info('Transport connected');
|
info('Transport connected');
|
||||||
|
|
||||||
return new Promise((resolve) => {
|
return new Promise((resolve) => {
|
||||||
this.httpServer = this.app.listen(this.port, () => {
|
this.httpServer = this.app.listen(this.port, '0.0.0.0', () => {
|
||||||
info(`MCP Server listening on port ${this.port}`);
|
info(`MCP Server listening on 0.0.0.0:${this.port}`);
|
||||||
resolve();
|
resolve();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue