private-keys
Manage SSH private keys for Coolify deployments to enable secure server access and authentication.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| operation | Yes | Operation to perform | |
| id | No | Private Key UUID | |
| body | No | JSON request body |
Implementation Reference
- src/mcp/tools/private-keys.ts:16-47 (handler)Core handler function for the 'private-keys' tool. Parses arguments and dispatches to API operations (list, get, create, update, delete) using safeApiCall wrapper.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:302-308 (schema)Zod schema defining input parameters for the 'private-keys' MCP tool: operation (enum), optional id, optional 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") }, async ({ operation, id, body }) => {
- src/mcp-server.ts:299-333 (registration)MCP server.tool registration for 'private-keys' tool, including Zod schema and error-handling wrapper around 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 }; } } );