doppler_secrets_set
Set secret values in Doppler for secure configuration management. Specify secret name, value, project, and config to update your secrets store.
Instructions
Set a secret value in Doppler
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the secret to set | |
| value | Yes | The value to set for the secret | |
| project | No | The Doppler project name (optional if set via doppler setup) | |
| config | No | The Doppler config name (optional if set via doppler setup) |
Implementation Reference
- src/doppler.ts:65-70 (handler)Specific switch case implementing the logic for the doppler_secrets_set tool by constructing the Doppler CLI command: doppler secrets set name=value [--project proj] [--config config] --jsoncase "doppler_secrets_set": parts.push("secrets", "set", `${getString("name")}=${getString("value")}`); if (getString("project")) parts.push("--project", getString("project")!); if (getString("config")) parts.push("--config", getString("config")!); parts.push("--json"); break;
- src/tools.ts:43-68 (schema)Input schema definition for the doppler_secrets_set tool, specifying required name and value, optional project and config.{ name: "doppler_secrets_set", description: "Set a secret value in Doppler", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name of the secret to set", }, value: { type: "string", description: "The value to set for the secret", }, project: { type: "string", description: "The Doppler project name (optional if set via doppler setup)", }, config: { type: "string", description: "The Doppler config name (optional if set via doppler setup)", }, }, required: ["name", "value"], }, },
- src/index.ts:27-31 (registration)Tool list registration handler that exposes the doppler_secrets_set tool (via toolDefinitions) to MCP clients.server.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions, }; });
- src/index.ts:34-51 (registration)Central callTool request handler that registers execution capability for all tools, including doppler_secrets_set, by dispatching to executeCommand(name, args).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}`); } });
- src/doppler.ts:10-36 (helper)Helper function executeCommand that runs the constructed Doppler CLI command using execSync, handles output parsing, and error handling.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}`); } }