Skip to main content
Glama
Infisical

Infisical MCP Server

Official
by Infisical

list-secrets

Retrieve and display all secrets within a specified project and environment in Infisical. Supports custom paths, expanded references, and included imports for comprehensive secret management.

Instructions

List all secrets in a given Infisical project and environment

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
environmentSlugYesThe slug of the environment to list the secrets from (required)
expandSecretReferencesNoWhether to expand secret references (Defaults to true)
includeImportsNoWhether to include secret imports (Defaults to true)
projectIdYesThe ID of the project to list the secrets from (required)
secretPathNoThe path of the secrets to list (Defaults to /)

Implementation Reference

  • Handler for the 'list-secrets' tool. Parses input, calls infisicalSdk.secrets().listSecrets(), processes secrets and imports, and returns formatted JSON response.
    if (name === AvailableTools.ListSecrets) { const data = listSecretsSchema.zod.parse(args); const secrets = await infisicalSdk.secrets().listSecrets({ environment: data.environmentSlug, projectId: data.projectId, secretPath: data.secretPath, expandSecretReferences: data.expandSecretReferences, includeImports: data.includeImports }); const response = { secrets: secrets.secrets.map(secret => ({ secretKey: secret.secretKey, secretValue: secret.secretValue })), ...(secrets.imports && { imports: secrets.imports?.map(imp => { const parsedImportSecrets = imp.secrets.map(secret => ({ secretKey: secret.secretKey, secretValue: secret.secretValue })); return { ...imp, secrets: parsedImportSecrets }; }) }) }; return { content: [ { type: "text", text: `${JSON.stringify(response)}` } ] }; }
  • Schema definition for 'list-secrets' tool, including Zod validator and capability metadata with inputSchema.
    const listSecretsSchema = { zod: z.object({ projectId: z.string(), environmentSlug: z.string(), secretPath: z.string().default("/"), expandSecretReferences: z.boolean().default(true), includeImports: z.boolean().default(true) }), capability: { name: AvailableTools.ListSecrets, description: "List all secrets in a given Infisical project and environment", inputSchema: { type: "object", properties: { projectId: { type: "string", description: "The ID of the project to list the secrets from (required)" }, environmentSlug: { type: "string", description: "The slug of the environment to list the secrets from (required)" }, secretPath: { type: "string", description: "The path of the secrets to list (Defaults to /)" }, expandSecretReferences: { type: "boolean", description: "Whether to expand secret references (Defaults to true)" }, includeImports: { type: "boolean", description: "Whether to include secret imports (Defaults to true)" } }, required: ["projectId", "environmentSlug"] } } };
  • src/index.ts:452-467 (registration)
    Registration of all tools including 'list-secrets' via the ListToolsRequestSchema handler, where listSecretsSchema.capability is included in the tools array.
    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 tool names, including ListSecrets = "list-secrets" used throughout for matching.
    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