Skip to content

fix(mcp): expand bare environment references in headers and URLs - #374

Merged
zpzjzj merged 1 commit into
alibaba:mainfrom
karanb192:fix/mcp-bare-env-refs
Nov 4, 2026
Merged

zpzjzj merged 1 commit into
alibaba:mainfrom
karanb192:fix/mcp-bare-env-refs

Conversation

@karanb192

Copy link
Copy Markdown
Contributor

Summary

The documented full-value $VAR form is accepted by MCP provisioning but can reach the engine as literal text. For example, PRIVATE-TOKEN: $MCP_TOKEN becomes the literal header argument PRIVATE-TOKEN:$MCP_TOKEN in the Claude-compatible installers and Codex's MCP bridge. OpenCode also keeps $MCP_URL as its URL.

Normalize whole-value header and endpoint references to ${VAR} in the provisioner so the existing adapter expansion handles them. Referenced values stay in the runtime environment; the normalized fields retain references. The configuration schema is unchanged.

Test plan

  • Regression probes fail before the fix and pass after it, capturing shell arguments with a private stub and checking OpenCode's generated config. No real agent CLI or MCP server is used.
  • Provisioner tests cover bare and braced references, endpoints from config_ref, inline endpoint overrides, and environment propagation. Shell probes include spaces, quotes and shell metacharacters in the token.
  • make verify passes with zero findings.
  • go test -tags e2e ./e2e passes, with agent CLIs removed from PATH.
  • make test passes on the rebased head, including the plugin, skill regression and Go race tests. Earlier runs hit the pre-existing TestCustomAgent_RunLocal_TimeoutPreservesUsableStdoutResult timing failure; the full rerun passes.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-03T04:33:34.588791Z 5063abb PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@zpzjzj zpzjzj left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@zpzjzj
zpzjzj added this pull request to the merge queue Nov 4, 2026
Merged via the queue into alibaba:main with commit 45e9c72 Nov 4, 2026
14 checks passed
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

Successfully merging this pull request may close these issues.

2 participants