feat(mcp): add transport security configuration for remote access#1157
Open
Milofax wants to merge 1 commit intogetzep:mainfrom
Open
feat(mcp): add transport security configuration for remote access#1157Milofax wants to merge 1 commit intogetzep:mainfrom
Milofax wants to merge 1 commit intogetzep:mainfrom
Conversation
This was referenced Jan 22, 2026
Contributor
Author
|
Friendly ping on this PR — adds transport security configuration for remote MCP access. Important for anyone running Graphiti MCP outside localhost. Happy to address any feedback! |
Add support for configuring allowed hosts and origins when deploying the MCP server behind a reverse proxy. This addresses the DNS rebinding protection that causes "Invalid Host header" (421) errors when accessing the server via a custom domain. Changes: - Add `allowed_hosts`, `allowed_origins`, and `enable_dns_rebinding_protection` fields to ServerConfig schema - Add `build_transport_security()` helper function that creates TransportSecuritySettings from config - Integrate transport security configuration in server initialization - Update MCP SDK requirement to >=1.23.0 (TransportSecuritySettings support) - Add unit tests for transport security configuration - Document transport security options in README.md - Add commented example in config.yaml Fixes DNS rebinding protection issues (CVE-2025-66416) when running behind Nginx, Traefik, Caddy, or other reverse proxies. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
f482e1e to
5f2acce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds support for configuring transport security settings (allowed hosts and origins) when deploying the MCP server behind a reverse proxy like Nginx, Traefik, or Caddy.
Problem: The MCP server returns "Invalid Host header" (421) errors when accessed via a custom domain because the MCP SDK's DNS rebinding protection only allows localhost by default.
Solution: Make
allowed_hosts,allowed_origins, andenable_dns_rebinding_protectionconfigurable viaconfig.yaml.Changes
ServerConfigschema (allowed_hosts,allowed_origins,enable_dns_rebinding_protection)build_transport_security()helper function that createsTransportSecuritySettingsfrom configmcp.settings.transport_security>=1.23.0(required forTransportSecuritySettingssupport)Example Configuration
Test plan
build_transport_security()functionServerConfigschema with new fieldsuv run python tests/test_configuration.py)Related
🤖 Generated with Claude Code