run_with_credential
Runs a bash command with credentials from keymaster-mcp injected as environment variables, then scrubs secrets from stdout/stderr to prevent exposure.
Instructions
Run a bash command with the credential injected as environment variables; stdout/stderr
are scrubbed of the secret (and its base64/url/hex encodings).
Always set: KM_NAME, KM_USERNAME, KM_SECRET (main secret), KM_ for every secret and
field (KM_PASSWORD, KM_TOKEN, KM_KEY, KM_HOST...), KM_URL, KM_BASIC_AUTH.
Type extras — aws: AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY/AWS_SESSION_TOKEN/AWS_REGION;
database: PGHOST/PGPORT/PGUSER/PGPASSWORD/PGDATABASE/MYSQL_PWD;
ssh_key: KM_KEY_FILE (temp 0600 file, shredded after) + GIT_SSH_COMMAND.
env maps extra var names to fields, e.g. {"JENKINS_TOKEN": "token"} or templates
{"CREDS": "{{km.username}}:{{km.password}}"}. stdin also supports {{km.*}} placeholders.
Example: curl -su "$KM_USERNAME:$KM_TOKEN" https://ci.example.com/api/json
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| env | No | ||
| ref | Yes | ||
| stdin | No | ||
| command | Yes | ||
| purpose | No | ||
| timeout | No |