Skip to main content
Glama
Infisical

Infisical MCP Server

Official
by Infisical

create-secret

Add a new secret to a specified project and environment in Infisical, defining its name, value, and path for secure storage and management.

Instructions

Create a new secret in Infisical

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentSlugYesThe slug of the environment to create the secret in (required)
projectIdYesThe ID of the project to create the secret in (required)
secretNameYesThe name of the secret to create (required)
secretPathNoThe path of the secret to create (Defaults to /)
secretValueNoThe value of the secret to create

Implementation Reference

  • Handler logic for the 'create-secret' tool: parses arguments using Zod, invokes Infisical SDK's createSecret method, and returns a success response with the created secret details.
    if (name === AvailableTools.CreateSecret) { const data = createSecretSchema.zod.parse(args); const { secret } = await infisicalSdk.secrets().createSecret(data.secretName, { environment: data.environmentSlug, projectId: data.projectId, secretPath: data.secretPath, secretValue: data.secretValue ?? "" }); return { content: [ { type: "text", text: `Secret created successfully: ${JSON.stringify(secret, null, 3)}` } ] }; }
  • Input schema definition using Zod and MCP capability spec for the 'create-secret' tool.
    const createSecretSchema = { zod: z.object({ projectId: z.string(), environmentSlug: z.string(), secretName: z.string(), secretValue: z.string().optional(), secretPath: z.string().default("/") }), capability: { name: AvailableTools.CreateSecret, description: "Create a new secret in Infisical", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project to create the secret in (required)" }, environmentSlug: { type: "string", description: "The slug of the environment to create the secret in (required)" }, secretName: { type: "string", description: "The name of the secret to create (required)" }, secretValue: { type: "string", description: "The value of the secret to create" }, secretPath: { type: "string", description: "The path of the secret to create (Defaults to /)" } }, required: ["projectId", "environmentSlug", "secretName"] } } };
  • src/index.ts:452-467 (registration)
    Registration of the 'create-secret' tool (via its capability) 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 (registration)
    Enum defining the tool name constant 'create-secret' used throughout the implementation.
    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" }

Other Tools

Related Tools

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/Infisical/infisical-mcp-server'

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