Skip to content

feat: Add transport security configuration with DNS rebinding protection#144

Open
DavidFHCh wants to merge 5 commits intocrystaldba:mainfrom
DavidFHCh:feature/configurable-transport-security
Open

feat: Add transport security configuration with DNS rebinding protection#144
DavidFHCh wants to merge 5 commits intocrystaldba:mainfrom
DavidFHCh:feature/configurable-transport-security

Conversation

@DavidFHCh
Copy link

No description provided.

DavidFHCh and others added 2 commits January 31, 2026 23:20
- Add --disable-dns-rebinding-protection, --allowed-hosts, --allowed-origins CLI flags
- Move transport security from module-level init to main() (after argparse)
- Apply transport security only for SSE and streamable-http transports (not stdio)
- Env vars (POSTGRES_MCP_*) override CLI flags when both are set
- Add comprehensive test suite: 10 scenarios × 2 transports = 20 tests

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EliShteinman and others added 2 commits February 13, 2026 10:50
Align with the shorter MCP_* naming convention used in the original PR.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Rename MCP_DNS_REBINDING_PROTECTION to MCP_ENABLE_DNS_REBINDING_PROTECTION
- Add monkeypatch fixture to clear MCP_* env vars in tests
- Remove coupling to FastMCP upstream defaults in test_default_defers_to_fastmcp
- Update README with CLI flags documentation table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
EliShteinman added a commit to EliShteinman/postgres-mcp that referenced this pull request Feb 13, 2026
- Use MCP_ENABLE_DNS_REBINDING_PROTECTION env var name (matching upstream)
- Add monkeypatch env cleanup in tests to prevent flakiness
- Remove coupling to FastMCP upstream defaults in tests
- Update README with CLI flags + env vars documentation table

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…hancements

feat: add CLI flags and tests for transport security
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