Skip to content

[FEATURE REQUEST] programatic env variable evaluation #716

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
totalolage opened this issue Apr 5, 2025 · 0 comments
Open

[FEATURE REQUEST] programatic env variable evaluation #716

totalolage opened this issue Apr 5, 2025 · 0 comments

Comments

@totalolage
Copy link

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"
       }
    }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant