#!/usr/bin/env node /** * Coolify MCP Server - Stdio Transport. * * Entry point for running the MCP server with stdio transport. * This is the standard way to use the MCP server with Claude Desktop. * * @module */ import { Server } from "@modelcontextprotocol/sdk/server/index.js"; import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js"; import { CallToolRequestSchema, ListToolsRequestSchema, } from "@modelcontextprotocol/sdk/types.js"; import { coolifyTools } from "../tools/definitions.js"; import { handleToolCall } from "../tools/handlers.js"; const server = new Server( { name: "coolify-mks-cli", version: "0.6.0", }, { capabilities: { tools: {}, }, }, ); server.setRequestHandler(ListToolsRequestSchema, async () => ({ tools: coolifyTools, })); server.setRequestHandler(CallToolRequestSchema, async (request) => { const { name, arguments: args } = request.params; return await handleToolCall(name, args as Record); }); async function main() { const transport = new StdioServerTransport(); await server.connect(transport); } main().catch((error) => { console.error("Fatal error starting MCP server:", error); process.exit(1); });