Skip to content

MCP server env secret placeholders are not passed to spawned process #4985

Description

@nathbooth

Describe the bug

On macOS, a secret configured for a stdio MCP server using Copilot CLI's ${secret:...} placeholder does not appear to reach the spawned server process.

The same server works when the credential is provided as a normal process environment variable. When launched by Copilot CLI using the secret placeholder, authentication fails because the server behaves as if the environment variable is unset.

Affected version

GitHub Copilot CLI 1.0.88.

Steps to reproduce the behavior

No response

Expected behavior

  1. Store a test credential using Copilot CLI's MCP secret mechanism.
  2. Configure a stdio MCP server with an environment entry like "API_TOKEN": "${secret:example-mcp/env/API_TOKEN/v}".
  3. Start the MCP server through Copilot CLI and call a tool that checks whether API_TOKEN is set.
  4. Start the same server outside Copilot CLI with API_TOKEN set directly in its process environment.

Actual behaviour

The server launched by Copilot CLI behaves as if API_TOKEN is missing. The same server works when API_TOKEN is set directly in the process environment.

Additional context

  • OS: macOS 26.5 (25F71)
  • Server transport: stdio
  • The secret was present in the configured secret store.
  • The issue persisted after refreshing the secret and restarting Copilot CLI.
  • The report intentionally excludes the server implementation, service
    endpoints, secret values, and internal configuration paths.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:mcpMCP server configuration, discovery, connectivity, OAuth, policy, and registry

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions