private-keys
Manage private keys for Coolify MCP Server by listing, creating, updating, or deleting them using structured JSON operations for secure deployment control.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| body | No | JSON request body | |
| id | No | Private Key UUID | |
| operation | Yes | Operation to perform |
Implementation Reference
- src/mcp/tools/private-keys.ts:16-47 (handler)The privateKeysHandler function implements the logic for the 'private-keys' tool, handling list, get, create, update, and delete operations using generated API calls wrapped in safeApiCall.export async function privateKeysHandler(args: PrivateKeysToolArgs) { const { operation, id, body } = args; switch (operation) { case 'list': return await safeApiCall(() => listPrivateKeys()); case 'get': if (!id) throw new Error('ID required for get operation'); return await safeApiCall(() => getPrivateKeyByUuid({ path: { uuid: id } })); case 'create': if (!body) throw new Error('Body required for create operation'); const createData = JSON.parse(body); return await safeApiCall(() => createPrivateKey({ body: createData })); case 'update': if (!id || !body) throw new Error('ID and body required for update operation'); const updateData = JSON.parse(body); return await safeApiCall(() => updatePrivateKey({ path: { uuid: id }, body: updateData } as any)); case 'delete': if (!id) throw new Error('ID required for delete operation'); return await safeApiCall(() => deletePrivateKeyByUuid({ path: { uuid: id } })); default: throw new Error(`Unknown operation: ${operation}`); } }
- src/mcp-server.ts:299-333 (registration)MCP server registration of the 'private-keys' tool, including Zod input schema validation and a wrapper handler that delegates to privateKeysHandler.server.tool( 'private-keys', { operation: z.enum([ 'list', 'get', 'create', 'update', 'delete' ]).describe("Operation to perform"), id: z.string().optional().describe("Private Key UUID"), body: z.string().optional().describe("JSON request body") }, async ({ operation, id, body }) => { try { console.error('Private-keys tool received args:', JSON.stringify({ operation, id, body }, null, 2)); const result = await privateKeysHandler({ operation, id, body }); return { content: [{ type: 'text', text: JSON.stringify(result, null, 2) }] }; } catch (error) { return { content: [{ type: 'text', text: `Error: ${error instanceof Error ? error.message : String(error)}` }], isError: true }; } } );
- src/mcp-server.ts:301-307 (schema)Zod schema defining the input parameters for the 'private-keys' tool: operation (enum), optional id and body.{ operation: z.enum([ 'list', 'get', 'create', 'update', 'delete' ]).describe("Operation to perform"), id: z.string().optional().describe("Private Key UUID"), body: z.string().optional().describe("JSON request body") },