doppler_secrets_get
Retrieve secret values from Doppler's secure secrets management system by specifying the secret name, with optional project and config parameters for targeted access.
Instructions
Get a secret value from Doppler
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the secret to retrieve | |
| 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:51-56 (handler)Specific switch case implementing the logic for 'doppler_secrets_get' tool by constructing the Doppler CLI command: doppler secrets get <name> [--project <project>] [--config <config>] --jsoncase "doppler_secrets_get": parts.push("secrets", "get", getString("name")!); if (getString("project")) parts.push("--project", getString("project")!); if (getString("config")) parts.push("--config", getString("config")!); parts.push("--json"); break;
- src/tools.ts:4-25 (schema)Input schema and metadata definition for the 'doppler_secrets_get' tool{ name: "doppler_secrets_get", description: "Get a secret value from Doppler", inputSchema: { type: "object", properties: { name: { type: "string", description: "The name of the secret to retrieve", }, 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"], }, },
- src/index.ts:34-51 (registration)MCP server request handler registration for calling tools; dispatches 'doppler_secrets_get' and other tools to executeCommandserver.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/index.ts:27-31 (registration)MCP server request handler for listing tools, providing the schema for 'doppler_secrets_get' via toolDefinitionsserver.setRequestHandler(ListToolsRequestSchema, async () => { return { tools: toolDefinitions, }; });
- src/doppler.ts:10-36 (helper)Core helper function that executes the Doppler CLI command built for each tool, including 'doppler_secrets_get'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}`); } }