Skip to main content
Glama

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
NameRequiredDescriptionDefault
app_nameYesFly.io app name (e.g., 'garza-home-mcp')
source_dirNoSource directory containing the MCP server code
regionNoFly.io region (default: dfw)

Implementation Reference

  • 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; }
  • 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 }; });
  • 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() || "" }; } }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/itsablabla/lastrock-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server