delete-secret
Remove a specific secret from a project within the Infisical MCP Server by specifying the project ID, environment slug, and secret name.
Instructions
Delete a secret in Infisical
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| environmentSlug | Yes | The slug of the environment to delete the secret from (required) | |
| projectId | Yes | The ID of the project to delete the secret from (required) | |
| secretName | Yes | The name of the secret to delete (required) | |
| secretPath | No | The path of the secret to delete (Defaults to /) |
Implementation Reference
- src/index.ts:495-512 (handler)The handler logic for the 'delete-secret' tool. It validates input using the Zod schema, calls the Infisical SDK to delete the secret, and returns a success message with the deleted secret's key.if (name === AvailableTools.DeleteSecret) { const data = deleteSecretSchema.zod.parse(args); const { secret } = await infisicalSdk.secrets().deleteSecret(data.secretName, { environment: data.environmentSlug, projectId: data.projectId, secretPath: data.secretPath }); return { content: [ { type: "text", text: `Secret deleted successfully: ${secret.secretKey}` } ] }; }
- src/index.ts:110-143 (schema)Input schema definition for the 'delete-secret' tool, including Zod validation schema and MCP capability with inputSchema for tool registration.const deleteSecretSchema = { zod: z.object({ projectId: z.string(), environmentSlug: z.string(), secretPath: z.string().default("/"), secretName: z.string() }), capability: { name: AvailableTools.DeleteSecret, description: "Delete a secret in Infisical", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project to delete the secret from (required)" }, environmentSlug: { type: "string", description: "The slug of the environment to delete the secret from (required)" }, secretPath: { type: "string", description: "The path of the secret to delete (Defaults to /)" }, secretName: { type: "string", description: "The name of the secret to delete (required)" } }, required: ["projectId", "environmentSlug", "secretName"] } } };
- src/index.ts:452-467 (registration)Registration of the 'delete-secret' tool (via deleteSecretSchema.capability) along with other tools in the 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 ] }; });