Skip to main content
Glama

project_create

Create new Railway projects for applications, development environments, or project spaces. Start by defining a project name and optional team ID. Use with follow-up tools to deploy services or databases.

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
NameRequiredDescriptionDefault
nameYesName for the new project
teamIdNoOptional team ID to create the project under

Implementation Reference

  • The handler function for the 'project_create' tool. It receives name and optional teamId, then delegates to projectService.createProject.
    async ({ name, teamId }) => {
      return projectService.createProject(name, teamId);
    }
  • Zod input schema defining required 'name' (string) and optional 'teamId' (string) parameters for the project_create tool.
    {
      name: z.string().describe("Name for the new project"),
      teamId: z.string().optional().describe("Optional team ID to create the project under")
    },
  • Registers all tools, including 'project_create' from projectTools array, to the MCP server using server.tool().
    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
        );
      });
    } 
  • Helper service method that handles project creation API call, response formatting, and error handling.
    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)}`);
      }
    }
  • Repository helper performing the GraphQL mutation 'projectCreate' to create the project on Railway API.
    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 } }
      };
    }

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/jason-tan-swe/railway-mcp'

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