Skip to main content
Glama
aledlie

Doppler MCP Server

by aledlie

doppler_environments_list

Retrieve all environment names within a Doppler project to manage configuration settings across development, staging, and production workflows.

Instructions

List all environments in a Doppler project

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
projectNoThe Doppler project name (optional if set via doppler setup)

Implementation Reference

  • Specific handler logic for 'doppler_environments_list' tool: builds the CLI command 'doppler environments list [--project PROJ] --json' and executes it via execSync.
    case "doppler_environments_list":
      parts.push("environments", "list");
      if (getString("project")) parts.push("--project", getString("project")!);
      parts.push("--json");
      break;
  • Tool schema definition for 'doppler_environments_list', specifying input parameters (optional project).
    {
      name: "doppler_environments_list",
      description: "List all environments in a Doppler project",
      inputSchema: {
        type: "object",
        properties: {
          project: {
            type: "string",
            description: "The Doppler project name (optional if set via doppler setup)",
          },
        },
      },
    },
  • src/index.ts:27-31 (registration)
    Registers the list of tools including 'doppler_environments_list' via toolDefinitions.
    server.setRequestHandler(ListToolsRequestSchema, async () => {
      return {
        tools: toolDefinitions,
      };
    });
  • src/index.ts:34-51 (registration)
    Main tool call handler that dispatches to executeCommand based on tool name, handling 'doppler_environments_list'.
    server.setRequestHandler(CallToolRequestSchema, async (request) => {
      const { name, arguments: args } = request.params;
    
      try {
        const result = await executeCommand(name, args || {});
        return {
          content: [
            {
              type: "text",
              text: JSON.stringify(result, null, 2),
            },
          ],
        };
      } catch (error) {
        const errorMessage = error instanceof Error ? error.message : String(error);
        throw new McpError(ErrorCode.InternalError, `Doppler CLI error: ${errorMessage}`);
      }
    });
  • Core helper function that executes the built Doppler CLI command for all tools, including parsing JSON output.
    export async function executeCommand(
      toolName: string,
      args: DopplerArgs
    ): Promise<any> {
      const command = buildDopplerCommand(toolName, args);
    
      try {
        const output = execSync(command, {
          encoding: "utf-8",
          stdio: ["pipe", "pipe", "pipe"],
          maxBuffer: 10 * 1024 * 1024, // 10MB buffer
        });
    
        // Try to parse as JSON, if it fails return raw output
        try {
          return JSON.parse(output);
        } catch {
          return { output: output.trim() };
        }
      } catch (error: any) {
        // Handle execution errors
        const stderr = error.stderr?.toString() || "";
        const stdout = error.stdout?.toString() || "";
        const message = stderr || stdout || error.message;
        throw new Error(`Doppler CLI command failed: ${message}`);
      }
    }

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/aledlie/doppler-mcp'

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