create_secret
Generate secure secrets for APISIX-MCP by specifying a manager (Vault, AWS, or GCP) and providing required credentials, ensuring secure integration with supported platforms.
Instructions
Create a secret
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| id | No | secret id | |
| manager | Yes | secret manager type | |
| secret | Yes |
Implementation Reference
- src/tools/secret.ts:16-24 (handler)Registers the "create_secret" tool and provides its handler function, which conditionally creates (POST) or updates (PUT) a secret via admin API based on whether an ID is provided.server.tool("create_secret", "Create a secret", CreateSecretSchema.shape, async (args) => { const secretId = args.id; if (secretId) { return await makeAdminAPIRequest(`/secrets/${args.manager}/${secretId}`, "PUT", args.secret); } else { return await makeAdminAPIRequest(`/secrets/${args.manager}`, "POST", args.secret); } });
- src/schemas/secret.ts:65-69 (schema)Defines the Zod input schema for the create_secret tool, including optional secret ID, manager type, and secret configuration.export const CreateSecretSchema = z.object({ id: z.string().optional().describe("secret id"), manager: SecretTypeSchema.describe("secret manager type"), secret: SecretSchema, });