service_create_from_repo
Deploy applications directly from GitHub repositories using this tool. Ideal for projects requiring build processes, it simplifies service creation within specified projects, ensuring efficient deployment workflows.
Instructions
[API] Create a new service from a GitHub repository
⚡️ Best for: ✓ Deploying applications from source code ✓ Services that need build processes ✓ GitHub-hosted projects
⚠️ Not for: × Pre-built Docker images (use service_create_from_image) × Database deployments (use database_deploy) × Static file hosting
→ Prerequisites: project_list
→ Alternatives: service_create_from_image, database_deploy
→ Next steps: variable_set, service_update
→ Related: deployment_trigger, service_info
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | No | Optional custom name for the service | |
| projectId | Yes | ID of the project to create the service in | |
| repo | Yes | GitHub repository URL or name (e.g., 'owner/repo') |
Input Schema (JSON Schema)
Implementation Reference
- src/tools/service.tool.ts:57-87 (registration)Registration of the service_create_from_repo tool using createTool function, including description, schema, and handler function that calls the service service.createTool( "service_create_from_repo", formatToolDescription({ type: 'API', description: "Create a new service from a GitHub repository", bestFor: [ "Deploying applications from source code", "Services that need build processes", "GitHub-hosted projects" ], notFor: [ "Pre-built Docker images (use service_create_from_image)", "Database deployments (use database_deploy)", "Static file hosting" ], relations: { prerequisites: ["project_list"], nextSteps: ["variable_set", "service_update"], alternatives: ["service_create_from_image", "database_deploy"], related: ["deployment_trigger", "service_info"] } }), { projectId: z.string().describe("ID of the project to create the service in"), repo: z.string().describe("GitHub repository URL or name (e.g., 'owner/repo')"), name: z.string().optional().describe("Optional custom name for the service") }, async ({ projectId, repo, name }) => { return serviceService.createServiceFromRepo(projectId, repo, name); } ),
- src/services/service.service.ts:88-105 (handler)Core handler logic for creating a service from a GitHub repository using the Railway client API.async createServiceFromRepo(projectId: string, repo: string, name?: string) { try { const service = await this.client.services.createService({ projectId, name, source: { repo, } }); return createSuccessResponse({ text: `Created new service "${service.name}" (ID: ${service.id}) from GitHub repo "${repo}"`, data: service }); } catch (error) { return createErrorResponse(`Error creating service: ${formatError(error)}`); } }
- src/tools/service.tool.ts:79-83 (schema)Zod input schema defining parameters: projectId, repo, and optional name.{ projectId: z.string().describe("ID of the project to create the service in"), repo: z.string().describe("GitHub repository URL or name (e.g., 'owner/repo')"), name: z.string().optional().describe("Optional custom name for the service") },
- src/tools/index.ts:16-37 (registration)Global registration of all tools, including serviceTools containing service_create_from_repo, to the MCP server.export function registerAllTools(server: McpServer) { // Collect all tools const allTools = [ ...databaseTools, ...deploymentTools, ...domainTools, ...projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server allTools.forEach((tool) => { server.tool( ...tool ); }); }