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
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"ref": "<ref>",
"command": "<command>"
},
"name": "run_with_credential"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | ||
| env | No | ||
| ref | Yes | ||
| stdin | No | ||
| command | Yes | ||
| purpose | No | ||
| timeout | No |