Skip to main content
Glama
devlimelabs

MCP Environment & Installation Manager

by devlimelabs

get-env-var

Retrieve specific environment variables from MCP servers using profile IDs and variable keys for precise configuration management in the MCP Environment & Installation Manager.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
keyYesEnvironment variable key
profileIdYesProfile ID to get environment variable from

Implementation Reference

  • Handler function that validates the profileId and key, retrieves the profile and specific environment variable using ConfigService, masks the value if sensitive, and returns a structured text response with the details.
    async ({ profileId, key }, extra) => { if (!profileId.trim()) { throw new Error("Profile ID cannot be empty"); } if (!key.trim()) { throw new Error("Environment variable key cannot be empty"); } const profile = configService.getProfile(profileId); if (!profile) { throw new Error(`Profile not found: ${profileId}`); } const envVar = configService.getEnvVar(profileId, key); if (!envVar) { throw new Error(`Environment variable not found: ${key}`); } return { content: [ { type: "text", text: JSON.stringify({ profileId, profileName: profile.name, key, value: envVar.sensitive ? '********' : envVar.value, sensitive: envVar.sensitive, description: envVar.description }, null, 2) } ] }; } );
  • Input schema using Zod for the get-env-var tool, defining required string parameters profileId and key with descriptions.
    { profileId: z.string().describe("Profile ID to get environment variable from"), key: z.string().describe("Environment variable key") },
  • Direct registration of the get-env-var tool on the MCP server, including input schema and handler implementation.
    server.tool( "get-env-var", { profileId: z.string().describe("Profile ID to get environment variable from"), key: z.string().describe("Environment variable key") }, async ({ profileId, key }, extra) => { if (!profileId.trim()) { throw new Error("Profile ID cannot be empty"); } if (!key.trim()) { throw new Error("Environment variable key cannot be empty"); } const profile = configService.getProfile(profileId); if (!profile) { throw new Error(`Profile not found: ${profileId}`); } const envVar = configService.getEnvVar(profileId, key); if (!envVar) { throw new Error(`Environment variable not found: ${key}`); } return { content: [ { type: "text", text: JSON.stringify({ profileId, profileName: profile.name, key, value: envVar.sensitive ? '********' : envVar.value, sensitive: envVar.sensitive, description: envVar.description }, null, 2) } ] }; } );
  • src/server.ts:31-31 (registration)
    High-level registration call that invokes the environment tools module registration, which includes the get-env-var tool.
    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