Example prompt: Write secrets to kv
Use the following example as a guide to help you write your own prompt to manage Vault secrets in 'kv'.
Prompt
I need to store database credentials for my application.
Create a secret at secret/myapp/database with username "dbuser"
and password "secure123"
Expected workflow
The MCP server performs the following operations:
- Check mount existence: Verifies that the
secret/mount exists - Write secret: Creates the secret with the specified key-value pairs
Associated API request objects
Request object to create the
usernamesecret:{ "mount": "secret", "path": "myapp/database", "key": "username", "value": "dbuser" }Request object to create the
passwordsecret:{ "mount": "secret", "path": "myapp/database", "key": "password", "value": "secure123" }
Sample response
Successfully stored database credentials in Vault:
**Secret Path**: `secret/myapp/database`
**Keys Stored**:
- username: dbuser
- password: [hidden]
The secret has been written to your Vault KV v2 store. You can retrieve
these credentials using the path `secret/myapp/database` in your application
or by reading the secret directly from Vault.
**Security Note**: Ensure your application has appropriate Vault policies
to read from this path while following the principle of least privilege.