[FEATURE REQUEST] programatic env variable evaluation
Resolved 💬 4 comments Opened Apr 5, 2025 by totalolage Closed Dec 10, 2025
Usecase
I want to be able to commit my .claude.json file so that I can keep a history of my setup, as I do with all other config files. However currently the recommended approach for setting up MCP servers with credentials is to hardcode the secrets into the env field of the server config in the Claude json file. This stops it from being able to be safely commited.
Desired solution
I would like for env variables to have some magic prefix (maybe !cmd:) that will cause them to be evaluated in a shell and the output to be substituted for the variable value. This would allow me to replace this:
{
"mcpServers": {
"a-server": {
"env": {
"access-token": "xx-my-secret-access-token"
}
}
}
with this, which can be commited:
{
"mcpServers": {
"a-server": {
"env": {
"access-token": "!cmd:security find-generic-password -a my_service_key -s claude_code -w"
}
}
}This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗