Skip to content

Dest server.json file support env var? #176

Answered by ravitemer
inevity asked this question in Q&A
Discussion options

You must be logged in to vote

@inevity You can use ${} placeholder for any env vars. MCP Hub will replace ${VAR} with actual variable. For e.g:

{
  "github": {
    "headers": {
      "Authorization": "Bearer ${GITHUB_ACCESS_TOKEN}"
    },
    "url": "https://api.githubcopilot.com/mcp/",
  }
}

In case you store secret in some vault, you can also use ${cmd:} placeholders:

{
  "github": {
    "headers": {
      "Authorization": "Bearer ${cmd:  echo 'mysecret'}"
    },
    "url": "https://api.githubcopilot.com/mcp/",
  }
}

Refer to https://ravitemer.github.io/mcphub.nvim/mcp/servers_json.html#universal-placeholder-syntax

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by ravitemer
Comment options

You must be logged in to vote
2 replies
@ravitemer
Comment options

@inevity
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #175 on June 22, 2025 08:00.