deploy_mcp_server
Deploy MCP servers to Fly.io with state tracking, distributed locking, and health checks for reliable infrastructure orchestration.
Instructions
Deploy MCP server to Fly.io with state tracking, locks, and health checks. DO NOT use ssh_exec for deployments - always use this tool instead.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| app_name | Yes | Fly.io app name (e.g., 'garza-home-mcp') | |
| source_dir | No | Source directory containing the MCP server code | |
| region | No | Fly.io region (default: dfw) |
Implementation Reference
- src/index.ts:194-207 (handler)Handler for deploy_mcp_server tool: extracts parameters and invokes the orchestrator script for deployment.case "deploy_mcp_server": { const { app_name, source_dir, region } = args as { app_name: string; source_dir?: string; region?: string; }; result = executeOrchestrator("deploy/mcp-server", { app_name, source_dir: source_dir || `/Users/customer/${app_name}`, region: region || "dfw" }); break; }
- src/index.ts:47-68 (schema)Input schema and tool metadata definition for deploy_mcp_server, used for tool listing and validation.{ name: "deploy_mcp_server", description: "Deploy MCP server to Fly.io with state tracking, locks, and health checks. DO NOT use ssh_exec for deployments - always use this tool instead.", inputSchema: { type: "object", properties: { app_name: { type: "string", description: "Fly.io app name (e.g., 'garza-home-mcp')" }, source_dir: { type: "string", description: "Source directory containing the MCP server code" }, region: { type: "string", description: "Fly.io region (default: dfw)" } }, required: ["app_name"] } },
- src/index.ts:182-184 (registration)Registration of the listTools handler that returns the tools array including deploy_mcp_server.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools }; });
- src/index.ts:16-43 (helper)Helper function executeOrchestrator that runs the Python orchestrator script, used by deploy_mcp_server and other tools.function executeOrchestrator(operation: string, params: Record<string, string> = {}): any { const paramStr = Object.entries(params) .map(([key, value]) => `${key}="${value}"`) .join(" "); const cmd = `cd ${ORCHESTRATOR_PATH} && python orchestrator.py ${operation} ${paramStr}`; try { const output = execSync(cmd, { encoding: "utf-8", maxBuffer: 10 * 1024 * 1024 }); // Try to parse as JSON, fallback to plain text try { return JSON.parse(output); } catch { return { output: output.trim() }; } } catch (error: any) { return { success: false, error: error.message, stderr: error.stderr?.toString() || "", stdout: error.stdout?.toString() || "" }; } }