Skip to content

Disable DNS rebinding protection for FastMCP in Docker - #137

Merged
m1rl0k merged 4 commits into
testfrom
transport-fix
Dec 30, 2025
Merged

m1rl0k merged 4 commits into
testfrom
transport-fix

Conversation

@m1rl0k

@m1rl0k m1rl0k commented Dec 30, 2025

Copy link
Copy Markdown
Collaborator

Updated both mcp_indexer_server.py and mcp_memory_server.py to disable DNS rebinding protection in FastMCP by setting transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False). This change is necessary to allow proper internal networking when running the servers inside Docker containers.

Updated both mcp_indexer_server.py and mcp_memory_server.py to disable DNS rebinding protection in FastMCP by setting transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False). This change is necessary to allow proper internal networking when running the servers inside Docker containers.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR disables DNS rebinding protection for FastMCP servers running in Docker containers to enable proper internal networking when services communicate using internal hostnames (e.g., mcp:8000).

Key changes:

  • Added import of TransportSecuritySettings from the MCP library with fallback handling for older versions
  • Configured both memory and indexer MCP servers to disable DNS rebinding protection via the transport_security parameter

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
scripts/mcp_memory_server.py Added TransportSecuritySettings import with exception handling and configured FastMCP instance to disable DNS rebinding protection
scripts/mcp_indexer_server.py Added TransportSecuritySettings import with ImportError handling and configured FastMCP instance to disable DNS rebinding protection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread scripts/mcp_memory_server.py
Comment thread scripts/mcp_memory_server.py
Comment thread scripts/mcp_indexer_server.py
@voarsh2

voarsh2 commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

Dumbo copilot review lol

Updated both Dockerfile and Dockerfile.mcp to explicitly pin mcp to 1.17.0 and fastmcp to 2.12.4 for consistency across services and alignment with requirements.txt. This ensures reproducible builds and avoids issues from unintentional upgrades.
@voarsh2

voarsh2 commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

Tested locally, working...

Updated both Dockerfile and Dockerfile.mcp to install Python dependencies from a shared requirements.txt file for improved consistency and maintainability across services.
@voarsh2

voarsh2 commented Dec 30, 2025

Copy link
Copy Markdown
Contributor

LGTM

@m1rl0k
m1rl0k merged commit 0a606f2 into test Dec 30, 2025
1 check passed
@voarsh2
voarsh2 deleted the transport-fix branch December 30, 2025 23:21
m1rl0k added a commit that referenced this pull request Mar 1, 2026
Disable DNS rebinding protection for FastMCP in Docker
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.

3 participants