@andrea9293/mcp-gemini-prompt-enhancer
Version:
A Model Context Protocol (MCP) server that provides a prompt optimization service for Large Language Models (LLMs) using Google Gemini, with advanced prompt engineering thanks to 22365_3_Prompt_Engineering_v7.pdf authored by Lee Boonstra
34 lines (33 loc) • 1.05 kB
JavaScript
import { startRemoteServer } from "./server.js";
// Environment variables with default values
const PORT = parseInt(process.env.PORT || "3002", 10);
async function main() {
try {
// Create and initialize the FastMCP server
const server = await startRemoteServer();
// Start the server with HTTP stream transport (SSE endpoint)
server.start({
transportType: "httpStream",
httpStream: {
port: PORT,
endpoint: "/sse",
},
});
console.error(`MCP Server running at http://localhost:${PORT}`);
console.error(`SSE endpoint: http://localhost:${PORT}/sse`);
}
catch (error) {
console.error("Failed to start server:", error);
process.exit(1);
}
}
// Handle process termination gracefully
process.on("SIGINT", () => {
console.error("Shutting down server...");
process.exit(0);
});
// Start the server
main().catch((error) => {
console.error("Fatal error:", error);
process.exit(1);
});