create_project
Initialize a new project with name, description, tech stack details, and current phase to establish persistent context for coding sessions.
Instructions
Create a new project with initial context
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | Project name | |
| description | Yes | Project description | |
| techStack | No | ||
| currentPhase | Yes | Current project phase |
Implementation Reference
- src/server.ts:45-87 (handler)The asynchronous handler function for the 'create_project' MCP tool, which processes input, creates the project via store, and returns formatted response or error.async ({ name, description, techStack, currentPhase }) => { try { const project = await this.store.createProject({ name, description, status: "planning", techStack: techStack || { frontend: [], backend: [], database: [], infrastructure: [], tools: [], }, architecture: { observability: [], }, currentPhase, nextSteps: [], tasks: [], decisions: [], notes: [], }); return { content: [ { type: "text", text: `Project "${project.name}" created with ID: ${project.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error creating project: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } }
- src/server.ts:30-43 (schema)Zod input schema for validating parameters of the create_project tool.inputSchema: { name: z.string().describe("Project name"), description: z.string().describe("Project description"), techStack: z .object({ frontend: z.array(z.string()).default([]), backend: z.array(z.string()).default([]), database: z.array(z.string()).default([]), infrastructure: z.array(z.string()).default([]), tools: z.array(z.string()).default([]), }) .optional(), currentPhase: z.string().describe("Current project phase"), },
- src/server.ts:25-88 (registration)MCP server registration of the 'create_project' tool, specifying name, metadata, schema, and handler callback.this.server.registerTool( "create_project", { title: "Create Project", description: "Create a new project with initial context", inputSchema: { name: z.string().describe("Project name"), description: z.string().describe("Project description"), techStack: z .object({ frontend: z.array(z.string()).default([]), backend: z.array(z.string()).default([]), database: z.array(z.string()).default([]), infrastructure: z.array(z.string()).default([]), tools: z.array(z.string()).default([]), }) .optional(), currentPhase: z.string().describe("Current project phase"), }, }, async ({ name, description, techStack, currentPhase }) => { try { const project = await this.store.createProject({ name, description, status: "planning", techStack: techStack || { frontend: [], backend: [], database: [], infrastructure: [], tools: [], }, architecture: { observability: [], }, currentPhase, nextSteps: [], tasks: [], decisions: [], notes: [], }); return { content: [ { type: "text", text: `Project "${project.name}" created with ID: ${project.id}`, }, ], }; } catch (error) { return { content: [ { type: "text", text: `Error creating project: ${ error instanceof Error ? error.message : "Unknown error" }`, }, ], }; } } );
- src/storage/project-store.ts:28-48 (helper)ProjectStore.createProject helper method that generates ID, timestamps, validates with schema, and persists project as JSON file.async createProject( projectData: Omit< ProjectContext, "id" | "createdAt" | "updatedAt" | "lastAccessedAt" > ): Promise<ProjectContext> { const now = new Date().toISOString(); const project: ProjectContext = { ...projectData, id: uuidv4(), createdAt: now, updatedAt: now, lastAccessedAt: now, }; const validated = ProjectContextSchema.parse(project); const filePath = path.join(this.projectsDir, `${project.id}.json`); await fs.writeJson(filePath, validated, { spaces: 2 }); return validated; }
- src/types/project-types.ts:34-79 (schema)Comprehensive Zod schema for ProjectContext type, used to validate project data in the store.export const ProjectContextSchema = z.object({ id: z.string(), name: z.string(), description: z.string(), status: ProjectStatusSchema, techStack: z.object({ frontend: z.array(z.string()).default([]), backend: z.array(z.string()).default([]), database: z.array(z.string()).default([]), infrastructure: z.array(z.string()).default([]), tools: z.array(z.string()).default([]), }), architecture: z.object({ pattern: z.string().optional(), deploymentTarget: z.string().optional(), scalingStrategy: z.string().optional(), observability: z.array(z.string()).default([]), }), currentPhase: z.string(), nextSteps: z.array(z.string()).default([]), tasks: z.array(TaskSchema).default([]), decisions: z .array( z.object({ id: z.string(), decision: z.string(), reasoning: z.string(), timestamp: z.string(), impact: z.string().optional(), }) ) .default([]), notes: z .array( z.object({ id: z.string(), content: z.string(), timestamp: z.string(), category: z.string().optional(), }) ) .default([]), createdAt: z.string(), updatedAt: z.string(), lastAccessedAt: z.string(), });