Skip to content

Commit ef45fe1

Browse files
authored
fix(transport): disable DNS rebinding protection + bump to 1.0.107 (#123)
The 1.0.106 canary on mcp2 returned HTTP 421 Invalid Host header for all proxied traffic. mcp 1.23.0 auto-enables transport_security with a port-wildcard allowlist (127.0.0.1:*, localhost:*, [::1]:*). The internal nginx upstream uses proxy_set_header Host with the bare host variable, which strips the port — so the forwarded Host (127.0.0.1) does not match the allowlist patterns and every request is rejected. The protection is irrelevant for a loopback-only service that external clients cannot reach. Disable it explicitly via transport_security.enable_dns_rebinding_protection=False so the allowlist constraint stops blocking proxied traffic. Direct curl on mcp2 confirms: with the disable applied locally, Host: 127.0.0.1 (no port) returns 200; without it, 421.
1 parent 893ba7b commit ef45fe1

4 files changed

Lines changed: 12 additions & 3 deletions

File tree

‎meta_ads_mcp/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
from meta_ads_mcp.core.server import main
88

9-
__version__ = "1.0.106"
9+
__version__ = "1.0.107"
1010

1111
__all__ = [
1212
'get_ad_accounts',

‎meta_ads_mcp/core/server.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,15 @@ def main():
341341
# forwarded by an upstream proxy at .../mcp/ are served directly
342342
# instead of receiving a 307 redirect to /mcp (the SDK default).
343343
mcp_server.settings.streamable_http_path = "/mcp/"
344+
# Disable DNS rebinding protection. The SDK auto-enables it when the
345+
# server binds to a loopback host (127.0.0.1 / localhost / ::1) and
346+
# ships a port-wildcard allowlist (127.0.0.1:*). An upstream nginx
347+
# with `proxy_set_header Host $host;` strips the port from the Host
348+
# header before forwarding, so the allowlist does not match and every
349+
# request is rejected with HTTP 421 (the 1.0.106 production
350+
# regression). The protection is irrelevant for a loopback-only
351+
# service that no external client can reach.
352+
mcp_server.settings.transport_security.enable_dns_rebinding_protection = False
344353

345354
# Import all tool modules to ensure they are registered
346355
logger.info("Ensuring all tools are registered for HTTP transport")

‎pyproject.toml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
44

55
[project]
66
name = "meta-ads-mcp"
7-
version = "1.0.106"
7+
version = "1.0.107"
88
description = "Model Context Protocol (MCP) server for Meta Ads - Use Remote MCP at pipeboard.co for easiest setup"
99
readme = "README.md"
1010
requires-python = ">=3.10"

‎server.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
33
"name": "co.pipeboard/meta-ads-mcp",
44
"description": "Facebook / Meta Ads automation with AI: analyze performance, test creatives, optimize spend.",
5-
"version": "1.0.106",
5+
"version": "1.0.107",
66
"remotes": [
77
{
88
"type": "streamable-http",

0 commit comments

Comments
 (0)