fix(mcp): nginx Host=localhost pour passer la protection DNS rebinding FastMCP
This commit is contained in:
@@ -4,7 +4,6 @@ from datetime import datetime, timedelta, timezone, date as date_type
|
||||
from decimal import Decimal
|
||||
|
||||
from mcp.server.fastmcp import FastMCP
|
||||
from mcp.server.transport_security import TransportSecuritySettings
|
||||
from sqlalchemy import select, and_, text, or_
|
||||
from sqlalchemy.orm import selectinload
|
||||
|
||||
@@ -16,12 +15,7 @@ from app.models.shopping import ShoppingList, ListItem, Product
|
||||
_VALID_STATUSES = {"pending", "done", "cancelled"}
|
||||
_VALID_PRIORITIES = {"low", "medium", "high"}
|
||||
|
||||
mcp = FastMCP(
|
||||
"HomeHub",
|
||||
stateless_http=True,
|
||||
streamable_http_path="/",
|
||||
transport_security=TransportSecuritySettings(enable_dns_rebinding_protection=False),
|
||||
)
|
||||
mcp = FastMCP("HomeHub", stateless_http=True, streamable_http_path="/")
|
||||
|
||||
|
||||
def _serialize(obj):
|
||||
|
||||
+1
-1
@@ -27,7 +27,7 @@ server {
|
||||
|
||||
location /mcp {
|
||||
proxy_pass http://backend:8000/mcp;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header Host localhost;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
|
||||
Reference in New Issue
Block a user