create-project
Initialize a project in Infisical by specifying its name, type, and optional details like description, slug, and template to streamline secret management configuration.
Instructions
Create a new project in Infisical
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| description | No | The description of the project to create | |
| kmsKeyId | No | The ID of the KMS key to use for the project. Defaults to Infisical's default KMS | |
| projectName | Yes | The name of the project to create (required) | |
| projectTemplate | No | The template of the project to create | |
| slug | No | The slug of the project to create | |
| type | Yes | The type of project to create (required). If not specified by the user, ask them to confirm the type they want to use. |
Implementation Reference
- src/index.ts:597-617 (handler)Handler function for the 'create-project' tool. Parses input arguments using the schema, calls infisicalSdk.projects().create() with the provided parameters, and returns the created project details.if (name === AvailableTools.CreateProject) { const data = createProjectSchema.zod.parse(args); const project = await infisicalSdk.projects().create({ projectName: data.projectName, projectDescription: data.description, kmsKeyId: data.kmsKeyId, slug: data.slug, template: data.projectTemplate, type: data.type }); return { content: [ { type: "text", text: `Project created successfully: ${JSON.stringify(project, null, 3)}` } ] }; }
- src/index.ts:276-320 (schema)Zod schema for input validation and capability definition (name, description, inputSchema) for the 'create-project' tool.const createProjectSchema = { zod: z.object({ projectName: z.string(), type: z.enum(["secret-manager", "cert-manager", "kms", "ssh"]), description: z.string().optional(), slug: z.string().optional(), projectTemplate: z.string().optional(), kmsKeyId: z.string().optional() }), capability: { name: AvailableTools.CreateProject, description: "Create a new project in Infisical", inputSchema: { type: "object", properties: { projectName: { type: "string", description: "The name of the project to create (required)" }, type: { type: "string", description: "The type of project to create (required). If not specified by the user, ask them to confirm the type they want to use." }, description: { type: "string", description: "The description of the project to create" }, slug: { type: "string", description: "The slug of the project to create" }, projectTemplate: { type: "string", description: "The template of the project to create" }, kmsKeyId: { type: "string", description: "The ID of the KMS key to use for the project. Defaults to Infisical's default KMS" } }, required: ["projectName", "type"] } } };
- src/index.ts:452-467 (registration)Registration of the 'create-project' tool in the list of available tools returned by ListToolsRequestSchema handler.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: [ createSecretSchema.capability, deleteSecretSchema.capability, updateSecretSchema.capability, listSecretsSchema.capability, getSecretSchema.capability, createProjectSchema.capability, createEnvironmentSchema.capability, createFolderSchema.capability, inviteMembersToProjectSchema.capability, listProjectsSchema.capability ] }; });
- src/index.ts:57-68 (helper)Enum defining the tool names, including 'create-project' used in handlers and schemas.enum AvailableTools { CreateSecret = "create-secret", DeleteSecret = "delete-secret", UpdateSecret = "update-secret", ListSecrets = "list-secrets", GetSecret = "get-secret", CreateProject = "create-project", CreateEnvironment = "create-environment", CreateFolder = "create-folder", InviteMembersToProject = "invite-members-to-project", ListProjects = "list-projects" }