project_create
Create a new Railway project to start applications, set up development environments, and establish project spaces for deployment.
Instructions
[API] Create a new Railway project
⚡️ Best for: ✓ Starting new applications ✓ Setting up development environments ✓ Creating project spaces
⚠️ Not for: × Duplicating existing projects
→ Next steps: service_create_from_repo, service_create_from_image, database_deploy
→ Related: project_delete, project_update
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Name for the new project | |
| teamId | No | Optional team ID to create the project under |
Implementation Reference
- src/tools/project.tool.ts:77-79 (handler)The execution handler for the 'project_create' tool, which delegates to projectService.createProject with name and optional teamId.async ({ name, teamId }) => { return projectService.createProject(name, teamId); }
- src/tools/project.tool.ts:73-76 (schema)Input schema definition using Zod for validating 'name' (required string) and 'teamId' (optional string).{ name: z.string().describe("Name for the new project"), teamId: z.string().optional().describe("Optional team ID to create the project under") },
- src/tools/index.ts:22-36 (registration)Registration of the projectTools array (containing project_create) with the MCP server via server.tool() in a loop over all tools....projectTools, ...serviceTools, ...tcpProxyTools, ...variableTools, ...configTools, ...volumeTools, ...templateTools, ] as Tool[]; // Register each tool with the server allTools.forEach((tool) => { server.tool( ...tool ); });
- Helper method in ProjectService that calls the repository, handles errors, and formats the success/error response.async createProject(name: string, teamId?: string): Promise<CallToolResult> { try { const project = await this.client.projects.createProject(name, teamId); return createSuccessResponse({ text: `Created new project "${project.name}" (ID: ${project.id})`, data: project }); } catch (error) { return createErrorResponse(`Error creating project: ${formatError(error)}`); } }
- Core helper implementing the GraphQL mutation for creating a project via Railway API, parsing and normalizing the response.async createProject(name: string, teamId?: string): Promise<Project> { const data = await this.client.request<{ projectCreate: Project }>(` mutation projectCreate($name: String!, $teamId: String) { projectCreate( input: { name: $name, teamId: $teamId }) { id name description environments { edges { node { id name } } pageInfo { hasNextPage hasPreviousPage } } services { edges { node { id name } } pageInfo { hasNextPage hasPreviousPage } } } } `, { name, teamId }); return { ...data.projectCreate, environments: data.projectCreate.environments || { edges: [], pageInfo: { hasNextPage: false, hasPreviousPage: false } }, services: data.projectCreate.services || { edges: [], pageInfo: { hasNextPage: false, hasPreviousPage: false } } }; }