Skip to content

fix(mcp): require HTTPS for remote connections - #1910

Draft
Qiyuanqiii wants to merge 1 commit into
alibaba:mainfrom
Qiyuanqiii:Qiyuanqiii/mcp-https-split
Draft

Qiyuanqiii wants to merge 1 commit into
alibaba:mainfrom
Qiyuanqiii:Qiyuanqiii/mcp-https-split

Conversation

@Qiyuanqiii

Copy link
Copy Markdown
Contributor

Behavior

Remote MCP connections now require HTTPS before headers are expanded or sent. HTTP remains available for explicit localhost or loopback IP endpoints used in local development. Redirects must retain the original scheme, host and effective port, preventing configured headers from being reapplied to another origin.

Extracted from #1738 into an independent PR against main. This works with existing manually configured MCP servers; it contains no plugin package manager, project locks or VCS changes. Non-loopback HTTP configurations must migrate to HTTPS.

Review order

  1. internal/mcp/endpoint.go: endpoint and redirect policy.
  2. internal/mcp/client.go: apply the policy before connecting.
  3. internal/mcp/endpoint_test.go: URL cases and actual MCP connections, redirects and credential delivery.
  4. MCP documentation in English, Simplified Chinese, Japanese, Korean and Russian.

Validation

Verified on Windows with Go 1.26.10:

  • make license-add and make check passed.
  • make test PACKAGES=./internal/mcp passed with the race detector.
  • OCR reviewed the two selected implementation files. Its two low-priority suggestions were considered: equivalent hostname spellings intentionally remain distinct for redirect policy, and URL validation errors intentionally avoid echoing potentially credential-bearing input.

Credit and AI disclosure

@irvallensar is retained as co-author for the HTTPS-by-default proposal. The trusted-policy integration-test contribution stays with the deferred CI work from #1738.

OpenAI Codex (GPT-6) assisted with extraction, tests and documentation; OCR reviewed the change using the configured DeepSeek provider. Earlier implementation also used GPT-6.1 Sol agents.

  • Contributor self-review is complete.

@github-actions

Copy link
Copy Markdown
Contributor

✅ OpenCodeReview: Review complete: 0 finding(s) across 2 selected item(s).

@Qiyuanqiii

Qiyuanqiii commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor Author

This PR is split out from #1738, so we'll wait it for the time being.

This branch has not been deployed

No deployments
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.

1 participant