goose icon indicating copy to clipboard operation
goose copied to clipboard

Reference environment variable in http extension header value

Open giacomochiarella opened this issue 4 months ago • 4 comments

Describe the bug I'm not sure if this is a bug. I would expect so just because otherwise it does not make any sense in my head to have environment variables in http extensions. It looks impossible to reference an environment variable in an header value in http extension I want to be able to add an environment variable (which could be a secret), let's name it MY_VAR, and then add a new header with MY_VAR referenced in the value of the header like $MY_VAR or ${MY_VAR} or {{MY_VAR}} or %MY_VAR%. I've tried all of the above and none worked.

To Reproduce Steps to reproduce the behavior:

  1. Add a new Goose http extension
  2. Add a new environment variable
  3. Add a new header
  4. Reference the environment variable
  5. enable it
  6. add a log into your mcp serverthe log will print the variable name instead of the variable value

Expected behavior I expect the environment variable name is resolved in the header value when referenced

Please provide following information:

  • OS & Arch: Mac OS Sequoia
  • Version: 1.6.0
  • Provider & Model: Google - gemini-2.5-flash

giacomochiarella avatar Aug 23 '25 12:08 giacomochiarella

I've just noticed environment variable resolution does not work also in the endpoint field. I tried this url http://127.0.0.1:11000/mcp?par1=$MY_VAR and what I get in the mcp server is the string $MY_VAR, not the actual value stored in MY_VAR env var

giacomochiarella avatar Aug 23 '25 14:08 giacomochiarella

@amed-xyz - does this seem reasonable?

DOsinga avatar Oct 06 '25 09:10 DOsinga

I think this can be split into a bug and a feature:

  1. Bug: while one can specify ENV variables in the UI for HTTP extensions, they're actually never used. We actually don't have a known use case for that yet, so we should remove it from the UI since it's misleading.
  2. Feature: we don't support variable interpolation on either of HTTP, ENV or URL. I suspect mainly because we haven't seen a use case yet, but could make sense supporting it.

amed-xyz avatar Oct 28 '25 23:10 amed-xyz

@amed-xyz if I want to add a token in the url (like an api key) currently I need to set it up in the url as plain string, instead, env var would hide the value (as far as I saw env var values are hidden once they are set)

giacomochiarella avatar Oct 29 '25 07:10 giacomochiarella