Skip to main content
Glama
devlimelabs

MCP Environment & Installation Manager

by devlimelabs

list-env-vars

Retrieve environment variables for a specific profile ID to manage configurations and automate installations in the MCP server environment.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
profileIdYesProfile ID to list environment variables from

Implementation Reference

  • The handler function implementing the core logic of the 'list-env-vars' tool: validates input, fetches profile and environment variables via ConfigService, masks sensitive values, formats as JSON, and returns as text content.
    async ({ profileId }, extra) => { if (!profileId.trim()) { throw new Error("Profile ID cannot be empty"); } const profile = configService.getProfile(profileId); if (!profile) { throw new Error(`Profile not found: ${profileId}`); } const envVars = configService.getEnvVars(profileId); // Transform to array and mask sensitive values const result = Object.entries(envVars).map(([key, envVar]) => ({ key, value: envVar.sensitive ? '********' : envVar.value, sensitive: envVar.sensitive, description: envVar.description })); return { content: [ { type: "text", text: JSON.stringify({ profileId, profileName: profile.name, variables: result }, null, 2) } ] }; }
  • Input schema definition for the 'list-env-vars' tool using Zod, specifying the required 'profileId' parameter.
    { profileId: z.string().describe("Profile ID to list environment variables from") },
  • Direct registration of the 'list-env-vars' tool on the MCP server using server.tool(), including name, schema, and handler.
    server.tool( "list-env-vars", { profileId: z.string().describe("Profile ID to list environment variables from") }, async ({ profileId }, extra) => { if (!profileId.trim()) { throw new Error("Profile ID cannot be empty"); } const profile = configService.getProfile(profileId); if (!profile) { throw new Error(`Profile not found: ${profileId}`); } const envVars = configService.getEnvVars(profileId); // Transform to array and mask sensitive values const result = Object.entries(envVars).map(([key, envVar]) => ({ key, value: envVar.sensitive ? '********' : envVar.value, sensitive: envVar.sensitive, description: envVar.description })); return { content: [ { type: "text", text: JSON.stringify({ profileId, profileName: profile.name, variables: result }, null, 2) } ] }; } );
  • src/server.ts:31-31 (registration)
    Top-level registration call for the environment tools module (containing list-env-vars) during server initialization.
    registerEnvironmentTools(server, configService);

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/devlimelabs/mcp-env-manager-mcp'

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