@kinetixarts/server-craft-it
Version:
Craft IT - Model Context Protocol (MCP) compliant Server for AI-Powered Asset Generation using Gemini
32 lines • 1.21 kB
JavaScript
import startServer from "./server/server.js";
// Start the server
async function main() {
try {
const server = await startServer();
const PORT = Number(process.env.PORT) || 3002;
const HOST = process.env.HOST || '0.0.0.0';
// Set HOST environment variable to control which interface the server binds to
process.env.HOST = HOST;
// Note: CORS support must be configured separately if needed, as it's not
// part of the httpStream configuration object
server.start({
transportType: "httpStream",
httpStream: {
port: PORT,
endpoint: "/stream"
}
});
console.error(`MCP Server running at http://${HOST}:${PORT}`);
console.error(`HTTP Stream endpoint for remote access: http://${HOST}:${PORT}/stream`);
console.error(`Note: For remote connections, use the server's actual IP or domain name`);
}
catch (error) {
console.error("Error starting MCP server:", error);
process.exit(1);
}
}
main().catch((error) => {
console.error("Fatal error in main():", error);
process.exit(1);
});
//# sourceMappingURL=index.js.map