Skip to content

feat(mcp): component_mcp TLS, mandatory off loopback (Phase 5) - #263

Open
askdba wants to merge 1 commit into
mainfrom
feat/mcp-tls
Open

askdba wants to merge 1 commit into
mainfrom
feat/mcp-tls

Conversation

@askdba

@askdba askdba commented Nov 2, 2026

Copy link
Copy Markdown
Owner

Phase 5 item from #256: TLS, mandatory off loopback (RFC 0001 §5.3).

Change

  • mcp_http.bind_address (read-only, default 127.0.0.1): the listen address. The spike was hard-wired to 127.0.0.1.
  • mcp_http.ssl_cert, mcp_http.ssl_key (read-only): PEM files. With both set, the endpoint serves HTTPS through Router's TlsServerContext (TLS 1.2+). The context is built the way Router's http_server plugin builds it: load_key_and_cert plus default DH.
  • Plain HTTP is allowed only on loopback (127.0.0.0/8, ::1, localhost).
    • A non-loopback address without TLS makes the install fail with an error in the log.
    • So does setting only one of the two files.
    • So the bearer token never crosses a network in the clear.
  • Startup errors are now logged at error level, not information.

Tests

scripts/test-mcp-endpoint.sh on mysql:26.10.0: 37 passed, 0 failed. New checks:

  • bind_address = '0.0.0.0' without TLS: the install is refused;
  • a certificate without a key: refused;
  • 0.0.0.0 with the server's own server-cert.pem / server-key.pem: installs. Then:
    • HTTPS works on loopback;
    • HTTPS works from another container over the bridge network (a non-loopback client);
    • plain HTTP to the TLS port gets no reply.

The existing loopback/plain-HTTP checks are unchanged.

Docs: settings table, network bullet, CHANGELOG.

Independent of #257–#262.

Part of #256.

🤖 Generated with Claude Code

- mcp_http.bind_address (read-only, default 127.0.0.1): listen address.
- mcp_http.ssl_cert / mcp_http.ssl_key (read-only): PEM files; with both,
  the endpoint serves HTTPS through Router's TlsServerContext (TLS 1.2+),
  as Router's http_server plugin builds it.
- RFC 0001 §5.3: plain HTTP only on loopback (127.0.0.0/8, ::1,
  localhost). A non-loopback address without TLS, or only one of the two
  files, fails the install with an error in the log.

test-mcp-endpoint.sh: both refusals, HTTPS on loopback and from another
container over the bridge network (server-cert.pem from the datadir), and
plain HTTP to the TLS port gets no reply. 37 checks.

Part of #256 (RFC 0001 Phase 5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 1e3cb656-9715-4342-bdac-f70c276d2aee
Commits

Reviewing files that changed from the base of the PR and between ff59fea and 70ad857.

Files selected for processing: 4
  • CHANGELOG.md
  • docs/MCP_COMPONENTS.md
  • scripts/test-mcp-endpoint.sh
  • src/mcp/endpoint/component_mcp.cc
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-02T10:14:40.443374Z 70ad857 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.

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