altimate-code icon indicating copy to clipboard operation
altimate-code copied to clipboard

MCP server fails to resolve environment variables in config

Open FrankTub opened this issue 8 months ago • 2 comments

When I add a MCP server in altimate code that uses an environment variable in the configuration it fails to use it. In the tool itself I can see that it can succesfully connect:

Image

Metadata

Field Value
CLI Version 0.5.17
Platform darwin
Architecture arm64
OS Release 25.3.0
Category bug
Working Directory data-warehouse-etl-dbt
Session ID ses_2aba8ca90ffeLGmZEZ4sNP90Ng

FrankTub avatar Apr 03 '26 17:04 FrankTub

Resolved in v0.5.19.

anandgupta42 avatar Apr 05 '26 05:04 anandgupta42

Technical Findings

The {env:...} syntax in altimate-code.json is not being resolved when passed to MCP servers.

Config tested (~/.config/altimate-code/altimate-code.json):

{
  "mcp": {
    "gitlab": {
      "type": "local",
      "command": ["node", ".../gitlab-mcp-server/dist/index.js"],
      "environment": {
        "GITLAB_PERSONAL_ACCESS_TOKEN": "{env:GITLAB_PERSONAL_ACCESS_TOKEN}",
        "GITLAB_API_URL": "https://gitlab.com/api/v4"
      }
    }
  }
}

Observed behavior:

  • The MCP server starts successfully but returns: MCP error -32603: This operation requires user authentication
  • The env var GITLAB_PERSONAL_ACCESS_TOKEN is set in the shell environment
  • Passing the token directly via userCredentials parameter works — confirming the MCP server itself is functional
  • The issue is that {env:GITLAB_PERSONAL_ACCESS_TOKEN} is passed as a literal string instead of being resolved to the actual value

FrankTub avatar Apr 05 '26 08:04 FrankTub